diff --git a/.gitignore b/.gitignore index 21d79becb15..fb84462083c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ build.json tests/webhost/*.d.ts tests/webhost/webtsc.js tests/*.js +tests/*.js.map tests/*.d.ts *.config scripts/debug.bat diff --git a/.travis.yml b/.travis.yml index 11396be5892..305fad1e4a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ language: node_js node_js: -- '0.10' + - '0.10' + +sudo: false before_script: npm install -g codeclimate-test-reporter after_script: -- cat coverage/lcov.info | codeclimate + - cat coverage/lcov.info | codeclimate addons: code_climate: diff --git a/Jakefile b/Jakefile index 64394c2d60e..0a34de4182b 100644 --- a/Jakefile +++ b/Jakefile @@ -82,8 +82,9 @@ var harnessSources = [ ].map(function (f) { return path.join(harnessDirectory, f); }).concat([ - "services/colorization.ts", - "services/documentRegistry.ts" + "services/colorization.ts", + "services/documentRegistry.ts", + "services/preProcessFile.ts" ].map(function (f) { return path.join(unittestsDirectory, f); })); @@ -133,7 +134,7 @@ function concatenateFiles(destinationFile, sourceFiles) { fs.renameSync(temp, destinationFile); } -var useDebugMode = false; +var useDebugMode = true; var generateDeclarations = false; var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node"); var compilerFilename = "tsc.js"; @@ -148,15 +149,16 @@ var compilerFilename = "tsc.js"; function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) { file(outFile, prereqs, function() { var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; - var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants " + var options = "-removeComments --module commonjs -noImplicitAny "; if (generateDeclarations) { options += "--declaration "; } + + if (useDebugMode) { + options += "--preserveConstEnums "; + } var cmd = host + " " + dir + compilerFilename + " " + options + " "; - if (useDebugMode) { - cmd = cmd + " " + path.join(harnessDirectory, "external/es5compat.ts") + " " + path.join(harnessDirectory, "external/json2.ts") + " "; - } cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : ""); if (useDebugMode) { cmd = cmd + " -sourcemap -mapRoot file:///" + path.resolve(path.dirname(outFile)); @@ -258,12 +260,11 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]); // Local target to build the compiler and services -desc("Emit debug mode files with sourcemaps"); -task("debug", function() { - useDebugMode = true; +desc("Sets release mode flag"); +task("release", function() { + useDebugMode = false; }); - // Set the default task to "local" task("default", ["local"]); @@ -312,7 +313,7 @@ task("generate-spec", [specMd]) // Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory desc("Makes a new LKG out of the built js files"); -task("LKG", libraryTargets, function() { +task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() { var expectedFiles = [tscFile, servicesFile].concat(libraryTargets); var missingFiles = expectedFiles.filter(function (f) { return !fs.existsSync(f); diff --git a/bin/tsc.js b/bin/tsc.js index bb432bf9c47..53e1047e852 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -128,7 +128,14 @@ var ts; Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - An_enum_member_cannot_have_a_numeric_name: { code: 1151, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, @@ -149,17 +156,16 @@ var ts; Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, + Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, @@ -172,7 +178,6 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, @@ -182,7 +187,6 @@ var ts; Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, @@ -243,12 +247,9 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, @@ -256,7 +257,6 @@ var ts; Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, @@ -275,6 +275,15 @@ var ts; Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -354,6 +363,15 @@ var ts; Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, @@ -368,8 +386,9 @@ var ts; Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, @@ -391,7 +410,7 @@ var ts; Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, @@ -421,116 +440,117 @@ var ts; var ts; (function (ts) { var textToToken = { - "any": 105 /* AnyKeyword */, - "boolean": 106 /* BooleanKeyword */, - "break": 60 /* BreakKeyword */, - "case": 61 /* CaseKeyword */, - "catch": 62 /* CatchKeyword */, - "class": 63 /* ClassKeyword */, - "continue": 65 /* ContinueKeyword */, - "const": 64 /* ConstKeyword */, - "constructor": 107 /* ConstructorKeyword */, - "debugger": 66 /* DebuggerKeyword */, - "declare": 108 /* DeclareKeyword */, - "default": 67 /* DefaultKeyword */, - "delete": 68 /* DeleteKeyword */, - "do": 69 /* DoKeyword */, - "else": 70 /* ElseKeyword */, - "enum": 71 /* EnumKeyword */, - "export": 72 /* ExportKeyword */, - "extends": 73 /* ExtendsKeyword */, - "false": 74 /* FalseKeyword */, - "finally": 75 /* FinallyKeyword */, - "for": 76 /* ForKeyword */, - "function": 77 /* FunctionKeyword */, - "get": 109 /* GetKeyword */, - "if": 78 /* IfKeyword */, - "implements": 96 /* ImplementsKeyword */, - "import": 79 /* ImportKeyword */, - "in": 80 /* InKeyword */, - "instanceof": 81 /* InstanceOfKeyword */, - "interface": 97 /* InterfaceKeyword */, - "let": 98 /* LetKeyword */, - "module": 110 /* ModuleKeyword */, - "new": 82 /* NewKeyword */, - "null": 83 /* NullKeyword */, - "number": 112 /* NumberKeyword */, - "package": 99 /* PackageKeyword */, - "private": 100 /* PrivateKeyword */, - "protected": 101 /* ProtectedKeyword */, - "public": 102 /* PublicKeyword */, - "require": 111 /* RequireKeyword */, - "return": 84 /* ReturnKeyword */, - "set": 113 /* SetKeyword */, - "static": 103 /* StaticKeyword */, - "string": 114 /* StringKeyword */, - "super": 85 /* SuperKeyword */, - "switch": 86 /* SwitchKeyword */, - "this": 87 /* ThisKeyword */, - "throw": 88 /* ThrowKeyword */, - "true": 89 /* TrueKeyword */, - "try": 90 /* TryKeyword */, - "typeof": 91 /* TypeOfKeyword */, - "var": 92 /* VarKeyword */, - "void": 93 /* VoidKeyword */, - "while": 94 /* WhileKeyword */, - "with": 95 /* WithKeyword */, - "yield": 104 /* YieldKeyword */, - "{": 9 /* OpenBraceToken */, - "}": 10 /* CloseBraceToken */, - "(": 11 /* OpenParenToken */, - ")": 12 /* CloseParenToken */, - "[": 13 /* OpenBracketToken */, - "]": 14 /* CloseBracketToken */, - ".": 15 /* DotToken */, - "...": 16 /* DotDotDotToken */, - ";": 17 /* SemicolonToken */, - ",": 18 /* CommaToken */, - "<": 19 /* LessThanToken */, - ">": 20 /* GreaterThanToken */, - "<=": 21 /* LessThanEqualsToken */, - ">=": 22 /* GreaterThanEqualsToken */, - "==": 23 /* EqualsEqualsToken */, - "!=": 24 /* ExclamationEqualsToken */, - "===": 25 /* EqualsEqualsEqualsToken */, - "!==": 26 /* ExclamationEqualsEqualsToken */, - "=>": 27 /* EqualsGreaterThanToken */, - "+": 28 /* PlusToken */, - "-": 29 /* MinusToken */, - "*": 30 /* AsteriskToken */, - "/": 31 /* SlashToken */, - "%": 32 /* PercentToken */, - "++": 33 /* PlusPlusToken */, - "--": 34 /* MinusMinusToken */, - "<<": 35 /* LessThanLessThanToken */, - ">>": 36 /* GreaterThanGreaterThanToken */, - ">>>": 37 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 38 /* AmpersandToken */, - "|": 39 /* BarToken */, - "^": 40 /* CaretToken */, - "!": 41 /* ExclamationToken */, - "~": 42 /* TildeToken */, - "&&": 43 /* AmpersandAmpersandToken */, - "||": 44 /* BarBarToken */, - "?": 45 /* QuestionToken */, - ":": 46 /* ColonToken */, - "=": 47 /* EqualsToken */, - "+=": 48 /* PlusEqualsToken */, - "-=": 49 /* MinusEqualsToken */, - "*=": 50 /* AsteriskEqualsToken */, - "/=": 51 /* SlashEqualsToken */, - "%=": 52 /* PercentEqualsToken */, - "<<=": 53 /* LessThanLessThanEqualsToken */, - ">>=": 54 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 56 /* AmpersandEqualsToken */, - "|=": 57 /* BarEqualsToken */, - "^=": 58 /* CaretEqualsToken */ + "any": 109 /* AnyKeyword */, + "boolean": 110 /* BooleanKeyword */, + "break": 64 /* BreakKeyword */, + "case": 65 /* CaseKeyword */, + "catch": 66 /* CatchKeyword */, + "class": 67 /* ClassKeyword */, + "continue": 69 /* ContinueKeyword */, + "const": 68 /* ConstKeyword */, + "constructor": 111 /* ConstructorKeyword */, + "debugger": 70 /* DebuggerKeyword */, + "declare": 112 /* DeclareKeyword */, + "default": 71 /* DefaultKeyword */, + "delete": 72 /* DeleteKeyword */, + "do": 73 /* DoKeyword */, + "else": 74 /* ElseKeyword */, + "enum": 75 /* EnumKeyword */, + "export": 76 /* ExportKeyword */, + "extends": 77 /* ExtendsKeyword */, + "false": 78 /* FalseKeyword */, + "finally": 79 /* FinallyKeyword */, + "for": 80 /* ForKeyword */, + "function": 81 /* FunctionKeyword */, + "get": 113 /* GetKeyword */, + "if": 82 /* IfKeyword */, + "implements": 100 /* ImplementsKeyword */, + "import": 83 /* ImportKeyword */, + "in": 84 /* InKeyword */, + "instanceof": 85 /* InstanceOfKeyword */, + "interface": 101 /* InterfaceKeyword */, + "let": 102 /* LetKeyword */, + "module": 114 /* ModuleKeyword */, + "new": 86 /* NewKeyword */, + "null": 87 /* NullKeyword */, + "number": 116 /* NumberKeyword */, + "package": 103 /* PackageKeyword */, + "private": 104 /* PrivateKeyword */, + "protected": 105 /* ProtectedKeyword */, + "public": 106 /* PublicKeyword */, + "require": 115 /* RequireKeyword */, + "return": 88 /* ReturnKeyword */, + "set": 117 /* SetKeyword */, + "static": 107 /* StaticKeyword */, + "string": 118 /* StringKeyword */, + "super": 89 /* SuperKeyword */, + "switch": 90 /* SwitchKeyword */, + "this": 91 /* ThisKeyword */, + "throw": 92 /* ThrowKeyword */, + "true": 93 /* TrueKeyword */, + "try": 94 /* TryKeyword */, + "type": 119 /* TypeKeyword */, + "typeof": 95 /* TypeOfKeyword */, + "var": 96 /* VarKeyword */, + "void": 97 /* VoidKeyword */, + "while": 98 /* WhileKeyword */, + "with": 99 /* WithKeyword */, + "yield": 108 /* YieldKeyword */, + "{": 13 /* OpenBraceToken */, + "}": 14 /* CloseBraceToken */, + "(": 15 /* OpenParenToken */, + ")": 16 /* CloseParenToken */, + "[": 17 /* OpenBracketToken */, + "]": 18 /* CloseBracketToken */, + ".": 19 /* DotToken */, + "...": 20 /* DotDotDotToken */, + ";": 21 /* SemicolonToken */, + ",": 22 /* CommaToken */, + "<": 23 /* LessThanToken */, + ">": 24 /* GreaterThanToken */, + "<=": 25 /* LessThanEqualsToken */, + ">=": 26 /* GreaterThanEqualsToken */, + "==": 27 /* EqualsEqualsToken */, + "!=": 28 /* ExclamationEqualsToken */, + "===": 29 /* EqualsEqualsEqualsToken */, + "!==": 30 /* ExclamationEqualsEqualsToken */, + "=>": 31 /* EqualsGreaterThanToken */, + "+": 32 /* PlusToken */, + "-": 33 /* MinusToken */, + "*": 34 /* AsteriskToken */, + "/": 35 /* SlashToken */, + "%": 36 /* PercentToken */, + "++": 37 /* PlusPlusToken */, + "--": 38 /* MinusMinusToken */, + "<<": 39 /* LessThanLessThanToken */, + ">>": 40 /* GreaterThanGreaterThanToken */, + ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 42 /* AmpersandToken */, + "|": 43 /* BarToken */, + "^": 44 /* CaretToken */, + "!": 45 /* ExclamationToken */, + "~": 46 /* TildeToken */, + "&&": 47 /* AmpersandAmpersandToken */, + "||": 48 /* BarBarToken */, + "?": 49 /* QuestionToken */, + ":": 50 /* ColonToken */, + "=": 51 /* EqualsToken */, + "+=": 52 /* PlusEqualsToken */, + "-=": 53 /* MinusEqualsToken */, + "*=": 54 /* AsteriskEqualsToken */, + "/=": 55 /* SlashEqualsToken */, + "%=": 56 /* PercentEqualsToken */, + "<<=": 57 /* LessThanLessThanEqualsToken */, + ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 60 /* AmpersandEqualsToken */, + "|=": 61 /* BarEqualsToken */, + "^=": 62 /* CaretEqualsToken */ }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, ]; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -827,10 +847,10 @@ var ts; } return +(text.substring(start, pos)); } - function scanHexDigits(count, exact) { + function scanHexDigits(count, mustMatchCount) { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; @@ -870,61 +890,7 @@ var ts; } if (ch === 92 /* backslash */) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -937,6 +903,102 @@ var ts; } return result; } + function scanTemplateAndSetTokenValue() { + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; + pos++; + var start = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(ts.Diagnostics.Unexpected_end_of_text); + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96 /* backtick */) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; + break; + } + if (currChar === 92 /* backslash */) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + if (currChar === 13 /* carriageReturn */) { + contents += text.substring(start, pos); + if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + pos++; + } + ts.Debug.assert(resultingToken !== undefined); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence() { + pos++; + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case 48 /* _0 */: + return "\0"; + case 98 /* b */: + return "\b"; + case 116 /* t */: + return "\t"; + case 110 /* n */: + return "\n"; + case 118 /* v */: + return "\v"; + case 102 /* f */: + return "\f"; + case 114 /* r */: + return "\r"; + case 39 /* singleQuote */: + return "\'"; + case 34 /* doubleQuote */: + return "\""; + case 120 /* x */: + case 117 /* u */: + var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(ts.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + case 13 /* carriageReturn */: + if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: + return ""; + default: + return String.fromCharCode(ch); + } + } function peekUnicodeEscape() { if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { var start = pos; @@ -980,7 +1042,7 @@ var ts; return token = textToToken[tokenValue]; } } - return token = 59 /* Identifier */; + return token = 63 /* Identifier */; } function scan() { startPos = pos; @@ -1025,64 +1087,66 @@ var ts; case 33 /* exclamation */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 26 /* ExclamationEqualsEqualsToken */; + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 24 /* ExclamationEqualsToken */; + return pos += 2, token = 28 /* ExclamationEqualsToken */; } - return pos++, token = 41 /* ExclamationToken */; + return pos++, token = 45 /* ExclamationToken */; case 34 /* doubleQuote */: case 39 /* singleQuote */: tokenValue = scanString(); return token = 7 /* StringLiteral */; + case 96 /* backtick */: + return token = scanTemplateAndSetTokenValue(); case 37 /* percent */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* PercentEqualsToken */; + return pos += 2, token = 56 /* PercentEqualsToken */; } - return pos++, token = 32 /* PercentToken */; + return pos++, token = 36 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 43 /* AmpersandAmpersandToken */; + return pos += 2, token = 47 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AmpersandEqualsToken */; + return pos += 2, token = 60 /* AmpersandEqualsToken */; } - return pos++, token = 38 /* AmpersandToken */; + return pos++, token = 42 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 11 /* OpenParenToken */; + return pos++, token = 15 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 12 /* CloseParenToken */; + return pos++, token = 16 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* AsteriskEqualsToken */; + return pos += 2, token = 54 /* AsteriskEqualsToken */; } - return pos++, token = 30 /* AsteriskToken */; + return pos++, token = 34 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 33 /* PlusPlusToken */; + return pos += 2, token = 37 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PlusEqualsToken */; + return pos += 2, token = 52 /* PlusEqualsToken */; } - return pos++, token = 28 /* PlusToken */; + return pos++, token = 32 /* PlusToken */; case 44 /* comma */: - return pos++, token = 18 /* CommaToken */; + return pos++, token = 22 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 34 /* MinusMinusToken */; + return pos += 2, token = 38 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 49 /* MinusEqualsToken */; + return pos += 2, token = 53 /* MinusEqualsToken */; } - return pos++, token = 29 /* MinusToken */; + return pos++, token = 33 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanNumber(); return token = 6 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 16 /* DotDotDotToken */; + return pos += 3, token = 20 /* DotDotDotToken */; } - return pos++, token = 15 /* DotToken */; + return pos++, token = 19 /* DotToken */; case 47 /* slash */: if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1131,9 +1195,9 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 51 /* SlashEqualsToken */; + return pos += 2, token = 55 /* SlashEqualsToken */; } - return pos++, token = 31 /* SlashToken */; + return pos++, token = 35 /* SlashToken */; case 48 /* _0 */: if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; @@ -1161,58 +1225,58 @@ var ts; tokenValue = "" + scanNumber(); return token = 6 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 46 /* ColonToken */; + return pos++, token = 50 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 17 /* SemicolonToken */; + return pos++, token = 21 /* SemicolonToken */; case 60 /* lessThan */: if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 53 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 35 /* LessThanLessThanToken */; + return pos += 2, token = 39 /* LessThanLessThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 21 /* LessThanEqualsToken */; + return pos += 2, token = 25 /* LessThanEqualsToken */; } - return pos++, token = 19 /* LessThanToken */; + return pos++, token = 23 /* LessThanToken */; case 61 /* equals */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 25 /* EqualsEqualsEqualsToken */; + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 23 /* EqualsEqualsToken */; + return pos += 2, token = 27 /* EqualsEqualsToken */; } if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 27 /* EqualsGreaterThanToken */; + return pos += 2, token = 31 /* EqualsGreaterThanToken */; } - return pos++, token = 47 /* EqualsToken */; + return pos++, token = 51 /* EqualsToken */; case 62 /* greaterThan */: - return pos++, token = 20 /* GreaterThanToken */; + return pos++, token = 24 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 45 /* QuestionToken */; + return pos++, token = 49 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 13 /* OpenBracketToken */; + return pos++, token = 17 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 14 /* CloseBracketToken */; + return pos++, token = 18 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* CaretEqualsToken */; + return pos += 2, token = 62 /* CaretEqualsToken */; } - return pos++, token = 40 /* CaretToken */; + return pos++, token = 44 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 9 /* OpenBraceToken */; + return pos++, token = 13 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 44 /* BarBarToken */; + return pos += 2, token = 48 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* BarEqualsToken */; + return pos += 2, token = 61 /* BarEqualsToken */; } - return pos++, token = 39 /* BarToken */; + return pos++, token = 43 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 10 /* CloseBraceToken */; + return pos++, token = 14 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 42 /* TildeToken */; + return pos++, token = 46 /* TildeToken */; case 92 /* backslash */: var ch = peekUnicodeEscape(); if (ch >= 0 && isIdentifierStart(ch)) { @@ -1248,27 +1312,27 @@ var ts; } } function reScanGreaterToken() { - if (token === 20 /* GreaterThanToken */) { + if (token === 24 /* GreaterThanToken */) { if (text.charCodeAt(pos) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 37 /* GreaterThanGreaterThanGreaterThanToken */; + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 36 /* GreaterThanGreaterThanToken */; + return pos++, token = 40 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 22 /* GreaterThanEqualsToken */; + return pos++, token = 26 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -1307,6 +1371,11 @@ var ts; } return token; } + function reScanTemplateToken() { + ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } function tryScan(callback) { var savePos = pos; var saveStartPos = startPos; @@ -1346,10 +1415,11 @@ var ts; getTokenText: function () { return text.substring(tokenPos, pos); }, getTokenValue: function () { return tokenValue; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 59 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, scan: scan, setText: setText, setTextPos: setTextPos, @@ -1360,229 +1430,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 6] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 7] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 8] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 9] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 10] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 11] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 12] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 13] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 14] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 15] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 16] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 17] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 18] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 19] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 20] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 21] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 22] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 23] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 24] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 25] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 26] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 27] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 28] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 29] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 30] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 31] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 32] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 33] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 34] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 35] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 36] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 37] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 38] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 39] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 40] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 41] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 42] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 43] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 44] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 45] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 46] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 47] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 48] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 49] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 50] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 51] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 52] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 53] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 54] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 55] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 56] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 57] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 58] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 59] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 60] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 61] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 62] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 63] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 64] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 65] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 66] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 67] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 68] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 69] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 70] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 71] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 72] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 73] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 74] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 75] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 76] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 77] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 78] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 79] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 80] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 81] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 82] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 83] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 84] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 85] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 86] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 87] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 88] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 89] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 90] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 91] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 92] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 93] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 94] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 95] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 96] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 97] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 98] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 99] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 100] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 101] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 102] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 103] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 104] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 105] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 106] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 107] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 108] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 109] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 110] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 111] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 115] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 116] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 117] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 118] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 119] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 120] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 121] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 122] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 123] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 124] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 125] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 126] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 127] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 128] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 129] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 130] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 131] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 132] = "UnionType"; - SyntaxKind[SyntaxKind["ParenType"] = 133] = "ParenType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 134] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 135] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 136] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 137] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 138] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 139] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 140] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 141] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 142] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 143] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 144] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 145] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 146] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 147] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 148] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 149] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 150] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 151] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 152] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 153] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 154] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 155] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 156] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 157] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 158] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 159] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 160] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 161] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 162] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 163] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 164] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 165] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 166] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 167] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 168] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 169] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 170] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 171] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 172] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 173] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 174] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 175] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 176] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 177] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 178] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 179] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 180] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 181] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 182] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 183] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 184] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 185] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 186] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 187] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.ParenType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.StringKeyword] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Protected"] = 0x00000040] = "Protected"; - NodeFlags[NodeFlags["Static"] = 0x00000080] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; (function (EmitReturnStatus) { EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; @@ -1592,277 +1439,12 @@ var ts; EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); var EmitReturnStatus = ts.EmitReturnStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 0x00000004] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 0x00000008] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0x00000010] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 0x00000020] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 0x00000040] = "InElementType"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0x00000000] = "None"; - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 0x00000001] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 0x00000002] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 0x08000000] = "UnionProperty"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 0x00000080] = "EnumValuesComputed"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 0x00002000] = "Tuple"; - TypeFlags[TypeFlags["Union"] = 0x00004000] = "Union"; - TypeFlags[TypeFlags["Anonymous"] = 0x00008000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00010000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Tuple | TypeFlags.Anonymous] = "ObjectType"; - TypeFlags[TypeFlags["Structured"] = TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.Union | TypeFlags.TypeParameter] = "Structured"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); var ts; (function (ts) { @@ -2068,7 +1650,8 @@ var ts; length: length, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createFileDiagnostic = createFileDiagnostic; @@ -2083,7 +1666,8 @@ var ts; length: undefined, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createCompilerDiagnostic = createCompilerDiagnostic; @@ -2100,6 +1684,12 @@ var ts; }; } ts.chainDiagnosticMessages = chainDiagnosticMessages; + function concatenateDiagnosticMessageChains(headChain, tailChain) { + Debug.assert(!headChain.next); + headChain.next = tailChain; + return headChain; + } + ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); @@ -2130,12 +1720,12 @@ var ts; ts.flattenDiagnosticChain = flattenDiagnosticChain; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFilename(diagnostic) { @@ -2153,7 +1743,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -2382,13 +1972,6 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; var Debug; (function (Debug) { var currentAssertionLevel = 0 /* None */; @@ -2609,7 +2192,7 @@ var sys = (function () { })(); var ts; (function (ts) { - var nodeConstructors = new Array(187 /* Count */); + var nodeConstructors = new Array(196 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2622,7 +2205,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 184 /* SourceFile */) + while (node && node.kind !== 193 /* SourceFile */) node = node.parent; return node; } @@ -2659,13 +2242,13 @@ var ts; } ts.unescapeIdentifier = unescapeIdentifier; function identifierToString(identifier) { - return identifier.kind === 115 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + return identifier.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); } ts.identifierToString = identifierToString; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = node.kind === 115 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); + var start = node.kind === 120 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2681,12 +2264,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: + case 181 /* VariableDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 188 /* ModuleDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: errorSpan = node.name; break; } @@ -2701,12 +2284,16 @@ var ts; return (file.flags & 1024 /* DeclarationFile */) !== 0; } ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return (node.flags & 4096 /* Const */) !== 0; + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 153 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 161 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 59 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); + return node.kind === 63 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); } function isUseStrictPrologueDirective(node) { ts.Debug.assert(isPrologueDirective(node)); @@ -2714,7 +2301,7 @@ var ts; } function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 118 /* Parameter */ || node.kind === 117 /* TypeParameter */) { + if (node.kind === 123 /* Parameter */ || node.kind === 122 /* TypeParameter */) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2750,120 +2337,128 @@ var ts; if (!node) return; switch (node.kind) { - case 116 /* QualifiedName */: + case 121 /* QualifiedName */: return child(node.left) || child(node.right); - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 118 /* Parameter */: + case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 119 /* Property */: - case 136 /* PropertyAssignment */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 127 /* TypeReference */: + case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return child(node.exprName); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return children(node.members); - case 130 /* ArrayType */: + case 135 /* ArrayType */: return child(node.elementType); - case 131 /* TupleType */: + case 136 /* TupleType */: return children(node.elementTypes); - case 132 /* UnionType */: + case 137 /* UnionType */: return children(node.types); - case 133 /* ParenType */: + case 138 /* ParenType */: return child(node.type); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return children(node.elements); - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return children(node.properties); - case 137 /* PropertyAccess */: + case 142 /* PropertyAccess */: return child(node.left) || child(node.right); - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return child(node.object) || child(node.index); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 141 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return child(node.tag) || child(node.template); + case 147 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return child(node.expression); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return child(node.operand); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return child(node.left) || child(node.right); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 184 /* SourceFile */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 193 /* SourceFile */: return children(node.statements); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return children(node.declarations); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return child(node.expression); - case 154 /* IfStatement */: + case 162 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 155 /* DoStatement */: + case 163 /* DoStatement */: return child(node.statement) || child(node.expression); - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 157 /* ForStatement */: + case 165 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 158 /* ForInStatement */: + case 166 /* ForInStatement */: return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return child(node.label); - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return child(node.expression); - case 162 /* WithStatement */: + case 170 /* WithStatement */: return child(node.expression) || child(node.statement); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 167 /* ThrowStatement */: + case 175 /* ThrowStatement */: return child(node.expression); - case 168 /* TryStatement */: + case 176 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 178 /* EnumDeclaration */: + case 186 /* TypeAliasDeclaration */: + return child(node.name) || child(node.type); + case 187 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 183 /* EnumMember */: + case 192 /* EnumMember */: return child(node.name) || child(node.initializer); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 182 /* ExportAssignment */: + case 191 /* ExportAssignment */: return child(node.exportName); + case 155 /* TemplateExpression */: + return child(node.head) || children(node.templateSpans); + case 156 /* TemplateSpan */: + return child(node.expression) || child(node.literal); } } ts.forEachChild = forEachChild; @@ -2871,24 +2466,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return visitor(node); - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 158 /* Block */: + case 183 /* FunctionBlock */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 170 /* WithStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + case 174 /* LabeledStatement */: + case 176 /* TryStatement */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: return forEachChild(node, traverse); } } @@ -2897,13 +2492,13 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: return true; } } @@ -2926,20 +2521,20 @@ var ts; return undefined; } switch (node.kind) { - case 144 /* ArrowFunction */: + case 150 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 179 /* ModuleDeclaration */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 178 /* EnumDeclaration */: - case 184 /* SourceFile */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 188 /* ModuleDeclaration */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* EnumDeclaration */: + case 193 /* SourceFile */: return node; } } @@ -2952,20 +2547,103 @@ var ts; return undefined; } switch (node.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; + function isExpression(node) { + switch (node.kind) { + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: + case 8 /* RegularExpressionLiteral */: + case 139 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 146 /* TaggedTemplateExpression */: + case 147 /* TypeAssertion */: + case 148 /* ParenExpression */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: + case 153 /* BinaryExpression */: + case 154 /* ConditionalExpression */: + case 155 /* TemplateExpression */: + case 157 /* OmittedExpression */: + return true; + case 121 /* QualifiedName */: + while (node.parent.kind === 121 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 133 /* TypeQuery */; + case 63 /* Identifier */: + if (node.parent.kind === 133 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: + case 192 /* EnumMember */: + case 141 /* PropertyAssignment */: + return parent.initializer === node; + case 161 /* ExpressionStatement */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 169 /* ReturnStatement */: + case 170 /* WithStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 175 /* ThrowStatement */: + case 171 /* SwitchStatement */: + return parent.expression === node; + case 165 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 166 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 147 /* TypeAssertion */: + return node === parent.operand; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function hasRestParameters(s) { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; } ts.hasRestParameters = hasRestParameters; + function isLiteralKind(kind) { + return 6 /* FirstLiteralToken */ <= kind && kind <= 9 /* LastLiteralToken */; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 7 /* StringLiteral */ || kind === 9 /* NoSubstitutionTemplateLiteral */; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isTemplateLiteralKind(kind) { + return 9 /* FirstTemplateToken */ <= kind && kind <= 12 /* LastTemplateToken */; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; function isInAmbientContext(node) { while (node) { if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) @@ -2977,21 +2655,22 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 122 /* TypeParameter */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return true; } return false; @@ -2999,24 +2678,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 172 /* DebuggerStatement */: - case 155 /* DoStatement */: - case 153 /* ExpressionStatement */: - case 152 /* EmptyStatement */: - case 158 /* ForInStatement */: - case 157 /* ForStatement */: - case 154 /* IfStatement */: - case 166 /* LabeledStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: - case 88 /* ThrowKeyword */: - case 168 /* TryStatement */: - case 151 /* VariableStatement */: - case 156 /* WhileStatement */: - case 162 /* WithStatement */: - case 182 /* ExportAssignment */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 180 /* DebuggerStatement */: + case 163 /* DoStatement */: + case 161 /* ExpressionStatement */: + case 160 /* EmptyStatement */: + case 166 /* ForInStatement */: + case 165 /* ForStatement */: + case 162 /* IfStatement */: + case 174 /* LabeledStatement */: + case 169 /* ReturnStatement */: + case 171 /* SwitchStatement */: + case 92 /* ThrowKeyword */: + case 176 /* TryStatement */: + case 159 /* VariableStatement */: + case 164 /* WhileStatement */: + case 170 /* WithStatement */: + case 191 /* ExportAssignment */: return true; default: return false; @@ -3024,14 +2703,14 @@ var ts; } ts.isStatement = isStatement; function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 59 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { + if (name.kind !== 63 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 143 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 149 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 170 /* CatchBlock */) { + if (parent.kind === 178 /* CatchBlock */) { return parent.variable === name; } return false; @@ -3039,15 +2718,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return node; - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -3067,107 +2747,44 @@ var ts; return undefined; } ts.getAncestor = getAncestor; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 16] = "TupleElementTypes"; - ParsingContext[ParsingContext["Count"] = 17] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; - case 16 /* TupleElementTypes */: - return ts.Diagnostics.Type_expected; + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* ModuleElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* BlockStatements */: return ts.Diagnostics.Statement_expected; + case 3 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 4 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; + case 5 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 6 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 8 /* BaseTypeReferences */: return ts.Diagnostics.Type_reference_expected; + case 9 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 10 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 11 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 12 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 13 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 14 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 15 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 16 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; } } ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; + return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { - return ts.SyntaxKind.FirstTriviaToken <= token && token <= ts.SyntaxKind.LastTriviaToken; + return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; } ts.isTrivia = isTrivia; function isModifier(token) { switch (token) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - case 72 /* ExportKeyword */: - case 108 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + case 76 /* ExportKeyword */: + case 112 /* DeclareKeyword */: return true; } return false; @@ -3329,6 +2946,9 @@ var ts; function reScanSlashToken() { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken() { + return token = scanner.reScanTemplateToken(); + } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; var saveSyntacticErrorsLength = file.syntacticErrors.length; @@ -3358,7 +2978,7 @@ var ts; return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); } function isIdentifier() { - return token === 59 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); + return token === 63 /* Identifier */ || (isInStrictMode ? token > 108 /* LastFutureReservedWord */ : token > 99 /* LastReservedWord */); } function parseExpected(t) { if (token === t) { @@ -3376,14 +2996,14 @@ var ts; return false; } function canParseSemicolon() { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { return true; } - return token === 10 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token === 14 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { nextToken(); } } @@ -3405,7 +3025,7 @@ var ts; return node; } function createMissingNode() { - return createNode(115 /* Missing */); + return createNode(120 /* Missing */); } function internIdentifier(text) { return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); @@ -3413,7 +3033,7 @@ var ts; function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { - var node = createNode(59 /* Identifier */); + var node = createNode(63 /* Identifier */); var text = escapeIdentifier(scanner.getTokenValue()); node.text = internIdentifier(text); nextToken(); @@ -3428,10 +3048,10 @@ var ts; return createIdentifier(isIdentifier()); } function parseIdentifierName() { - return createIdentifier(token >= 59 /* Identifier */); + return createIdentifier(token >= 63 /* Identifier */); } function isPropertyName() { - return token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; + return token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; } function parsePropertyName() { if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { @@ -3442,13 +3062,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function parseAnyContextualModifier() { return isModifier(token) && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function isListElement(kind, inErrorRecovery) { @@ -3460,28 +3080,28 @@ var ts; case 4 /* SwitchClauseStatements */: return isStatement(inErrorRecovery); case 3 /* SwitchClauses */: - return token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 5 /* TypeMembers */: - return isTypeMember(); + return isStartOfTypeMember(); case 6 /* ClassMembers */: return lookAhead(isClassMemberStart); case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: return isPropertyName(); case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 73 /* ExtendsKeyword */ && token !== 96 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + return isIdentifier() && ((token !== 77 /* ExtendsKeyword */ && token !== 100 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); case 9 /* VariableDeclarations */: case 14 /* TypeParameters */: return isIdentifier(); case 10 /* ArgumentExpressions */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 12 /* ArrayLiteralMembers */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 13 /* Parameters */: - return isParameter(); + return isStartOfParameter(); case 15 /* TypeArguments */: case 16 /* TupleElementTypes */: - return token === 18 /* CommaToken */ || isType(); + return token === 22 /* CommaToken */ || isStartOfType(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } @@ -3497,34 +3117,34 @@ var ts; case 6 /* ClassMembers */: case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: - return token === 10 /* CloseBraceToken */; + return token === 14 /* CloseBraceToken */; case 4 /* SwitchClauseStatements */: - return token === 10 /* CloseBraceToken */ || token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 14 /* CloseBraceToken */ || token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 8 /* BaseTypeReferences */: - return token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 14 /* TypeParameters */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */ || token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */ || token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 10 /* ArgumentExpressions */: - return token === 12 /* CloseParenToken */ || token === 17 /* SemicolonToken */; + return token === 16 /* CloseParenToken */ || token === 21 /* SemicolonToken */; case 12 /* ArrayLiteralMembers */: case 16 /* TupleElementTypes */: - return token === 14 /* CloseBracketToken */; + return token === 18 /* CloseBracketToken */; case 13 /* Parameters */: - return token === 12 /* CloseParenToken */ || token === 14 /* CloseBracketToken */ || token === 9 /* OpenBraceToken */; + return token === 16 /* CloseParenToken */ || token === 18 /* CloseBracketToken */ || token === 13 /* OpenBraceToken */; case 15 /* TypeArguments */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */; } } function isVariableDeclaratorListTerminator() { if (canParseSemicolon()) { return true; } - if (token === 80 /* InKeyword */) { + if (token === 84 /* InKeyword */) { return true; } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } return false; @@ -3585,7 +3205,7 @@ var ts; if (isListElement(kind, false)) { result.push(parseElement()); commaStart = scanner.getTokenPos(); - if (parseOptional(18 /* CommaToken */)) { + if (parseOptional(22 /* CommaToken */)) { continue; } commaStart = -1; @@ -3640,8 +3260,8 @@ var ts; } function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); - while (parseOptional(15 /* DotToken */)) { - var node = createNode(116 /* QualifiedName */, entity.pos); + while (parseOptional(19 /* DotToken */)) { + var node = createNode(121 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3653,6 +3273,35 @@ var ts; nextToken(); return finishNode(node); } + function parseTemplateExpression() { + var template = createNode(155 /* TemplateExpression */); + template.head = parseLiteralNode(); + ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); + var templateSpans = []; + templateSpans.pos = getNodePos(); + do { + templateSpans.push(parseTemplateSpan()); + } while (templateSpans[templateSpans.length - 1].literal.kind === 11 /* TemplateMiddle */); + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + return finishNode(template); + } + function parseTemplateSpan() { + var span = createNode(156 /* TemplateSpan */); + span.expression = parseExpression(false); + var literal; + if (token === 14 /* CloseBraceToken */) { + reScanTemplateToken(); + literal = parseLiteralNode(); + } + else { + error(ts.Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + span.literal = literal; + return finishNode(span); + } function parseLiteralNode(internName) { var node = createNode(token); var text = scanner.getTokenValue(); @@ -3671,30 +3320,31 @@ var ts; return node; } function parseStringLiteral() { - if (token === 7 /* StringLiteral */) + if (token === 7 /* StringLiteral */) { return parseLiteralNode(true); + } error(ts.Diagnostics.String_literal_expected); return createMissingNode(); } function parseTypeReference() { - var node = createNode(127 /* TypeReference */); + var node = createNode(132 /* TypeReference */); node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && token === 23 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(128 /* TypeQuery */); - parseExpected(91 /* TypeOfKeyword */); + var node = createNode(133 /* TypeQuery */); + parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(117 /* TypeParameter */); + var node = createNode(122 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(73 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { + if (parseOptional(77 /* ExtendsKeyword */)) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { @@ -3705,9 +3355,9 @@ var ts; return finishNode(node); } function parseTypeParameters() { - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); if (!result.length) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -3717,23 +3367,23 @@ var ts; } } function parseParameterType() { - return parseOptional(46 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; } - function isParameter() { - return token === 16 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + function isStartOfParameter() { + return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(118 /* Parameter */); + var node = createNode(123 /* Parameter */); node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(16 /* DotDotDotToken */)) { + if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 115 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 120 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } node.type = parseParameterType(); @@ -3741,11 +3391,11 @@ var ts; return finishNode(node); } function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 125 /* ConstructSignature */) { - parseExpected(82 /* NewKeyword */); + if (kind === 130 /* ConstructSignature */) { + parseExpected(86 /* NewKeyword */); } var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(11 /* OpenParenToken */, 12 /* CloseParenToken */); + var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); checkParameterList(parameters); var type; if (returnTokenRequired) { @@ -3812,10 +3462,10 @@ var ts; return finishNode(node); } function parseIndexSignatureMember() { - var node = createNode(126 /* IndexSignature */); + var node = createNode(131 /* IndexSignature */); var errorCountBeforeIndexSignature = file.syntacticErrors.length; var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); var indexerLength = scanner.getStartPos() - indexerStart; node.type = parseTypeAnnotation(); parseSemicolon(); @@ -3840,7 +3490,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); return; } - else if (parameter.flags & ts.NodeFlags.Modifier) { + else if (parameter.flags & 243 /* Modifier */) { grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); return; } @@ -3856,7 +3506,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); return; } - else if (parameter.type.kind !== 114 /* StringKeyword */ && parameter.type.kind !== 112 /* NumberKeyword */) { + else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); return; } @@ -3868,58 +3518,58 @@ var ts; function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 120 /* Method */; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node.kind = 125 /* Method */; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 119 /* Property */; + node.kind = 124 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); return finishNode(node); } - function isTypeMember() { + function isStartOfTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 17 /* OpenBracketToken */: return true; default: - return isPropertyName() && lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */ || token === 45 /* QuestionToken */ || token === 46 /* ColonToken */ || canParseSemicolon(); }); + return isPropertyName() && lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */ || token === 49 /* QuestionToken */ || token === 50 /* ColonToken */ || canParseSemicolon(); }); } } function parseTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseSignatureMember(124 /* CallSignature */, 46 /* ColonToken */); - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); + case 17 /* OpenBracketToken */: return parseIndexSignatureMember(); - case 82 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(125 /* ConstructSignature */, 46 /* ColonToken */); + case 86 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { + return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); } case 7 /* StringLiteral */: case 6 /* NumericLiteral */: return parsePropertyOrMethod(); default: - if (token >= 59 /* Identifier */) { + if (token >= 63 /* Identifier */) { return parsePropertyOrMethod(); } } } function parseTypeLiteral() { - var node = createNode(129 /* TypeLiteral */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(134 /* TypeLiteral */); + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -3927,26 +3577,26 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(131 /* TupleType */); + var node = createNode(136 /* TupleType */); var startTokenPos = scanner.getTokenPos(); var startErrorCount = file.syntacticErrors.length; - node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 17 /* OpenBracketToken */, 18 /* CloseBracketToken */); if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); } return finishNode(node); } function parseParenType() { - var node = createNode(133 /* ParenType */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(138 /* ParenType */); + parseExpected(15 /* OpenParenToken */); node.type = parseType(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseFunctionType(signatureKind) { - var node = createNode(129 /* TypeLiteral */); + var node = createNode(134 /* TypeLiteral */); var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); + var sig = parseSignature(signatureKind, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; @@ -3956,24 +3606,24 @@ var ts; } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 15 /* DotToken */ ? undefined : node; + return token === 19 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return parseTypeQuery(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseTypeLiteral(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseTupleType(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenType(); default: if (isIdentifier()) { @@ -3983,23 +3633,23 @@ var ts; error(ts.Diagnostics.Type_expected); return createMissingNode(); } - function isType() { + function isStartOfType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - case 91 /* TypeOfKeyword */: - case 9 /* OpenBraceToken */: - case 13 /* OpenBracketToken */: - case 19 /* LessThanToken */: - case 82 /* NewKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: + case 95 /* TypeOfKeyword */: + case 13 /* OpenBraceToken */: + case 17 /* OpenBracketToken */: + case 23 /* LessThanToken */: + case 86 /* NewKeyword */: return true; - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return lookAhead(function () { nextToken(); - return token === 12 /* CloseParenToken */ || isParameter() || isType(); + return token === 16 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); @@ -4007,9 +3657,9 @@ var ts; } function parsePrimaryType() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { - parseExpected(14 /* CloseBracketToken */); - var node = createNode(130 /* ArrayType */, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { + parseExpected(18 /* CloseBracketToken */); + var node = createNode(135 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -4017,33 +3667,33 @@ var ts; } function parseUnionType() { var type = parsePrimaryType(); - if (token === 39 /* BarToken */) { + if (token === 43 /* BarToken */) { var types = [type]; types.pos = type.pos; - while (parseOptional(39 /* BarToken */)) { + while (parseOptional(43 /* BarToken */)) { types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(132 /* UnionType */, type.pos); + var node = createNode(137 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } return type; } - function isFunctionType() { - return token === 19 /* LessThanToken */ || token === 11 /* OpenParenToken */ && lookAhead(function () { + function isStartOfFunctionType() { + return token === 23 /* LessThanToken */ || token === 15 /* OpenParenToken */ && lookAhead(function () { nextToken(); - if (token === 12 /* CloseParenToken */ || token === 16 /* DotDotDotToken */) { + if (token === 16 /* CloseParenToken */ || token === 20 /* DotDotDotToken */) { return true; } if (isIdentifier() || isModifier(token)) { nextToken(); - if (token === 46 /* ColonToken */ || token === 18 /* CommaToken */ || token === 45 /* QuestionToken */ || token === 47 /* EqualsToken */ || isIdentifier() || isModifier(token)) { + if (token === 50 /* ColonToken */ || token === 22 /* CommaToken */ || token === 49 /* QuestionToken */ || token === 51 /* EqualsToken */ || isIdentifier() || isModifier(token)) { return true; } - if (token === 12 /* CloseParenToken */) { + if (token === 16 /* CloseParenToken */) { nextToken(); - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } } @@ -4052,66 +3702,68 @@ var ts; }); } function parseType() { - if (isFunctionType()) { - return parseFunctionType(124 /* CallSignature */); + if (isStartOfFunctionType()) { + return parseFunctionType(129 /* CallSignature */); } - if (token === 82 /* NewKeyword */) { - return parseFunctionType(125 /* ConstructSignature */); + if (token === 86 /* NewKeyword */) { + return parseFunctionType(130 /* ConstructSignature */); } return parseUnionType(); } function parseTypeAnnotation() { - return parseOptional(46 /* ColonToken */) ? parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? parseType() : undefined; } - function isExpression() { + function isStartOfExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 11 /* OpenParenToken */: - case 13 /* OpenBracketToken */: - case 9 /* OpenBraceToken */: - case 77 /* FunctionKeyword */: - case 82 /* NewKeyword */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - case 19 /* LessThanToken */: - case 59 /* Identifier */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 15 /* OpenParenToken */: + case 17 /* OpenBracketToken */: + case 13 /* OpenBraceToken */: + case 81 /* FunctionKeyword */: + case 86 /* NewKeyword */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: + case 23 /* LessThanToken */: + case 63 /* Identifier */: return true; default: return isIdentifier(); } } - function isExpressionStatement() { - return token !== 9 /* OpenBraceToken */ && token !== 77 /* FunctionKeyword */ && isExpression(); + function isStartOfExpressionStatement() { + return token !== 13 /* OpenBraceToken */ && token !== 81 /* FunctionKeyword */ && isStartOfExpression(); } function parseExpression(noIn) { var expr = parseAssignmentExpression(noIn); - while (parseOptional(18 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 18 /* CommaToken */, parseAssignmentExpression(noIn)); + while (parseOptional(22 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 22 /* CommaToken */, parseAssignmentExpression(noIn)); } return expr; } function parseInitializer(inParameter, noIn) { - if (token !== 47 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 9 /* OpenBraceToken */) || !isExpression()) { + if (token !== 51 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 13 /* OpenBraceToken */) || !isStartOfExpression()) { return undefined; } } - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { @@ -4120,7 +3772,7 @@ var ts; return arrowExpression; } var expr = parseConditionalExpression(noIn); - if (expr.kind === 59 /* Identifier */ && token === 27 /* EqualsGreaterThanToken */) { + if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { @@ -4136,33 +3788,36 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 140 /* NewExpression */: - case 139 /* CallExpression */: - case 134 /* ArrayLiteral */: - case 142 /* ParenExpression */: - case 135 /* ObjectLiteral */: - case 143 /* FunctionExpression */: - case 59 /* Identifier */: - case 115 /* Missing */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 145 /* NewExpression */: + case 144 /* CallExpression */: + case 146 /* TaggedTemplateExpression */: + case 139 /* ArrayLiteral */: + case 148 /* ParenExpression */: + case 140 /* ObjectLiteral */: + case 149 /* FunctionExpression */: + case 63 /* Identifier */: + case 120 /* Missing */: case 8 /* RegularExpressionLiteral */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 74 /* FalseKeyword */: - case 83 /* NullKeyword */: - case 87 /* ThisKeyword */: - case 89 /* TrueKeyword */: - case 85 /* SuperKeyword */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 155 /* TemplateExpression */: + case 78 /* FalseKeyword */: + case 87 /* NullKeyword */: + case 91 /* ThisKeyword */: + case 93 /* TrueKeyword */: + case 89 /* SuperKeyword */: return true; } } return false; } function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(118 /* Parameter */, identifier.pos); + ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(31 /* EqualsGreaterThanToken */); + var parameter = createNode(123 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -4179,17 +3834,17 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (parseExpected(31 /* EqualsGreaterThanToken */) || token === 13 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { - parseExpected(27 /* EqualsGreaterThanToken */); + parseExpected(31 /* EqualsGreaterThanToken */); return parseArrowExpressionTail(pos, sig, false); } else { @@ -4197,35 +3852,35 @@ var ts; } } function isParenthesizedArrowFunctionExpression() { - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { return lookAhead(function () { var first = token; var second = nextToken(); - if (first === 11 /* OpenParenToken */) { - if (second === 12 /* CloseParenToken */) { + if (first === 15 /* OpenParenToken */) { + if (second === 16 /* CloseParenToken */) { var third = nextToken(); switch (third) { - case 27 /* EqualsGreaterThanToken */: - case 46 /* ColonToken */: - case 9 /* OpenBraceToken */: + case 31 /* EqualsGreaterThanToken */: + case 50 /* ColonToken */: + case 13 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; } } - if (second === 16 /* DotDotDotToken */) { + if (second === 20 /* DotDotDotToken */) { return 1 /* True */; } if (!isIdentifier()) { return 0 /* False */; } - if (nextToken() === 46 /* ColonToken */) { + if (nextToken() === 50 /* ColonToken */) { return 1 /* True */; } return 2 /* Unknown */; } else { - ts.Debug.assert(first === 19 /* LessThanToken */); + ts.Debug.assert(first === 23 /* LessThanToken */); if (!isIdentifier()) { return 0 /* False */; } @@ -4233,15 +3888,15 @@ var ts; } }); } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return 1 /* True */; } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (token === 31 /* EqualsGreaterThanToken */ || token === 13 /* OpenBraceToken */) { return sig; } return undefined; @@ -4249,27 +3904,27 @@ var ts; } function parseArrowExpressionTail(pos, sig, noIn) { var body; - if (token === 9 /* OpenBraceToken */) { + if (token === 13 /* OpenBraceToken */) { body = parseBody(false); } - else if (isStatement(true) && !isExpressionStatement() && token !== 77 /* FunctionKeyword */) { + else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { body = parseBody(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, body); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, body); } function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); - while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(148 /* ConditionalExpression */, expr.pos); + while (parseOptional(49 /* QuestionToken */)) { + var node = createNode(154 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.whenFalse = parseAssignmentExpression(noIn); expr = finishNode(node); } @@ -4282,7 +3937,7 @@ var ts; while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 80 /* InKeyword */)) { + if (precedence && precedence > minPrecedence && (!noIn || token !== 84 /* InKeyword */)) { var operator = token; nextToken(); expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); @@ -4293,44 +3948,44 @@ var ts; } function getOperatorPrecedence() { switch (token) { - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return 1; - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return 2; - case 39 /* BarToken */: + case 43 /* BarToken */: return 3; - case 40 /* CaretToken */: + case 44 /* CaretToken */: return 4; - case 38 /* AmpersandToken */: + case 42 /* AmpersandToken */: return 5; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: return 6; - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: return 7; - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 28 /* PlusToken */: - case 29 /* MinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: return 9; - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: return 10; } return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(147 /* BinaryExpression */, left.pos); + var node = createNode(153 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4339,52 +3994,52 @@ var ts; function parseUnaryExpression() { var pos = getNodePos(); switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var operator = token; nextToken(); var operand = parseUnaryExpression(); if (isInStrictMode) { - if ((operator === 33 /* PlusPlusToken */ || operator === 34 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { + if ((operator === 37 /* PlusPlusToken */ || operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { reportInvalidUseInStrictMode(operand); } - else if (operator === 68 /* DeleteKeyword */ && operand.kind === 59 /* Identifier */) { + else if (operator === 72 /* DeleteKeyword */ && operand.kind === 63 /* Identifier */) { grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } } - return makeUnaryExpression(145 /* PrefixOperator */, pos, operator, operand); - case 19 /* LessThanToken */: + return makeUnaryExpression(151 /* PrefixOperator */, pos, operator, operand); + case 23 /* LessThanToken */: return parseTypeAssertion(); } var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 85 /* SuperKeyword */ && token !== 11 /* OpenParenToken */ && token !== 15 /* DotToken */; + var illegalUsageOfSuperKeyword = primaryExpression.kind === 89 /* SuperKeyword */ && token !== 15 /* OpenParenToken */ && token !== 19 /* DotToken */; if (illegalUsageOfSuperKeyword) { error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 33 /* PlusPlusToken */ || token === 34 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { reportInvalidUseInStrictMode(expr); } var operator = token; nextToken(); - expr = makeUnaryExpression(146 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(152 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(141 /* TypeAssertion */); - parseExpected(19 /* LessThanToken */); + var node = createNode(147 /* TypeAssertion */); + parseExpected(23 /* LessThanToken */); node.type = parseType(); - parseExpected(20 /* GreaterThanToken */); + parseExpected(24 /* GreaterThanToken */); node.operand = parseUnaryExpression(); return finishNode(node); } @@ -4396,11 +4051,11 @@ var ts; } function parseCallAndAccess(expr, inNewExpression) { while (true) { - var dotStart = scanner.getTokenPos(); - if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(137 /* PropertyAccess */, expr.pos); + var dotOrBracketStart = scanner.getTokenPos(); + if (parseOptional(19 /* DotToken */)) { + var propertyAccess = createNode(142 /* PropertyAccess */, expr.pos); if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { - grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.Identifier_expected); var id = createMissingNode(); } else { @@ -4411,13 +4066,12 @@ var ts; expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(138 /* IndexedAccess */, expr.pos); + if (parseOptional(17 /* OpenBracketToken */)) { + var indexedAccess = createNode(143 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; - if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { + if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); @@ -4425,79 +4079,92 @@ var ts; var literal = indexedAccess.index; literal.text = internIdentifier(literal.text); } - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); } expr = finishNode(indexedAccess); continue; } - if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(139 /* CallExpression */, expr.pos); + if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(144 /* CallExpression */, expr.pos); callExpr.func = expr; - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; } else { - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); } callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } + if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { + var tagExpression = createNode(146 /* TaggedTemplateExpression */, expr.pos); + tagExpression.tag = expr; + tagExpression.template = token === 9 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); + expr = finishNode(tagExpression); + if (languageVersion < 2 /* ES6 */) { + grammarErrorOnNode(expr, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + continue; + } return expr; } } function parseTypeArgumentsAndOpenParen() { var result = parseTypeArguments(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); return result; } function parseTypeArguments() { var typeArgumentListStart = scanner.getTokenPos(); var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); } return result; } function parseSingleTypeArgument() { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); - return createNode(115 /* Missing */); + return createNode(120 /* Missing */); } return parseType(); } function parsePrimaryExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return parseTokenNode(); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenExpression(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseArrayLiteral(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseObjectLiteral(); - case 77 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionExpression(); - case 82 /* NewKeyword */: + case 86 /* NewKeyword */: return parseNewExpression(); - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; + case 10 /* TemplateHead */: + return parseTemplateExpression(); default: if (isIdentifier()) { return parseIdentifier(); @@ -4507,20 +4174,20 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(142 /* ParenExpression */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(148 /* ParenExpression */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { if (omittedExpressionDiagnostic) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); } - return createNode(149 /* OmittedExpression */); + return createNode(157 /* OmittedExpression */); } return parseAssignmentExpression(); } @@ -4531,24 +4198,24 @@ var ts; return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); } function parseArrayLiteral() { - var node = createNode(134 /* ArrayLiteral */); - parseExpected(13 /* OpenBracketToken */); + var node = createNode(139 /* ArrayLiteral */); + parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(136 /* PropertyAssignment */); + var node = createNode(141 /* PropertyAssignment */); node.name = parsePropertyName(); - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); - node.initializer = makeFunctionExpression(143 /* FunctionExpression */, node.pos, undefined, sig, body); + node.initializer = makeFunctionExpression(149 /* FunctionExpression */, node.pos, undefined, sig, body); } else { - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } return finishNode(node); @@ -4556,41 +4223,41 @@ var ts; function parseObjectLiteralMember() { var initialPos = getNodePos(); var initialToken = token; - if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 122 /* GetAccessor */ : 123 /* SetAccessor */; + if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { + var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(135 /* ObjectLiteral */); - parseExpected(9 /* OpenBraceToken */); + var node = createNode(140 /* ObjectLiteral */); + parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; } node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); var seen = {}; var Property = 1; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; ts.forEach(node.properties, function (p) { - if (p.kind === 149 /* OmittedExpression */) { + if (p.kind === 157 /* OmittedExpression */) { return; } var currentKind; - if (p.kind === 136 /* PropertyAssignment */) { + if (p.kind === 141 /* PropertyAssignment */) { currentKind = Property; } - else if (p.kind === 122 /* GetAccessor */) { + else if (p.kind === 127 /* GetAccessor */) { currentKind = GetAccessor; } - else if (p.kind === 123 /* SetAccessor */) { + else if (p.kind === 128 /* SetAccessor */) { currentKind = SetAccesor; } else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); + ts.Debug.fail("Unexpected syntax kind:" + p.kind); } if (!ts.hasProperty(seen, p.name.text)) { seen[p.name.text] = currentKind; @@ -4619,14 +4286,14 @@ var ts; } function parseFunctionExpression() { var pos = getNodePos(); - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { reportInvalidUseInStrictMode(name); } - return makeFunctionExpression(143 /* FunctionExpression */, pos, name, sig, body); + return makeFunctionExpression(149 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4638,20 +4305,23 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(140 /* NewExpression */); - parseExpected(82 /* NewKeyword */); + var node = createNode(145 /* NewExpression */); + parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } return finishNode(node); } + function parseStatementAllowingLetDeclaration() { + return parseStatement(true); + } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(150 /* Block */); - if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(10 /* CloseBraceToken */); + var node = createNode(158 /* Block */); + if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -4671,7 +4341,7 @@ var ts; } labelledStatementInfo.pushFunctionBoundary(); var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 175 /* FunctionBlock */; + block.kind = 183 /* FunctionBlock */; labelledStatementInfo.pop(); inFunctionBody = saveInFunctionBody; inSwitchStatement = saveInSwitchStatement; @@ -4679,64 +4349,82 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(152 /* EmptyStatement */); - parseExpected(17 /* SemicolonToken */); + var node = createNode(160 /* EmptyStatement */); + parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(154 /* IfStatement */); - parseExpected(78 /* IfKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(162 /* IfStatement */); + parseExpected(82 /* IfKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement() : undefined; + parseExpected(16 /* CloseParenToken */); + node.thenStatement = parseStatement(false); + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement(false) : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(155 /* DoStatement */); - parseExpected(69 /* DoKeyword */); + var node = createNode(163 /* DoStatement */); + parseExpected(73 /* DoKeyword */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseOptional(17 /* SemicolonToken */); + parseExpected(16 /* CloseParenToken */); + parseOptional(21 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(156 /* WhileStatement */); - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(164 /* WhileStatement */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(node); } function parseForOrForInStatement() { var pos = getNodePos(); - parseExpected(76 /* ForKeyword */); - parseExpected(11 /* OpenParenToken */); - if (token !== 17 /* SemicolonToken */) { - if (parseOptional(92 /* VarKeyword */)) { + parseExpected(80 /* ForKeyword */); + parseExpected(15 /* OpenParenToken */); + if (token !== 21 /* SemicolonToken */) { + if (parseOptional(96 /* VarKeyword */)) { var declarations = parseVariableDeclarationList(0, true); if (!declarations.length) { error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } + else if (parseOptional(102 /* LetKeyword */)) { + var declarations = parseVariableDeclarationList(2048 /* Let */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (parseOptional(68 /* ConstKeyword */)) { + var declarations = parseVariableDeclarationList(4096 /* Const */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } else { var varOrInit = parseExpression(true); } } var forOrForInStatement; - if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(158 /* ForInStatement */, pos); + if (parseOptional(84 /* InKeyword */)) { + var forInStatement = createNode(166 /* ForInStatement */, pos); if (declarations) { if (declarations.length > 1) { error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); @@ -4747,36 +4435,36 @@ var ts; forInStatement.variable = varOrInit; } forInStatement.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forInStatement; } else { - var forStatement = createNode(157 /* ForStatement */, pos); + var forStatement = createNode(165 /* ForStatement */, pos); if (declarations) forStatement.declarations = declarations; if (varOrInit) forStatement.initializer = varOrInit; - parseExpected(17 /* SemicolonToken */); - if (token !== 17 /* SemicolonToken */ && token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); } - parseExpected(17 /* SemicolonToken */); - if (token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 16 /* CloseParenToken */) { forStatement.iterator = parseExpression(); } - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(); + forOrForInStatement.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); + parseExpected(kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); if (!canParseSemicolon()) node.label = parseIdentifier(); parseSemicolon(); @@ -4792,7 +4480,7 @@ var ts; return node; } function checkBareBreakOrContinueStatement(node) { - if (node.kind === 160 /* BreakStatement */) { + if (node.kind === 168 /* BreakStatement */) { if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { return; } @@ -4801,7 +4489,7 @@ var ts; return; } } - else if (node.kind === 159 /* ContinueStatement */) { + else if (node.kind === 167 /* ContinueStatement */) { if (inIterationStatement === 1 /* Nested */) { return; } @@ -4817,7 +4505,7 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 159 /* ContinueStatement */, false); + var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 167 /* ContinueStatement */, false); if (nodeIsNestedInLabel === 1 /* Nested */) { return; } @@ -4825,10 +4513,10 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); return; } - if (node.kind === 159 /* ContinueStatement */) { + if (node.kind === 167 /* ContinueStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); } - else if (node.kind === 160 /* BreakStatement */) { + else if (node.kind === 168 /* BreakStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); } else { @@ -4836,11 +4524,11 @@ var ts; } } function parseReturnStatement() { - var node = createNode(161 /* ReturnStatement */); + var node = createNode(169 /* ReturnStatement */); var errorCountBeforeReturnStatement = file.syntacticErrors.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(84 /* ReturnKeyword */); + parseExpected(88 /* ReturnKeyword */); if (!canParseSemicolon()) node.expression = parseExpression(); parseSemicolon(); @@ -4850,14 +4538,14 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(162 /* WithStatement */); + var node = createNode(170 /* WithStatement */); var startPos = scanner.getTokenPos(); - parseExpected(95 /* WithKeyword */); + parseExpected(99 /* WithKeyword */); var endPos = scanner.getStartPos(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.statement = parseStatement(); + parseExpected(16 /* CloseParenToken */); + node.statement = parseStatement(false); node = finishNode(node); if (isInStrictMode) { grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); @@ -4865,36 +4553,36 @@ var ts; return node; } function parseCaseClause() { - var node = createNode(164 /* CaseClause */); - parseExpected(61 /* CaseKeyword */); + var node = createNode(172 /* CaseClause */); + parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + parseExpected(50 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseDefaultClause() { - var node = createNode(165 /* DefaultClause */); - parseExpected(67 /* DefaultKeyword */); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + var node = createNode(173 /* DefaultClause */); + parseExpected(71 /* DefaultKeyword */); + parseExpected(50 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(163 /* SwitchStatement */); - parseExpected(86 /* SwitchKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(171 /* SwitchStatement */); + parseExpected(90 /* SwitchKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseExpected(9 /* OpenBraceToken */); + parseExpected(16 /* CloseParenToken */); + parseExpected(13 /* OpenBraceToken */); var saveInSwitchStatement = inSwitchStatement; inSwitchStatement = 1 /* Nested */; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); inSwitchStatement = saveInSwitchStatement; - parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 165 /* DefaultClause */; }); + parseExpected(14 /* CloseBraceToken */); + var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 173 /* DefaultClause */; }); for (var i = 1, n = defaultClauses.length; i < n; i++) { var clause = defaultClauses[i]; var start = ts.skipTrivia(file.text, clause.pos); @@ -4904,8 +4592,8 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(167 /* ThrowStatement */); - parseExpected(88 /* ThrowKeyword */); + var node = createNode(175 /* ThrowStatement */); + parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); } @@ -4914,13 +4602,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(168 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 169 /* TryBlock */); - if (token === 62 /* CatchKeyword */) { + var node = createNode(176 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 177 /* TryBlock */); + if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } - if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 171 /* FinallyBlock */); + if (token === 79 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 179 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4937,15 +4625,15 @@ var ts; } function parseCatchBlock() { var pos = getNodePos(); - parseExpected(62 /* CatchKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(66 /* CatchKeyword */); + parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); var typeAnnotationColonStart = scanner.getTokenPos(); var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 170 /* CatchBlock */; + result.kind = 178 /* CatchBlock */; result.pos = pos; result.variable = variable; if (typeAnnotation) { @@ -4957,130 +4645,134 @@ var ts; return result; } function parseDebuggerStatement() { - var node = createNode(172 /* DebuggerStatement */); - parseExpected(66 /* DebuggerKeyword */); + var node = createNode(180 /* DebuggerStatement */); + parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function isIterationStatementStart() { - return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; + return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } - function parseStatementWithLabelSet() { + function parseStatementWithLabelSet(allowLetAndConstDeclarations) { labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); + var statement = parseStatement(allowLetAndConstDeclarations); labelledStatementInfo.pop(); return statement; } function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); + return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } - function parseLabelledStatement() { - var node = createNode(166 /* LabeledStatement */); + function parseLabeledStatement(allowLetAndConstDeclarations) { + var node = createNode(174 /* LabeledStatement */); node.label = parseIdentifier(); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); } labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(153 /* ExpressionStatement */); + var node = createNode(161 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); } function isStatement(inErrorRecovery) { switch (token) { - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return !inErrorRecovery; - case 9 /* OpenBraceToken */: - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: - case 78 /* IfKeyword */: - case 69 /* DoKeyword */: - case 94 /* WhileKeyword */: - case 76 /* ForKeyword */: - case 65 /* ContinueKeyword */: - case 60 /* BreakKeyword */: - case 84 /* ReturnKeyword */: - case 95 /* WithKeyword */: - case 86 /* SwitchKeyword */: - case 88 /* ThrowKeyword */: - case 90 /* TryKeyword */: - case 66 /* DebuggerKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 13 /* OpenBraceToken */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 81 /* FunctionKeyword */: + case 82 /* IfKeyword */: + case 73 /* DoKeyword */: + case 98 /* WhileKeyword */: + case 80 /* ForKeyword */: + case 69 /* ContinueKeyword */: + case 64 /* BreakKeyword */: + case 88 /* ReturnKeyword */: + case 99 /* WithKeyword */: + case 90 /* SwitchKeyword */: + case 92 /* ThrowKeyword */: + case 94 /* TryKeyword */: + case 70 /* DebuggerKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return true; - case 97 /* InterfaceKeyword */: - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - if (isDeclaration()) { + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + return !isConstEnum; + case 101 /* InterfaceKeyword */: + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 119 /* TypeKeyword */: + if (isDeclarationStart()) { return false; } - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 59 /* Identifier */; })) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 63 /* Identifier */; })) { return false; } default: - return isExpression(); + return isStartOfExpression(); } } - function parseStatement() { + function parseStatement(allowLetAndConstDeclarations) { switch (token) { - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseBlock(false, false); - case 92 /* VarKeyword */: - return parseVariableStatement(); - case 77 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + return parseVariableStatement(allowLetAndConstDeclarations); + case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return parseEmptyStatement(); - case 78 /* IfKeyword */: + case 82 /* IfKeyword */: return parseIfStatement(); - case 69 /* DoKeyword */: + case 73 /* DoKeyword */: return parseDoStatement(); - case 94 /* WhileKeyword */: + case 98 /* WhileKeyword */: return parseWhileStatement(); - case 76 /* ForKeyword */: + case 80 /* ForKeyword */: return parseForOrForInStatement(); - case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(159 /* ContinueStatement */); - case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(160 /* BreakStatement */); - case 84 /* ReturnKeyword */: + case 69 /* ContinueKeyword */: + return parseBreakOrContinueStatement(167 /* ContinueStatement */); + case 64 /* BreakKeyword */: + return parseBreakOrContinueStatement(168 /* BreakStatement */); + case 88 /* ReturnKeyword */: return parseReturnStatement(); - case 95 /* WithKeyword */: + case 99 /* WithKeyword */: return parseWithStatement(); - case 86 /* SwitchKeyword */: + case 90 /* SwitchKeyword */: return parseSwitchStatement(); - case 88 /* ThrowKeyword */: + case 92 /* ThrowKeyword */: return parseThrowStatement(); - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return parseTryStatement(); - case 66 /* DebuggerKeyword */: + case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: if (isLabel()) { - return parseLabelledStatement(); + return parseLabeledStatement(allowLetAndConstDeclarations); } return parseExpressionStatement(); } } - function parseStatementOrFunction() { - return token === 77 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } function parseAndCheckFunctionBody(isConstructor) { var initialPosition = scanner.getTokenPos(); var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 9 /* OpenBraceToken */) { + if (token === 13 /* OpenBraceToken */) { var body = parseBody(false); if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; @@ -5095,7 +4787,7 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(173 /* VariableDeclaration */); + var node = createNode(181 /* VariableDeclaration */); node.flags = flags; var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); @@ -5106,6 +4798,9 @@ var ts; if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } + if (!inAmbientContext && !node.initializer && flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { reportInvalidUseInStrictMode(node.name); } @@ -5114,27 +4809,52 @@ var ts; function parseVariableDeclarationList(flags, noIn) { return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); } - function parseVariableStatement(pos, flags) { - var node = createNode(151 /* VariableStatement */, pos); + function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { + var node = createNode(159 /* VariableStatement */, pos); if (flags) node.flags = flags; var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(92 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); + if (token === 102 /* LetKeyword */) { + node.flags |= 2048 /* Let */; + } + else if (token === 68 /* ConstKeyword */) { + node.flags |= 4096 /* Const */; + } + else if (token !== 96 /* VarKeyword */) { + error(ts.Diagnostics.var_let_or_const_expected); + } + nextToken(); + node.declarations = parseVariableDeclarationList(node.flags, false); parseSemicolon(); finishNode(node); if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } + if (languageVersion < 2 /* ES6 */) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (!allowLetAndConstDeclarations) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } return node; } function parseFunctionDeclaration(pos, flags) { - var node = createNode(174 /* FunctionDeclaration */, pos); + var node = createNode(182 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5145,10 +4865,10 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, flags) { - var node = createNode(121 /* Constructor */, pos); + var node = createNode(126 /* Constructor */, pos); node.flags = flags; - parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + parseExpected(111 /* ConstructorKeyword */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5165,14 +4885,14 @@ var ts; var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; var name = parsePropertyName(); var questionStart = scanner.getTokenPos(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(120 /* Method */, pos); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var method = createNode(125 /* Method */, pos); method.flags = flags; method.name = name; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; @@ -5180,7 +4900,7 @@ var ts; return finishNode(method); } else { - var property = createNode(119 /* Property */, pos); + var property = createNode(124 /* Property */, pos); property.flags = flags; property.name = name; property.type = parseTypeAnnotation(); @@ -5207,10 +4927,10 @@ var ts; else if (accessor.typeParameters) { grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 122 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 123 /* SetAccessor */) { + else if (kind === 128 /* SetAccessor */) { if (accessor.type) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -5222,7 +4942,7 @@ var ts; if (parameter.flags & 8 /* Rest */) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); } - else if (parameter.flags & ts.NodeFlags.Modifier) { + else if (parameter.flags & 243 /* Modifier */) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } else if (parameter.flags & 4 /* QuestionMark */) { @@ -5240,7 +4960,7 @@ var ts; var node = createNode(kind, pos); node.flags = flags; node.name = parsePropertyName(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5263,19 +4983,19 @@ var ts; idToken = token; nextToken(); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { return true; } if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 113 /* SetKeyword */ || idToken === 109 /* GetKeyword */) { + if (!isKeyword(idToken) || idToken === 117 /* SetKeyword */ || idToken === 113 /* GetKeyword */) { return true; } switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 46 /* ColonToken */: - case 47 /* EqualsToken */: - case 45 /* QuestionToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 50 /* ColonToken */: + case 51 /* EqualsToken */: + case 49 /* QuestionToken */: return true; default: return canParseSemicolon(); @@ -5300,8 +5020,8 @@ var ts; break; var modifierLength = scanner.getStartPos() - modifierStart; switch (modifierToken) { - case 102 /* PublicKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 106 /* PublicKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5312,8 +5032,8 @@ var ts; } flags |= 16 /* Public */; break; - case 100 /* PrivateKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 104 /* PrivateKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5326,7 +5046,7 @@ var ts; lastPrivateModifierLength = modifierLength; flags |= 32 /* Private */; break; - case 101 /* ProtectedKeyword */: + case 105 /* ProtectedKeyword */: if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } @@ -5340,7 +5060,7 @@ var ts; lastProtectedModifierLength = modifierLength; flags |= 64 /* Protected */; break; - case 103 /* StaticKeyword */: + case 107 /* StaticKeyword */: if (flags & 128 /* Static */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -5354,7 +5074,7 @@ var ts; lastStaticModifierLength = modifierLength; flags |= 128 /* Static */; break; - case 72 /* ExportKeyword */: + case 76 /* ExportKeyword */: if (flags & 1 /* Export */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); } @@ -5369,7 +5089,7 @@ var ts; } flags |= 1 /* Export */; break; - case 108 /* DeclareKeyword */: + case 112 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -5388,26 +5108,26 @@ var ts; break; } } - if (token === 107 /* ConstructorKeyword */ && flags & 128 /* Static */) { + if (token === 111 /* ConstructorKeyword */ && flags & 128 /* Static */) { grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - else if (token === 107 /* ConstructorKeyword */ && flags & 32 /* Private */) { + else if (token === 111 /* ConstructorKeyword */ && flags & 32 /* Private */) { grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } - else if (token === 107 /* ConstructorKeyword */ && flags & 64 /* Protected */) { + else if (token === 111 /* ConstructorKeyword */ && flags & 64 /* Protected */) { grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); } - else if (token === 79 /* ImportKeyword */) { + else if (token === 83 /* ImportKeyword */) { if (flags & 2 /* Ambient */) { grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } } - else if (token === 97 /* InterfaceKeyword */) { + else if (token === 101 /* InterfaceKeyword */) { if (flags & 2 /* Ambient */) { grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } } - else if (token !== 72 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { + else if (token !== 76 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { var declarationStart = scanner.getTokenPos(); var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -5417,19 +5137,19 @@ var ts; function parseClassMemberDeclaration() { var pos = getNodePos(); var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(122 /* GetAccessor */, pos, flags); + if (parseContextualModifier(113 /* GetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(127 /* GetAccessor */, pos, flags); } - if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* SetAccessor */, pos, flags); + if (parseContextualModifier(117 /* SetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(128 /* SetAccessor */, pos, flags); } - if (token === 107 /* ConstructorKeyword */) { + if (token === 111 /* ConstructorKeyword */) { return parseConstructorDeclaration(pos, flags); } - if (token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { return parsePropertyMemberDeclaration(pos, flags); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { if (flags) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -5440,23 +5160,23 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(176 /* ClassDeclaration */, pos); + var node = createNode(184 /* ClassDeclaration */, pos); node.flags = flags; var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(63 /* ClassKeyword */); + parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(73 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; var implementsKeywordStart = scanner.getTokenPos(); var implementsKeywordLength; - if (parseOptional(96 /* ImplementsKeyword */)) { + if (parseOptional(100 /* ImplementsKeyword */)) { implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5467,15 +5187,15 @@ var ts; return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(177 /* InterfaceDeclaration */, pos); + var node = createNode(185 /* InterfaceDeclaration */, pos); node.flags = flags; var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(97 /* InterfaceKeyword */); + parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); var extendsKeywordStart = scanner.getTokenPos(); var extendsKeywordLength; - if (parseOptional(73 /* ExtendsKeyword */)) { + if (parseOptional(77 /* ExtendsKeyword */)) { extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } @@ -5486,14 +5206,25 @@ var ts; } return finishNode(node); } + function parseTypeAliasDeclaration(pos, flags) { + var node = createNode(186 /* TypeAliasDeclaration */, pos); + node.flags = flags; + parseExpected(119 /* TypeKeyword */); + node.name = parseIdentifier(); + parseExpected(51 /* EqualsToken */); + node.type = parseType(); + parseSemicolon(); + return finishNode(node); + } function parseAndCheckEnumDeclaration(pos, flags) { + var enumIsConst = flags & 4096 /* Const */; function isIntegerLiteral(expression) { function isInteger(literalExpression) { return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); } - if (expression.kind === 145 /* PrefixOperator */) { + if (expression.kind === 151 /* PrefixOperator */) { var unaryExpression = expression; - if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { expression = unaryExpression.operand; } } @@ -5504,30 +5235,35 @@ var ts; } var inConstantEnumMemberSection = true; function parseAndCheckEnumMember() { - var node = createNode(183 /* EnumMember */); + var node = createNode(192 /* EnumMember */); var errorCountBeforeEnumMember = file.syntacticErrors.length; node.name = parsePropertyName(); node.initializer = parseInitializer(false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + if (!enumIsConst) { + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); } return finishNode(node); } - var node = createNode(178 /* EnumDeclaration */, pos); + var node = createNode(187 /* EnumDeclaration */, pos); node.flags = flags; - parseExpected(71 /* EnumKeyword */); + if (enumIsConst) { + parseExpected(68 /* ConstKeyword */); + } + parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5535,10 +5271,10 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(180 /* ModuleBlock */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(189 /* ModuleBlock */); + if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -5546,19 +5282,19 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(15 /* DotToken */)) { + if (parseOptional(19 /* DotToken */)) { node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); } else { node.body = parseModuleBody(); ts.forEach(node.body.statements, function (s) { - if (s.kind === 182 /* ExportAssignment */) { + if (s.kind === 191 /* ExportAssignment */) { grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === 181 /* ImportDeclaration */ && s.externalModuleName) { + else if (s.kind === 190 /* ImportDeclaration */ && s.externalModuleName) { grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } }); @@ -5566,7 +5302,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); if (!inAmbientContext) { @@ -5582,19 +5318,19 @@ var ts; return finishNode(node); } function parseModuleDeclaration(pos, flags) { - parseExpected(110 /* ModuleKeyword */); + parseExpected(114 /* ModuleKeyword */); return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(181 /* ImportDeclaration */, pos); + var node = createNode(190 /* ImportDeclaration */, pos); node.flags = flags; - parseExpected(79 /* ImportKeyword */); + parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); var entityName = parseEntityName(false); - if (entityName.kind === 59 /* Identifier */ && entityName.text === "require" && parseOptional(11 /* OpenParenToken */)) { + if (entityName.kind === 63 /* Identifier */ && entityName.text === "require" && parseOptional(15 /* OpenParenToken */)) { node.externalModuleName = parseStringLiteral(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } else { node.entityName = entityName; @@ -5603,33 +5339,36 @@ var ts; return finishNode(node); } function parseExportAssignmentTail(pos) { - var node = createNode(182 /* ExportAssignment */, pos); + var node = createNode(191 /* ExportAssignment */, pos); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart() { switch (token) { - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + case 81 /* FunctionKeyword */: return true; - case 63 /* ClassKeyword */: - case 97 /* InterfaceKeyword */: - case 71 /* EnumKeyword */: - case 79 /* ImportKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); - case 110 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); - case 72 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 47 /* EqualsToken */ || isDeclaration(); }); - case 108 /* DeclareKeyword */: - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: + case 67 /* ClassKeyword */: + case 101 /* InterfaceKeyword */: + case 75 /* EnumKeyword */: + case 83 /* ImportKeyword */: + case 119 /* TypeKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */; }); + case 114 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */ || token === 7 /* StringLiteral */; }); + case 76 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 51 /* EqualsToken */ || isDeclarationStart(); }); + case 112 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: return lookAhead(function () { nextToken(); - return isDeclaration(); + return isDeclarationStart(); }); } } @@ -5637,10 +5376,10 @@ var ts; var pos = getNodePos(); var errorCountBeforeModifiers = file.syntacticErrors.length; var flags = parseAndCheckModifiers(modifierContext); - if (token === 72 /* ExportKeyword */) { + if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); - if (parseOptional(47 /* EqualsToken */)) { + if (parseOptional(51 /* EqualsToken */)) { var exportAssignmentTail = parseExportAssignmentTail(pos); if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { var modifiersStart = ts.skipTrivia(sourceText, pos); @@ -5655,25 +5394,38 @@ var ts; } var result; switch (token) { - case 92 /* VarKeyword */: - result = parseVariableStatement(pos, flags); + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + result = parseVariableStatement(true, pos, flags); break; - case 77 /* FunctionKeyword */: + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); + } + else { + result = parseVariableStatement(true, pos, flags); + } + break; + case 81 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); break; - case 63 /* ClassKeyword */: + case 67 /* ClassKeyword */: result = parseClassDeclaration(pos, flags); break; - case 97 /* InterfaceKeyword */: + case 101 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; - case 71 /* EnumKeyword */: + case 119 /* TypeKeyword */: + result = parseTypeAliasDeclaration(pos, flags); + break; + case 75 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; - case 110 /* ModuleKeyword */: + case 114 /* ModuleKeyword */: result = parseModuleDeclaration(pos, flags); break; - case 79 /* ImportKeyword */: + case 83 /* ImportKeyword */: result = parseImportDeclaration(pos, flags); break; default: @@ -5683,7 +5435,7 @@ var ts; return result; } function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { return parseSourceElementOrModuleElement(0 /* SourceElements */); @@ -5692,13 +5444,13 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { + if (isDeclarationStart()) { return parseDeclaration(modifierContext); } var statementStart = scanner.getTokenPos(); var statementFirstTokenLength = scanner.getTextPos() - statementStart; var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); + var statement = parseStatement(true); if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } @@ -5750,7 +5502,7 @@ var ts; }; } function getExternalModuleIndicator() { - return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 181 /* ImportDeclaration */ && node.externalModuleName || node.kind === 182 /* ExportAssignment */ ? node : undefined; }); + return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 190 /* ImportDeclaration */ && node.externalModuleName || node.kind === 191 /* ExportAssignment */ ? node : undefined; }); } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; @@ -5758,7 +5510,7 @@ var ts; rootNodeFlags = 1024 /* DeclarationFile */; inAmbientContext = true; } - file = createRootNode(184 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(193 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; @@ -5891,7 +5643,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5909,9 +5661,9 @@ var ts; } } } - else if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5983,33 +5735,50 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isInstantiated(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { - return false; + function getModuleInstanceState(node) { + if (node.kind === 185 /* InterfaceDeclaration */) { + return 0 /* NonInstantiated */; } - else if (node.kind === 181 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; + else if (node.kind === 187 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; } - else if (node.kind === 180 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; + else if (node.kind === 190 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 179 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; + else if (node.kind === 189 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + return false; + case 2 /* ConstEnumOnly */: + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 188 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); } else { - return true; + return 1 /* Instantiated */; } } - ts.isInstantiated = isInstantiated; + ts.getModuleInstanceState = getModuleInstanceState; function bindSourceFile(file) { var parent; var container; + var blockScopeContainer; var lastContainer; var symbolCount = 0; var Symbol = ts.objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -6022,30 +5791,26 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 121 /* Constructor */: - return "__constructor"; - case 124 /* CallSignature */: - return "__call"; - case 125 /* ConstructSignature */: - return "__new"; - case 126 /* IndexSignature */: - return "__index"; + case 126 /* Constructor */: return "__constructor"; + case 129 /* CallSignature */: return "__call"; + case 130 /* ConstructSignature */: return "__new"; + case 131 /* IndexSignature */: return "__index"; } } function getDisplayName(node) { @@ -6059,10 +5824,11 @@ var ts; if (node.name) { node.name.parent = node; } + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(declaration))); + file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + file.semanticErrors.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -6071,8 +5837,8 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 176 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (node.kind === 184 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(4 /* Property */ | 536870912 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; @@ -6094,16 +5860,16 @@ var ts; } function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; + if (symbolKind & 107455 /* Value */) { + exportKind |= 4194304 /* ExportValue */; } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; + if (symbolKind & 3152352 /* Type */) { + exportKind |= 8388608 /* ExportType */; } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; + if (symbolKind & 1536 /* Namespace */) { + exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 181 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 190 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -6117,14 +5883,15 @@ var ts; declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); } } - function bindChildren(node, symbolKind) { - if (symbolKind & ts.SymbolFlags.HasLocals) { + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 1041936 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { + if (symbolKind & 1048560 /* IsContainer */) { container = node; if (lastContainer !== container && !container.nextContainer) { if (lastContainer) { @@ -6133,156 +5900,211 @@ var ts; lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node, symbolKind, symbolExcludes) { + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 129 /* TypeLiteral */: - case 135 /* ObjectLiteral */: - case 177 /* InterfaceDeclaration */: + case 134 /* TypeLiteral */: + case 140 /* ObjectLiteral */: + case 185 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); + bindDeclaration(node, 16384 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + bindDeclaration(p, 4 /* Property */, 107455 /* PropertyExcludes */, false); } }); } function bindModuleDeclaration(node) { if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + } + else { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + if (state === 2 /* ConstEnumOnly */) { + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + node.symbol.constEnumOnlyModule = false; + } + } } } - function bindAnonymousDeclaration(node, symbolKind, name) { + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); + var symbol = createSymbol(1 /* FunctionScopedVariable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, 1 /* FunctionScopedVariable */); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; ts.forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 188 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + case 193 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + } + bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 117 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + case 122 /* TypeParameter */: + bindDeclaration(node, 1048576 /* TypeParameter */, 2103776 /* TypeParameterExcludes */, false); break; - case 118 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + case 123 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 173 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + case 181 /* VariableDeclaration */: + if (node.flags & 6144 /* BlockScoped */) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); + } break; - case 119 /* Property */: - case 136 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + case 124 /* Property */: + case 141 /* PropertyAssignment */: + bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 183 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + case 192 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 124 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); + case 129 /* CallSignature */: + bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 120 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); break; - case 125 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); + case 130 /* ConstructSignature */: + bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; - case 126 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); + case 131 /* IndexSignature */: + bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 174 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + case 182 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 121 /* Constructor */: + case 126 /* Constructor */: bindConstructorDeclaration(node); break; - case 122 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + case 127 /* GetAccessor */: + bindDeclaration(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 123 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + case 128 /* SetAccessor */: + bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 129 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + case 134 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 135 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + case 140 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 176 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + case 184 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 177 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + case 185 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 178 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + case 186 /* TypeAliasDeclaration */: + bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 179 /* ModuleDeclaration */: + case 187 /* EnumDeclaration */: + if (ts.isConstEnumDeclaration(node)) { + bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); + } + else { + bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); + } + break; + case 188 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 181 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + case 190 /* ImportDeclaration */: + bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"'); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 171 /* SwitchStatement */: + bindChildren(node, 0, true); + break; default: var saveParent = parent; parent = node; @@ -6343,7 +6165,7 @@ var ts; } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } }); @@ -6353,14 +6175,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { + if ((member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 122 /* GetAccessor */ && !getAccessor) { + if (member.kind === 127 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 123 /* SetAccessor */ && !setAccessor) { + if (member.kind === 128 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6683,7 +6505,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 143 /* FunctionExpression */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */ || node.kind === 179 /* ModuleDeclaration */ || node.kind === 176 /* ClassDeclaration */ || node.kind === 178 /* EnumDeclaration */) { + else if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 149 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6765,7 +6587,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 184 /* SourceFile */) { + if (node.kind != 193 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6852,13 +6674,76 @@ var ts; } } function emitLiteral(node) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === 7 /* StringLiteral */ && compilerOptions.sourceMap) { + var text = getLiteralText(); + if (compilerOptions.sourceMap && (node.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + function getLiteralText() { + if (compilerOptions.target < 2 /* ES6 */ && ts.isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node); + } + return getSourceTextOfLocalNode(node); + } + } + function getTemplateLiteralAsStringLiteral(node) { + return '"' + ts.escapeString(node.text) + '"'; + } + function emitTemplateExpression(node) { + if (compilerOptions.target >= 2 /* ES6 */) { + ts.forEachChild(node, emit); + return; + } + ts.Debug.assert(node.parent.kind !== 146 /* TaggedTemplateExpression */); + var templateNeedsParens = ts.isExpression(node.parent) && node.parent.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(node.parent) !== -1 /* LessThan */; + if (templateNeedsParens) { + write("("); + } + emitLiteral(node.head); + ts.forEach(node.templateSpans, function (templateSpan) { + var needsParens = templateSpan.expression.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + write(" + "); + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + if (templateSpan.literal.text.length !== 0) { + write(" + "); + emitLiteral(templateSpan.literal); + } + }); + if (templateNeedsParens) { + write(")"); + } + function comparePrecedenceToBinaryPlus(expression) { + ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); + switch (expression.kind) { + case 153 /* BinaryExpression */: + switch (expression.operator) { + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + return 1 /* GreaterThan */; + case 32 /* PlusToken */: + return 0 /* EqualTo */; + default: + return -1 /* LessThan */; + } + case 154 /* ConditionalExpression */: + return -1 /* LessThan */; + default: + return 1 /* GreaterThan */; + } + } + } + function emitTemplateSpan(span) { + emit(span.expression); + emit(span.literal); } function emitQuotedIdentifier(node) { if (node.kind === 7 /* StringLiteral */) { @@ -6878,29 +6763,29 @@ var ts; function isNonExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return parent.name === node; - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 182 /* ExportAssignment */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 191 /* ExportAssignment */: return false; - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return node.parent.label === node; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: return node.parent.variable === node; } } @@ -6974,18 +6859,27 @@ var ts; emit(node.initializer); emitTrailingComments(node); } - function emitPropertyAccess(node) { + function tryEmitConstantValue(node) { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + ts.identifierToString(node.right) + " */"); + var propertyName = node.kind === 142 /* PropertyAccess */ ? ts.identifierToString(node.right) : ts.getTextOfNode(node.index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; } - else { - emit(node.left); - write("."); - emit(node.right); + return false; + } + function emitPropertyAccess(node) { + if (tryEmitConstantValue(node)) { + return; } + emit(node.left); + write("."); + emit(node.right); } function emitIndexedAccess(node) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -6993,13 +6887,13 @@ var ts; } function emitCallExpression(node) { var superCall = false; - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { write("_super"); superCall = true; } else { emit(node.func); - superCall = node.func.kind === 137 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; + superCall = node.func.kind === 142 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -7025,13 +6919,19 @@ var ts; write(")"); } } + function emitTaggedTemplateExpression(node) { + ts.Debug.assert(compilerOptions.target >= 2 /* ES6 */, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } function emitParenExpression(node) { - if (node.expression.kind === 141 /* TypeAssertion */) { + if (node.expression.kind === 147 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 141 /* TypeAssertion */) { + while (operand.kind == 147 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 145 /* PrefixOperator */ && operand.kind !== 146 /* PostfixOperator */ && operand.kind !== 140 /* NewExpression */ && !(operand.kind === 139 /* CallExpression */ && node.parent.kind === 140 /* NewExpression */) && !(operand.kind === 143 /* FunctionExpression */ && node.parent.kind === 139 /* CallExpression */)) { + if (operand.kind !== 151 /* PrefixOperator */ && operand.kind !== 152 /* PostfixOperator */ && operand.kind !== 145 /* NewExpression */ && !(operand.kind === 144 /* CallExpression */ && node.parent.kind === 145 /* NewExpression */) && !(operand.kind === 149 /* FunctionExpression */ && node.parent.kind === 144 /* CallExpression */)) { emit(operand); return; } @@ -7041,29 +6941,29 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 145 /* PrefixOperator */) { + if (node.kind === 151 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } - if (node.operator >= 59 /* Identifier */) { + if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 145 /* PrefixOperator */ && node.operand.kind === 145 /* PrefixOperator */) { + else if (node.kind === 151 /* PrefixOperator */ && node.operand.kind === 151 /* PrefixOperator */) { var operand = node.operand; - if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { + if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 29 /* MinusToken */ && (operand.operator === 29 /* MinusToken */ || operand.operator === 34 /* MinusMinusToken */)) { + else if (node.operator === 33 /* MinusToken */ && (operand.operator === 33 /* MinusToken */ || operand.operator === 38 /* MinusMinusToken */)) { write(" "); } } emit(node.operand); - if (node.kind === 146 /* PostfixOperator */) { + if (node.kind === 152 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } function emitBinaryExpression(node) { emit(node.left); - if (node.operator !== 18 /* CommaToken */) + if (node.operator !== 22 /* CommaToken */) write(" "); write(ts.tokenToString(node.operator)); write(" "); @@ -7077,21 +6977,21 @@ var ts; emit(node.whenFalse); } function emitBlock(node) { - emitToken(9 /* OpenBraceToken */, node.pos); + emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 180 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 179 /* ModuleDeclaration */); + if (node.kind === 189 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 188 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.statements.end); + emitToken(14 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 150 /* Block */) { + if (node.kind === 158 /* Block */) { write(" "); emit(node); } @@ -7103,7 +7003,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 144 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 150 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -7115,16 +7015,16 @@ var ts; } function emitIfStatement(node) { emitLeadingComments(node); - var endPos = emitToken(78 /* IfKeyword */, node.pos); + var endPos = emitToken(82 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 154 /* IfStatement */) { + emitToken(74 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 162 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -7137,7 +7037,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 150 /* Block */) { + if (node.statement.kind === 158 /* Block */) { write(" "); } else { @@ -7154,11 +7054,19 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declarations) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { + emitToken(68 /* ConstKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } write(" "); emitCommaList(node.declarations, false); } @@ -7173,11 +7081,16 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declaration) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declaration.flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } write(" "); emit(node.declaration); } @@ -7186,17 +7099,17 @@ var ts; } write(" in "); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { emitLeadingComments(node); - emitToken(84 /* ReturnKeyword */, node.pos); + emitToken(88 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); emitTrailingComments(node); @@ -7208,21 +7121,24 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(86 /* SwitchKeyword */, node.pos); + var endPos = emitToken(90 /* SwitchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(12 /* CloseParenToken */, node.expression.end); + endPos = emitToken(16 /* CloseParenToken */, node.expression.end); write(" "); - emitToken(9 /* OpenBraceToken */, endPos); + emitToken(13 /* OpenBraceToken */, endPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.clauses.end); + emitToken(14 /* CloseBraceToken */, node.clauses.end); + } + function isOnSameLine(node1, node2) { + return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 164 /* CaseClause */) { + if (node.kind === 172 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7230,9 +7146,15 @@ var ts; else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node) { write("throw "); @@ -7251,16 +7173,16 @@ var ts; } function emitCatchBlock(node) { writeLine(); - var endPos = emitToken(62 /* CatchKeyword */, node.pos); + var endPos = emitToken(66 /* CatchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.variable); - emitToken(12 /* CloseParenToken */, node.variable.end); + emitToken(16 /* CloseParenToken */, node.variable.end); write(" "); emitBlock(node); } function emitDebuggerStatement(node) { - emitToken(66 /* DebuggerKeyword */, node.pos); + emitToken(70 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -7271,7 +7193,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 179 /* ModuleDeclaration */); + } while (node && node.kind !== 188 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7292,8 +7214,17 @@ var ts; } function emitVariableStatement(node) { emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); + if (!(node.flags & 1 /* Export */)) { + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } + } emitCommaList(node.declarations, false); write(";"); emitTrailingComments(node); @@ -7361,7 +7292,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 122 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 127 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -7370,15 +7301,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 120 /* Method */) { + if (node.kind !== 125 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 174 /* FunctionDeclaration */ || (node.kind === 143 /* FunctionExpression */ && node.name)) { + if (node.kind === 182 /* FunctionDeclaration */ || (node.kind === 149 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 120 /* Method */) { + if (node.kind !== 125 /* Method */) { emitTrailingComments(node); } } @@ -7404,16 +7335,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 175 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 183 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 175 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 183 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7426,7 +7357,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7438,10 +7369,10 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); - emitToken(10 /* CloseBraceToken */, node.body.statements.end); + emitToken(14 /* CloseBraceToken */, node.body.statements.end); } else { decreaseIndent(); @@ -7464,11 +7395,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 153 /* ExpressionStatement */) { + if (statement && statement.kind === 161 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 139 /* CallExpression */) { + if (expr && expr.kind === 144 /* CallExpression */) { var func = expr.func; - if (func && func.kind === 85 /* SuperKeyword */) { + if (func && func.kind === 89 /* SuperKeyword */) { return statement; } } @@ -7477,7 +7408,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -7504,7 +7435,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 119 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 124 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7527,7 +7458,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Method */) { + if (member.kind === 125 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7549,7 +7480,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) { + else if (member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7627,11 +7558,11 @@ var ts; write("return "); emitNode(node.name); } - emitToken(10 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + emitToken(14 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); write(";"); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -7652,7 +7583,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && !member.body) { + if (member.kind === 126 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7703,7 +7634,7 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(10 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + emitToken(14 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { @@ -7715,6 +7646,10 @@ var ts; emitPinnedOrTripleSlashComments(node); } function emitEnumDeclaration(node) { + var isConstEnum = ts.isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & 1 /* Export */)) { emitStart(node); @@ -7732,10 +7667,10 @@ var ts; write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -7754,7 +7689,7 @@ var ts; write(";"); } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum) { ts.forEach(node.members, function (member) { writeLine(); emitLeadingComments(member); @@ -7765,7 +7700,7 @@ var ts; write("["); emitQuotedIdentifier(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { @@ -7780,13 +7715,13 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 179 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -7802,7 +7737,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 180 /* ModuleBlock */) { + if (node.body.kind === 189 /* ModuleBlock */) { emit(node.body); } else { @@ -7815,7 +7750,7 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(10 /* CloseBraceToken */, moduleBlock.statements.end); + emitToken(14 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); @@ -7833,10 +7768,10 @@ var ts; function emitImportDeclaration(node) { var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 184 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 193 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7865,7 +7800,7 @@ var ts; emitStart(node.externalModuleName); emitLiteral(node.externalModuleName); emitEnd(node.externalModuleName); - emitToken(12 /* CloseParenToken */, node.externalModuleName.end); + emitToken(16 /* CloseParenToken */, node.externalModuleName.end); } write(";"); emitEnd(node); @@ -7876,7 +7811,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 181 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 190 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7884,7 +7819,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { return node; } }); @@ -8000,117 +7935,127 @@ var ts; return emitPinnedOrTripleSlashComments(node); } switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return emitIdentifier(node); - case 118 /* Parameter */: + case 123 /* Parameter */: return emitParameter(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessor(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return emitThis(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return emitSuper(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return write("null"); - case 89 /* TrueKeyword */: + case 93 /* TrueKeyword */: return write("true"); - case 74 /* FalseKeyword */: + case 78 /* FalseKeyword */: return write("false"); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: case 8 /* RegularExpressionLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + case 12 /* TemplateTail */: return emitLiteral(node); - case 116 /* QualifiedName */: + case 155 /* TemplateExpression */: + return emitTemplateExpression(node); + case 156 /* TemplateSpan */: + return emitTemplateSpan(node); + case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return emitArrayLiteral(node); - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return emitObjectLiteral(node); - case 136 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 137 /* PropertyAccess */: + case 142 /* PropertyAccess */: return emitPropertyAccess(node); - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return emitIndexedAccess(node); - case 139 /* CallExpression */: + case 144 /* CallExpression */: return emitCallExpression(node); - case 140 /* NewExpression */: + case 145 /* NewExpression */: return emitNewExpression(node); - case 141 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return emit(node.operand); - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return emitParenExpression(node); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return emitUnaryExpression(node); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return emitBinaryExpression(node); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return emitConditionalExpression(node); - case 149 /* OmittedExpression */: + case 157 /* OmittedExpression */: return; - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return emitBlock(node); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 152 /* EmptyStatement */: + case 160 /* EmptyStatement */: return write(";"); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return emitExpressionStatement(node); - case 154 /* IfStatement */: + case 162 /* IfStatement */: return emitIfStatement(node); - case 155 /* DoStatement */: + case 163 /* DoStatement */: return emitDoStatement(node); - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return emitWhileStatement(node); - case 157 /* ForStatement */: + case 165 /* ForStatement */: return emitForStatement(node); - case 158 /* ForInStatement */: + case 166 /* ForInStatement */: return emitForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return emitReturnStatement(node); - case 162 /* WithStatement */: + case 170 /* WithStatement */: return emitWithStatement(node); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return emitSwitchStatement(node); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return emitLabelledStatement(node); - case 167 /* ThrowStatement */: + case 175 /* ThrowStatement */: return emitThrowStatement(node); - case 168 /* TryStatement */: + case 176 /* TryStatement */: return emitTryStatement(node); - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: return emitCatchBlock(node); - case 172 /* DebuggerStatement */: + case 180 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 184 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -8128,7 +8073,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 193 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -8145,7 +8090,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 193 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8337,7 +8282,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 177 /* InterfaceDeclaration */) { + if (node.kind !== 185 /* InterfaceDeclaration */) { write("declare "); } } @@ -8393,7 +8338,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 180 /* ModuleBlock */) { + while (node.body.kind !== 189 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8410,10 +8355,34 @@ var ts; enclosingDeclaration = prevEnclosingDeclaration; } } + function emitTypeAliasDeclaration(node) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } function emitEnumDeclaration(node) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (ts.isConstEnumDeclaration(node)) { + write("const "); + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -8441,34 +8410,34 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 125 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8480,7 +8449,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 120 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 125 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8502,7 +8471,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 176 /* ClassDeclaration */) { + if (node.parent.kind === 184 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8530,7 +8499,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -8587,9 +8556,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 173 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 181 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 119 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8600,14 +8569,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 173 /* VariableDeclaration */) { + if (node.kind === 181 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 119 /* Property */) { + else if (node.kind === 124 /* Property */) { if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8626,7 +8595,15 @@ var ts; if (hasDeclarationWithEmit) { emitJsDocComments(node); emitDeclarationFlags(node); - write("var "); + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } emitCommaList(node.declarations, emitVariableDeclaration); write(";"); writeLine(); @@ -8649,7 +8626,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 123 /* SetAccessor */) { + if (node.kind === 128 /* SetAccessor */) { if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } @@ -8678,14 +8655,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 174 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 182 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 174 /* FunctionDeclaration */) { + if (node.kind === 182 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 121 /* Constructor */) { + else if (node.kind === 126 /* Constructor */) { write("constructor"); } else { @@ -8703,24 +8680,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 124 /* CallSignature */ || node.kind === 126 /* IndexSignature */) { + if (node.kind === 129 /* CallSignature */ || node.kind === 131 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 121 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 126 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8730,31 +8707,31 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 126 /* IndexSignature */: + case 131 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 120 /* Method */: + case 125 /* Method */: if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("This is unknown kind for signature: " + node.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8781,31 +8758,31 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 121 /* Constructor */: + case 126 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 125 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8816,37 +8793,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 121 /* Constructor */: - case 174 /* FunctionDeclaration */: - case 120 /* Method */: + case 126 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: return emitFunctionDeclaration(node); - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 124 /* CallSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: return emitSignatureDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 119 /* Property */: + case 124 /* Property */: return emitPropertyDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 183 /* EnumMember */: + case 186 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 192 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 182 /* ExportAssignment */: + case 191 /* ExportAssignment */: return emitExportAssignment(node); - case 184 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -8908,10 +8887,13 @@ var ts; } } var hasSemanticErrors = resolver.hasSemanticErrors(); + var hasEarlyErrors = resolver.hasEarlyErrors(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (!hasSemanticErrors && compilerOptions.declaration) { - emitDeclarations(jsFilePath, sourceFile); + if (!hasEarlyErrors) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + emitDeclarations(jsFilePath, sourceFile); + } } } if (targetSourceFile === undefined) { @@ -8938,7 +8920,10 @@ var ts; diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); var returnCode; - if (hasEmitterError) { + if (hasEarlyErrors) { + returnCode = 1 /* AllOutputGenerationSkipped */; + } + else if (hasEmitterError) { returnCode = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { @@ -9021,6 +9006,7 @@ var ts; emitFiles: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -9043,12 +9029,13 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; } + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + hasEarlyErrors: hasEarlyErrors }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(268435456 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -9061,6 +9048,7 @@ var ts; var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -9095,32 +9083,38 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; + if (flags & 2 /* BlockScopedVariable */) + result |= 107455 /* BlockScopedVariableExcludes */; + if (flags & 1 /* FunctionScopedVariable */) + result |= 107454 /* FunctionScopedVariableExcludes */; + if (flags & 4 /* Property */) + result |= 107455 /* PropertyExcludes */; + if (flags & 8 /* EnumMember */) + result |= 107455 /* EnumMemberExcludes */; + if (flags & 16 /* Function */) + result |= 106927 /* FunctionExcludes */; + if (flags & 32 /* Class */) + result |= 3258879 /* ClassExcludes */; + if (flags & 64 /* Interface */) + result |= 3152288 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 3258623 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 3259263 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 1048576 /* TypeParameter */) + result |= 2103776 /* TypeParameterExcludes */; + if (flags & 2097152 /* TypeAlias */) + result |= 3152352 /* TypeAliasExcludes */; + if (flags & 33554432 /* Import */) + result |= 33554432 /* ImportExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -9129,11 +9123,13 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) @@ -9143,6 +9139,9 @@ var ts; } function extendSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; @@ -9162,8 +9161,12 @@ var ts; recordMergedSymbol(target, source); } else { + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + ts.forEach(target.declarations, function (node) { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -9184,7 +9187,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { + if (!(symbol.flags & 134217728 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -9193,7 +9196,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) + if (symbol.flags & 268435456 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -9205,19 +9208,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 184 /* SourceFile */); + return ts.getAncestor(node, 193 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 184 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 193 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -9225,104 +9228,127 @@ var ts; } } } + function isDefinedBefore(node1, node2) { + var file1 = ts.getSourceFileOfNode(node1); + var file2 = ts.getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + if (!compilerOptions.out) { + return true; + } + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var errorLocation = location; var result; var lastLocation; - var memberWithInitializerThatReferencesIdentifierFromConstructor; - function returnResolvedSymbol(s) { - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; - } - while (location) { + var propertyWithInvalidInitializer; + var errorLocation = location; + loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); + break loop; } } switch (location.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); + case 188 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { + break loop; } break; - case 178 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { - return returnResolvedSymbol(result); + case 187 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { + break loop; } break; - case 119 /* Property */: - if (location.parent.kind === 176 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + case 124 /* Property */: + if (location.parent.kind === 184 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { - memberWithInitializerThatReferencesIdentifierFromConstructor = location; + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { + propertyWithInvalidInitializer = location; } } } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } - else { - return returnResolvedSymbol(result); - } + break loop; } break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } break; - case 143 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } var id = location.name; if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: var id = location.variable; if (name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; } lastLocation = location; location = location.parent; } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); + if (!result) { + result = getSymbol(globals, name, meaning); } - return returnResolvedSymbol(undefined); + if (!result) { + if (nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + } + return undefined; + } + if (nameNotFoundMessage) { + if (propertyWithInvalidInitializer) { + var propertyName = propertyWithInvalidInitializer.name; + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + return undefined; + } + if (result.flags & 2 /* BlockScopedVariable */) { + var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + } + } + } + return result; } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 181 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 190 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9338,33 +9364,33 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 181 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); + importDeclaration = ts.getAncestor(entityName, 190 /* ImportDeclaration */); + ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 116 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); + if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 121 /* QualifiedName */) { + return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 181 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); + ts.Debug.assert(entityName.parent.kind === 190 /* ImportDeclaration */); + return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(location, name, meaning) { - if (name.kind === 59 /* Identifier */) { - var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); + if (name.kind === 63 /* Identifier */) { + var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } } - else if (name.kind === 116 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 115 /* Missing */) + else if (name.kind === 121 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */); + if (!namespace || namespace === unknownSymbol || name.right.kind === 120 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { @@ -9375,7 +9401,7 @@ var ts; else { return; } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -9388,7 +9414,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -9415,10 +9441,10 @@ var ts; function getResolvedExportSymbol(moduleSymbol) { var symbol = getExportAssignmentSymbol(moduleSymbol); if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return resolveImport(symbol); } } @@ -9442,8 +9468,8 @@ var ts; error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); + var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */; + var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName); } } symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; @@ -9453,9 +9479,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 184 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 193 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { result.push(node); } else { @@ -9479,17 +9505,17 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } - if (symbol.flags & ts.SymbolFlags.Value) { + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 4194304 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; + if (symbol.flags & 33554432 /* Import */) { + return (resolveImport(symbol).flags & 107455 /* Value */) !== 0; } return false; } @@ -9497,7 +9523,7 @@ var ts; var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } } @@ -9551,7 +9577,7 @@ var ts; return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 118 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -9562,17 +9588,17 @@ var ts; } } switch (location.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9582,7 +9608,7 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { @@ -9602,8 +9628,8 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 181 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (symbolFromSymbolTable.flags & 33554432 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 190 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9630,7 +9656,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9640,7 +9666,7 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { @@ -9651,7 +9677,7 @@ var ts; return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; @@ -9685,7 +9711,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 179 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 184 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 188 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 193 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9695,7 +9721,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 181 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 190 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9714,10 +9740,9 @@ var ts; } function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = ts.identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); + var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.identifierToString(firstIdentifier) }; } function releaseStringWriter(writer) { writer.clear(); @@ -9753,6 +9778,18 @@ var ts; } return result; } + function getTypeAliasForTypeLiteral(type) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { + var node = type.symbol.declarations[0].parent; + while (node.kind === 138 /* ParenType */) { + node = node.parent; + } + if (node.kind === 186 /* TypeAliasDeclaration */) { + return getSymbolOfNode(node); + } + } + return undefined; + } var _displayBuilder; function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { @@ -9770,14 +9807,14 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); } } - writePunctuation(writer, 15 /* DotToken */); + writePunctuation(writer, 19 /* DotToken */); } parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); @@ -9798,14 +9835,14 @@ var ts; if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { return; } - if (symbol.flags & 512 /* TypeLiteral */ || symbol.flags & 1024 /* ObjectLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - if (enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { walkSymbol(symbol, meaning); return; } @@ -9815,14 +9852,14 @@ var ts; var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; return writeType(type, globalFlags); function writeType(type, flags) { - if (type.flags & ts.TypeFlags.Intrinsic) { + if (type.flags & 127 /* Intrinsic */) { writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); } else if (type.flags & 4096 /* Reference */) { writeTypeReference(type, flags); } else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */); } else if (type.flags & 8192 /* Tuple */) { writeTupleType(type); @@ -9837,11 +9874,11 @@ var ts; writer.writeStringLiteral(type.text); } else { - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function writeTypeList(types, union) { @@ -9850,7 +9887,7 @@ var ts; if (union) { writeSpace(writer); } - writePunctuation(writer, union ? 39 /* BarToken */ : 18 /* CommaToken */); + writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */); writeSpace(writer); } writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); @@ -9859,39 +9896,45 @@ var ts; function writeTypeReference(type, flags) { if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { writeType(type.typeArguments[0], 64 /* InElementType */); - writePunctuation(writer, 13 /* OpenBracketToken */); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } else { - buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - writePunctuation(writer, 19 /* LessThanToken */); + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + writePunctuation(writer, 23 /* LessThanToken */); writeTypeList(type.typeArguments, false); - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function writeTupleType(type) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writeTypeList(type.elementTypes, false); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } function writeUnionType(type, flags) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } writeTypeList(type.types, true); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { writeTypeofSymbol(type); } else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type); } else if (typeStack && ts.contains(typeStack, type)) { - writeKeyword(writer, 105 /* AnyKeyword */); + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */); + } + else { + writeKeyword(writer, 109 /* AnyKeyword */); + } } else { if (!typeStack) { @@ -9903,8 +9946,8 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 184 /* SourceFile */ || declaration.parent.kind === 180 /* ModuleBlock */; })); + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 193 /* SourceFile */ || declaration.parent.kind === 189 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -9912,116 +9955,116 @@ var ts; } } function writeTypeofSymbol(type) { - writeKeyword(writer, 91 /* TypeOfKeyword */); + writeKeyword(writer, 95 /* TypeOfKeyword */); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Value); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */); } function writeLiteralType(type, flags) { var resolved = resolveObjectOrUnionTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 9 /* OpenBraceToken */); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } } - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); for (var i = 0; i < resolved.callSignatures.length; i++) { buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.constructSignatures.length; i++) { - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.stringIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 114 /* StringKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 118 /* StringKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.stringIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.numberIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 112 /* NumberKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 116 /* NumberKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.numberIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } else { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(t, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } writer.decreaseIndent(); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 16 /* Class */ || targetSymbol.flags & 32 /* Interface */) { + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } } @@ -10030,67 +10073,67 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 73 /* ExtendsKeyword */); + writeKeyword(writer, 77 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); } appendSymbolNameOnly(p, writer); if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); for (var i = 0; i < parameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 27 /* EqualsGreaterThanToken */); + writePunctuation(writer, 31 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); } writeSpace(writer); buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); @@ -10123,12 +10166,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 179 /* ModuleDeclaration */) { + if (node.kind === 188 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 184 /* SourceFile */) { + else if (node.kind === 193 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10144,7 +10187,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 4194304 /* Import */) { + if (symbolOfNode.flags & 33554432 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -10152,7 +10195,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -10170,34 +10213,35 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 173 /* VariableDeclaration */: - case 179 /* ModuleDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 174 /* FunctionDeclaration */: - case 178 /* EnumDeclaration */: - case 181 /* ImportDeclaration */: - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 181 /* ImportDeclaration */ && parent.kind !== 184 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 181 /* VariableDeclaration */: + case 188 /* ModuleDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 182 /* FunctionDeclaration */: + case 187 /* EnumDeclaration */: + case 190 /* ImportDeclaration */: + var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 190 /* ImportDeclaration */ && parent.kind !== 193 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 119 /* Property */: - case 120 /* Method */: + case 124 /* Property */: + case 125 /* Method */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 121 /* Constructor */: - case 125 /* ConstructSignature */: - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - case 118 /* Parameter */: - case 180 /* ModuleBlock */: + case 126 /* Constructor */: + case 130 /* ConstructSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: + case 123 /* Parameter */: + case 189 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 184 /* SourceFile */: + case 193 /* SourceFile */: return true; default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } if (node) { @@ -10213,16 +10257,16 @@ var ts; return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 158 /* ForInStatement */) { + if (declaration.parent.kind === 166 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { var func = declaration.parent; - if (func.kind === 123 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 122 /* GetAccessor */); + if (func.kind === 128 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10234,7 +10278,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 136 /* PropertyAssignment */) { + if (declaration.kind !== 141 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10253,14 +10297,14 @@ var ts; if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 118 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 119 /* Property */: + case 124 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 118 /* Parameter */: + case 123 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: @@ -10272,11 +10316,11 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { + if (symbol.flags & 536870912 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 170 /* CatchBlock */) { + if (declaration.kind === 178 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; @@ -10299,7 +10343,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 122 /* GetAccessor */) { + if (accessor.kind === 127 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10318,8 +10362,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 123 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10349,7 +10393,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10383,22 +10427,22 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 4 /* EnumMember */) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & ts.SymbolFlags.Accessor) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getTypeOfImport(symbol); } return unknownType; @@ -10416,7 +10460,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 177 /* InterfaceDeclaration */ || node.kind === 176 /* ClassDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */ || node.kind === 184 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10447,7 +10491,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 176 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 184 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10487,7 +10531,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 177 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 185 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10514,6 +10558,23 @@ var ts; } return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -10528,7 +10589,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 117 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10543,20 +10604,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); - if (symbol.flags & 16 /* Class */) { + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 32 /* Interface */) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 64 /* Enum */) { + if (symbol.flags & 2097152 /* TypeAlias */) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144 /* TypeParameter */) { + if (symbol.flags & 1048576 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getDeclaredTypeOfImport(symbol); } return unknownType; @@ -10658,7 +10722,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "" + i); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -10675,7 +10739,7 @@ var ts; return false; } for (var i = 0; i < s.length; i++) { - if (!compareSignatures(s[i], t[i], false, isTypeIdenticalTo)) { + if (!compareSignatures(s[i], t[i], false, compareTypes)) { return false; } } @@ -10722,7 +10786,7 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - if (symbol.flags & 512 /* TypeLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; var callSignatures = getSignaturesOfSymbol(members["__call"]); var constructSignatures = getSignaturesOfSymbol(members["__new"]); @@ -10733,13 +10797,13 @@ var ts; var members = emptySymbols; var callSignatures = emptyArray; var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { + if (symbol.flags & 1952 /* HasExports */) { members = symbol.exports; } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } - if (symbol.flags & 16 /* Class */) { + if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClass(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { @@ -10751,7 +10815,7 @@ var ts; } } var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10776,13 +10840,13 @@ var ts; return type; } function getPropertiesOfObjectType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } function getPropertyOfObjectType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (ts.hasProperty(resolved.members, name)) { var symbol = resolved.members[name]; @@ -10817,10 +10881,10 @@ var ts; type = emptyObjectType; } } - if (type.flags & ts.TypeFlags.StringLike) { + if (type.flags & 258 /* StringLike */) { type = globalStringType; } - else if (type.flags & ts.TypeFlags.NumberLike) { + else if (type.flags & 132 /* NumberLike */) { type = globalNumberType; } else if (type.flags & 8 /* Boolean */) { @@ -10855,7 +10919,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(2 /* Property */ | 33554432 /* Transient */ | 134217728 /* UnionProperty */, name); + var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -10876,9 +10940,9 @@ var ts; if (type.flags & 16384 /* Union */) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { type = getApparentType(type); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { return undefined; } } @@ -10897,7 +10961,7 @@ var ts; return getPropertyOfObjectType(globalObjectType, name); } function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } @@ -10907,7 +10971,7 @@ var ts; return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } @@ -10928,7 +10992,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 121 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -10956,8 +11020,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 122 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 123 /* SetAccessor */); + if (declaration.kind === 127 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -10975,16 +11039,16 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 120 /* Method */: - case 121 /* Constructor */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11053,7 +11117,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 121 /* Constructor */ || signature.declaration.kind === 125 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -11067,7 +11131,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 112 /* NumberKeyword */ : 114 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11094,7 +11158,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 117 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11134,17 +11198,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 117 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 127 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { + if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -11162,10 +11226,10 @@ var ts; function getTypeFromTypeReferenceNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */); if (symbol) { var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -11205,9 +11269,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return declaration; } } @@ -11216,7 +11280,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -11227,7 +11291,7 @@ var ts; return type; } function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name); } function getGlobalType(name) { return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); @@ -11370,34 +11434,34 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 105 /* AnyKeyword */: + case 109 /* AnyKeyword */: return anyType; - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: return stringType; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: return numberType; - case 106 /* BooleanKeyword */: + case 110 /* BooleanKeyword */: return booleanType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return voidType; case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 127 /* TypeReference */: + case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 130 /* ArrayType */: + case 135 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 131 /* TupleType */: + case 136 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 132 /* UnionType */: + case 137 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 133 /* ParenType */: + case 138 /* ParenType */: return getTypeFromTypeNode(node.type); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return getTypeFromTypeLiteralNode(node); - case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11422,10 +11486,8 @@ var ts; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11443,10 +11505,8 @@ var ts; } function createTypeEraser(sources) { switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11495,12 +11555,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -11530,7 +11590,7 @@ var ts; return mapper(type); } if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11546,22 +11606,22 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 135 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 136 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 134 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 141 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 139 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 147 /* BinaryExpression */: - return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + case 153 /* BinaryExpression */: + return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; } function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { var result = createObjectType(32768 /* Anonymous */, type.symbol); @@ -11578,81 +11638,29 @@ var ts; var assignableRelation = {}; var identityRelation = {}; function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(source, target, identityRelation, undefined); + } + function compareTypes(source, target) { + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + return checkTypeSubtypeOf(source, target, undefined); } function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined, undefined, undefined); + return checkTypeAssignableTo(source, target, undefined); } - function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + function checkTypeAssignableTo(source, target, errorNode, headMessage) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isSignatureAssignableTo(source, target) { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { + function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var sourceStack; var targetStack; @@ -11660,118 +11668,124 @@ var ts; var depth = 0; var overflow = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + if (containingMessageChain) { + errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + } addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; + return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (relation === identityRelation) { if (source === target) - return true; + return -1 /* True */; } else { if (source === target) - return true; + return -1 /* True */; if (target.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === undefinedType) - return true; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return true; + return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) - return true; + return -1 /* True */; if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; + return -1 /* True */; if (relation === assignableRelation) { if (source.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === numberType && target.flags & 128 /* Enum */) - return true; + return -1 /* True */; } } if (source.flags & 16384 /* Union */) { - if (unionTypeRelatedToType(source, target, reportErrors)) { - return true; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else if (target.flags & 16384 /* Union */) { - if (typeRelatedToUnionType(source, target, reportErrors)) { - return true; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { - chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - ts.Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; + reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; for (var i = 0, len = targetTypes.length; i < len; i++) { - if (isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1)) { - return true; + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; } } - return false; + return 0 /* False */; } function unionTypeRelatedToType(source, target, reportErrors) { + var result = -1 /* True */; var sourceTypes = source.types; for (var i = 0, len = sourceTypes.length; i < len; i++) { - if (!isRelatedTo(sourceTypes[i], target, reportErrors)) { - return false; + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function typesRelatedTo(sources, targets, reportErrors) { + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return 0 /* False */; } if (source.constraint === target.constraint) { - return true; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -11779,29 +11793,32 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return true; + return -1 /* True */; if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return false; + return 0 /* False */; } } function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; + if (overflow) { + return 0 /* False */; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; + var related = relation[id]; + if (related !== undefined) { + return related; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; + if (source === sourceStack[i] && target === targetStack[i]) { + return 1 /* Maybe */; + } } if (depth === 100) { overflow = true; - return false; + return 0 /* False */; } } else { @@ -11817,10 +11834,27 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = -1 /* True */; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { + if (result !== 1 /* Maybe */) { relation[id] = result; } return result; @@ -11842,8 +11876,9 @@ var ts; } function propertiesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return propertiesIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } + var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; @@ -11854,10 +11889,10 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return false; + return 0 /* False */; } } - else if (!(targetProp.flags & 67108864 /* Prototype */)) { + else if (!(targetProp.flags & 536870912 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { @@ -11870,66 +11905,76 @@ var ts; reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); } } - return false; + return 0 /* False */; } } else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 16 /* Class */; + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return false; + return 0 /* False */; } } else if (sourceFlags & 64 /* Protected */) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return false; + return 0 /* False */; } + result &= related; if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } } } } - return true; + return result; } - function propertiesIdenticalTo(source, target, reportErrors) { + function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceProperties.length; i < len; ++i) { var sourceProp = sourceProperties[i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; + if (!targetProp) { + return 0 /* False */; } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { - return signaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); + } + if (target === anyFunctionType || source === anyFunctionType) { + return -1 /* True */; } - if (target === anyFunctionType || source === anyFunctionType) - return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; @@ -11938,24 +11983,26 @@ var ts; for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { - if (signatureRelatedTo(s, t, localErrors)) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } localErrors = false; } } - return false; + return 0 /* False */; } } - return true; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -11978,42 +12025,49 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); + reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return 0 /* False */; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return true; + return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } - function signaturesIdenticalTo(source, target, kind, reportErrors) { + function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo)) { - return false; + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(0 /* String */, source, target, reportErrors); + return indexTypesIdenticalTo(0 /* String */, source, target); } var targetType = getIndexTypeOfType(target, 0 /* String */); if (targetType) { @@ -12022,20 +12076,22 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); + return indexTypesIdenticalTo(1 /* Number */, source, target); } var targetType = getIndexTypeOfType(target, 1 /* Number */); if (targetType) { @@ -12045,59 +12101,98 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } - if (!compatible) { + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } - function indexTypesIdenticalTo(indexKind, source, target, reportErrors) { + function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return -1 /* True */; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return 0 /* False */; } } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1 /* True */; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0 /* False */; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0 /* False */; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return 0 /* False */; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } function compareSignatures(source, target, compareReturnTypes, compareTypes) { if (source === target) { - return true; + return -1 /* True */; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return false; + return 0 /* False */; } + var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return false; + return 0 /* False */; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!compareTypes(source.typeParameters[i], target.typeParameters[i])) { - return false; + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return 0 /* False */; } + result &= related; } } else if (source.typeParameters || source.typeParameters) { - return false; + return 0 /* False */; } source = getErasedSignature(source); target = getErasedSignature(target); for (var i = 0, len = source.parameters.length; i < len; i++) { var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!compareTypes(s, t)) { - return false; + var related = compareTypes(s, t); + if (!related) { + return 0 /* False */; } + result &= related; } - return !compareReturnTypes || compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; } function isSupertypeOfEach(candidate, types) { for (var i = 0, len = types.length; i < len; i++) { @@ -12109,8 +12204,34 @@ var ts; function getCommonSupertype(types) { return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } + function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { + var bestSupertype; + var bestSupertypeDownfallType; + var bestSupertypeScore = 0; + for (var i = 0; i < types.length; i++) { + var score = 0; + var downfallType = undefined; + for (var j = 0; j < types.length; j++) { + if (isTypeSubtypeOf(types[j], types[i])) { + score++; + } + else if (!downfallType) { + downfallType = types[j]; + } + } + if (score > bestSupertypeScore) { + bestSupertype = types[i]; + bestSupertypeDownfallType = downfallType; + bestSupertypeScore = score; + } + if (bestSupertypeScore === types.length - 1) { + break; + } + } + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); + } function isTypeOfObjectLiteral(type) { - return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -12158,7 +12279,7 @@ var ts; var members = {}; var index = 0; ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */ | p.flags, p.name); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedTypes[index++]; @@ -12293,7 +12414,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12347,27 +12468,28 @@ var ts; } } function getInferredType(context, index) { - var result = context.inferredTypes[index]; - if (!result) { + var inferredType = context.inferredTypes[index]; + if (!inferredType) { var inferences = context.inferences[index]; if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - var inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : undefinedType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; } else { inferredType = emptyObjectType; } - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; - context.inferredTypes[index] = result; + if (inferredType !== inferenceFailureType) { + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + } + context.inferredTypes[index] = inferredType; } - return result; + return inferredType; } function getInferredTypes(context) { for (var i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - context.inferences = undefined; return context.inferredTypes; } function hasAncestor(node, kind) { @@ -12376,17 +12498,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return true; - case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: node = node.parent; continue; default: @@ -12417,12 +12539,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operator >= ts.SyntaxKind.FirstAssignment && node.operator <= ts.SyntaxKind.LastAssignment) { + if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { var n = node.left; - while (n.kind === 142 /* ParenExpression */) { + while (n.kind === 148 /* ParenExpression */) { n = n.expression; } - if (n.kind === 59 /* Identifier */ && getResolvedSymbol(n) === symbol) { + if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } } @@ -12436,40 +12558,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 139 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 147 /* TypeAssertion */: + case 148 /* ParenExpression */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: + case 154 /* ConditionalExpression */: + case 158 /* Block */: + case 159 /* VariableStatement */: + case 161 /* ExpressionStatement */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 169 /* ReturnStatement */: + case 170 /* WithStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + case 174 /* LabeledStatement */: + case 175 /* ThrowStatement */: + case 176 /* TryStatement */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12477,31 +12599,31 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & 1 /* Variable */ && type.flags & ts.TypeFlags.Structured) { + if (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */) { while (true) { var child = node; node = node.parent; - if (!node || node.kind === 175 /* FunctionBlock */ || node.kind === 180 /* ModuleBlock */) { + if (!node || node.kind === 183 /* FunctionBlock */ || node.kind === 189 /* ModuleBlock */) { break; } var narrowedType = type; switch (node.kind) { - case 154 /* IfStatement */: + case 162 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: if (child === node.right) { - if (node.operator === 43 /* AmpersandAmpersandToken */) { + if (node.operator === 47 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); } - else if (node.operator === 44 /* BarBarToken */) { + else if (node.operator === 48 /* BarBarToken */) { narrowedType = narrowType(type, node.left, false); } } @@ -12519,12 +12641,12 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 145 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 151 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; var checkType = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; - if (expr.operator === 26 /* ExclamationEqualsEqualsToken */) { + if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue) { @@ -12557,7 +12679,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (!assumeTrue || expr.left.kind !== 59 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12573,25 +12695,25 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: var operator = expr.operator; - if (operator === 25 /* EqualsEqualsEqualsToken */ || operator === 26 /* ExclamationEqualsEqualsToken */) { + if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); } - else if (operator === 43 /* AmpersandAmpersandToken */) { + else if (operator === 47 /* AmpersandAmpersandToken */) { return narrowTypeByAnd(type, expr, assumeTrue); } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 81 /* InstanceOfKeyword */) { + else if (operator === 85 /* InstanceOfKeyword */) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 145 /* PrefixOperator */: - if (expr.operator === 41 /* ExclamationToken */) { + case 151 /* PrefixOperator */: + if (expr.operator === 45 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -12601,8 +12723,8 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + if (symbol.flags & 33554432 /* Import */) { + getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); @@ -12610,9 +12732,9 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */) { + if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -12622,23 +12744,23 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 144 /* ArrowFunction */) { + if (container.kind === 150 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 121 /* Constructor */: + case 126 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 119 /* Property */: + case 124 /* Property */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } @@ -12647,7 +12769,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12660,29 +12782,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 118 /* Parameter */) { + if (n.kind === 123 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 139 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12696,20 +12818,20 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 126 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 144 /* ArrowFunction */) { + while (container && container.kind === 150 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 176 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 184 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */ || container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */; } } } @@ -12723,7 +12845,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 121 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12743,7 +12865,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 143 /* FunctionExpression */ || func.kind === 144 /* ArrowFunction */) { + if (func.kind === 149 /* FunctionExpression */ || func.kind === 150 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -12767,7 +12889,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } @@ -12776,7 +12898,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 121 /* Constructor */ || func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))) { + if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -12798,12 +12920,12 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -12882,25 +13004,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 144 /* ArrowFunction */: - case 161 /* ReturnStatement */: + case 150 /* ArrowFunction */: + case 169 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return getContextualTypeForArgument(node); - case 141 /* TypeAssertion */: + case 147 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 136 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -12930,7 +13052,7 @@ var ts; if (!result) { result = signature; } - else if (!compareSignatures(result, signature, true, isTypeIdenticalTo)) { + else if (!compareSignatures(result, signature, true, compareTypes)) { return undefined; } } @@ -12962,9 +13084,9 @@ var ts; for (var id in members) { if (ts.hasProperty(members, id)) { var member = members[id]; - if (member.flags & 2 /* Property */) { + if (member.flags & 4 /* Property */) { var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) @@ -12974,11 +13096,11 @@ var ts; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 122 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 123 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -13008,17 +13130,17 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 119 /* Property */; + return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 184 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -13027,7 +13149,7 @@ var ts; } return; } - if (node.left.kind === 85 /* SuperKeyword */) { + if (node.left.kind === 89 /* SuperKeyword */) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -13058,8 +13180,8 @@ var ts; return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13074,8 +13196,8 @@ var ts; var type = checkExpression(node.left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { return false; } else { @@ -13092,15 +13214,19 @@ var ts; var indexType = checkExpression(node.index); if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== 7 /* StringLiteral */) { + error(node.index, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { var name = node.index.text; var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { + if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) { + if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) { var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; @@ -13144,7 +13270,7 @@ var ts; return callIsIncomplete || hasEnoughArguments; } function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; @@ -13164,7 +13290,7 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { @@ -13174,7 +13300,7 @@ var ts; } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13184,32 +13310,40 @@ var ts; } } var inferredTypes = getInferredTypes(context); - return ts.contains(inferredTypes, undefinedType) ? undefined : inferredTypes; + context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); + for (var i = 0; i < inferredTypes.length; i++) { + if (inferredTypes[i] === inferenceFailureType) { + inferredTypes[i] = unknownType; + } + } + return context; } - function checkTypeArguments(signature, typeArguments) { + function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { var typeParameters = signature.typeParameters; - var result = []; + var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + typeArgumentResultTypes[i] = typeArgument; + if (typeArgumentsAreAssignable) { + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } } - result.push(typeArgument); } - return result; + return typeArgumentsAreAssignable; } function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; - if (arg.kind === 149 /* OmittedExpression */) { + if (arg.kind === 157 /* OmittedExpression */) { continue; } var paramType = getTypeAtPosition(signature, i); var argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); if (!isValidArgument) { return false; } @@ -13234,40 +13368,36 @@ var ts; excludeArgument[i] = true; } } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - var lastCandidate; - while (true) { - for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { - continue; - } - while (true) { - var candidate = candidates[i]; - if (candidate.typeParameters) { - var typeArguments = node.typeArguments ? checkTypeArguments(candidate, node.typeArguments) : inferTypeArguments(candidate, args, excludeArgument); - if (!typeArguments) { - break; - } - candidate = getSignatureInstantiation(candidate, typeArguments); - } - lastCandidate = candidate; - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; + var candidateForArgumentError; + var candidateForTypeArgumentError; + var resultOfFailedInference; + var result; + if (candidates.length > 1) { + result = chooseOverload(candidates, subtypeRelation, excludeArgument); } - if (lastCandidate) { - checkApplicableSignature(node, lastCandidate, relation, undefined, true); + if (!result) { + candidateForArgumentError = undefined; + candidateForTypeArgumentError = undefined; + resultOfFailedInference = undefined; + result = chooseOverload(candidates, assignableRelation, excludeArgument); + } + if (result) { + return result; + } + if (candidateForArgumentError) { + checkApplicableSignature(node, candidateForArgumentError, assignableRelation, undefined, true); + } + else if (candidateForTypeArgumentError) { + if (node.typeArguments) { + checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true); + } + else { + ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); + var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex]; + var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); + reportNoCommonSupertypeError(inferenceCandidates, node.func, diagnosticChainHead); + } } else { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); @@ -13280,6 +13410,60 @@ var ts; } } return resolveErrorCall(node); + function chooseOverload(candidates, relation, excludeArgument) { + for (var i = 0; i < candidates.length; i++) { + if (!signatureHasCorrectArity(node, candidates[i])) { + continue; + } + var originalCandidate = candidates[i]; + var inferenceResult; + while (true) { + var candidate = originalCandidate; + if (candidate.typeParameters) { + var typeArgumentTypes; + var typeArgumentsAreValid; + if (node.typeArguments) { + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, node.typeArguments, typeArgumentTypes, false); + } + else { + inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; + typeArgumentTypes = inferenceResult.inferredTypes; + } + if (!typeArgumentsAreValid) { + break; + } + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + } + if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { + break; + } + var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + if (index < 0) { + return candidate; + } + excludeArgument[index] = false; + } + if (originalCandidate.typeParameters) { + var instantiatedCandidate = candidate; + if (typeArgumentsAreValid) { + candidateForArgumentError = instantiatedCandidate; + } + else { + candidateForTypeArgumentError = originalCandidate; + if (!node.typeArguments) { + resultOfFailedInference = inferenceResult; + } + } + } + else { + ts.Debug.assert(originalCandidate === candidate); + candidateForArgumentError = originalCandidate; + } + } + return undefined; + } function collectCandidates() { var result = candidates; var lastParent; @@ -13289,33 +13473,31 @@ var ts; ts.Debug.assert(!result.length); for (var i = 0; i < signatures.length; i++) { var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } + var symbol = signature.declaration && getSymbolOfNode(signature.declaration); + var parent = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent === lastParent) { + pos++; } else { - pos = cutoffPos = result.length; lastParent = parent; + pos = cutoffPos; } - lastSymbol = symbol; - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; } + else { + pos = cutoffPos = result.length; + lastParent = parent; + } + lastSymbol = symbol; + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; } } } function resolveCallExpression(node, candidatesOutArray) { - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); @@ -13377,18 +13559,18 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 139 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + links.resolvedSignature = node.kind === 144 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); } return links.resolvedSignature; } function checkCallExpression(node) { var signature = getResolvedSignature(node); - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 140 /* NewExpression */) { + if (node.kind === 145 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 121 /* Constructor */ && declaration.kind !== 125 /* ConstructSignature */)) { + if (declaration && (declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */)) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13397,13 +13579,18 @@ var ts; } return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node) { + checkExpression(node.tag); + checkExpression(node.template); + return anyType; + } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); if (fullTypeCheck && targetType !== unknownType) { var widenedType = getWidenedType(exprType, true); if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -13426,7 +13613,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 175 /* FunctionBlock */) { + if (func.body.kind !== 183 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13474,7 +13661,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 167 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 175 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13483,7 +13670,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 175 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 183 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13527,47 +13714,72 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) { error(operand, diagnostic); return false; } return true; } - function checkReferenceExpression(n, message) { + function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; return symbol && getExportSymbolOfValueSymbolIfExported(symbol); } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 137 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; + case 142 /* PropertyAccess */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 138 /* IndexedAccess */: + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; + case 143 /* IndexedAccess */: return true; - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; } } + function isConstVariableReference(n) { + switch (n.kind) { + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + var symbol = findSymbol(n); + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 143 /* IndexedAccess */: + var index = n.index; + var symbol = findSymbol(n.object); + if (symbol && index.kind === 7 /* StringLiteral */) { + var name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + } + return false; + case 148 /* ParenExpression */: + return isConstVariableReference(n.expression); + default: + return false; + } + } if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -13575,22 +13787,22 @@ var ts; function checkPrefixExpression(node) { var operandType = checkExpression(node.operand); switch (node.operator) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: return numberType; - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: return booleanType; - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return stringType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return undefinedType; - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13600,7 +13812,7 @@ var ts; var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13608,7 +13820,13 @@ var ts; if (type.flags & 16384 /* Union */) { return !ts.forEach(type.types, function (t) { return !isStructuredType(t); }); } - return (type.flags & ts.TypeFlags.Structured) !== 0; + return (type.flags & 65025 /* Structured */) !== 0; + } + function isConstEnumObjectType(type) { + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { if (leftType !== unknownType && !isStructuredType(leftType)) { @@ -13633,26 +13851,26 @@ var ts; var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { - case 30 /* AsteriskToken */: - case 50 /* AsteriskEqualsToken */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 32 /* PercentToken */: - case 52 /* PercentEqualsToken */: - case 29 /* MinusToken */: - case 49 /* MinusEqualsToken */: - case 35 /* LessThanLessThanToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: + case 34 /* AsteriskToken */: + case 54 /* AsteriskEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 36 /* PercentToken */: + case 56 /* PercentEqualsToken */: + case 33 /* MinusToken */: + case 53 /* MinusEqualsToken */: + case 39 /* LessThanLessThanToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) @@ -13669,17 +13887,17 @@ var ts; } } return numberType; - case 28 /* PlusToken */: - case 48 /* PlusEqualsToken */: + case 32 /* PlusToken */: + case 52 /* PlusEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) { resultType = numberType; } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) { resultType = stringType; } else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { @@ -13689,56 +13907,56 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 48 /* PlusEqualsToken */) { + if (operator === 52 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 81 /* InstanceOfKeyword */: + case 85 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 80 /* InKeyword */: + case 84 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return rightType; - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return getUnionType([leftType, rightType]); - case 47 /* EqualsToken */: + case 51 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 18 /* CommaToken */: + case 22 /* CommaToken */: return rightType; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - return 44 /* BarBarToken */; - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - return 26 /* ExclamationEqualsEqualsToken */; - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - return 43 /* AmpersandAmpersandToken */; + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + return 48 /* BarBarToken */; + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + return 30 /* ExclamationEqualsEqualsToken */; + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: + return 47 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { - checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); + checkTypeAssignableTo(valueType, leftType, node.left, undefined); } } } @@ -13752,6 +13970,12 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkTemplateExpression(node) { + ts.forEach(node.templateSpans, function (templateSpan) { + checkExpression(templateSpan.expression); + }); + return stringType; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; node.contextualType = contextualType; @@ -13778,56 +14002,67 @@ var ts; } } } + if (isConstEnumObjectType(type)) { + var ok = (node.parent.kind === 142 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 143 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + if (!ok) { + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + } + } return type; } function checkExpressionNode(node, contextualMapper) { switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return checkIdentifier(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return checkThisExpression(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return checkSuperExpression(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return nullType; - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return booleanType; case 6 /* NumericLiteral */: return numberType; + case 155 /* TemplateExpression */: + return checkTemplateExpression(node); case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return stringType; case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 116 /* QualifiedName */: + case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 137 /* PropertyAccess */: + case 142 /* PropertyAccess */: return checkPropertyAccess(node); - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return checkIndexedAccess(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return checkCallExpression(node); - case 141 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return checkTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return checkTypeAssertion(node); - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return checkExpression(node.expression); - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 145 /* PrefixOperator */: + case 151 /* PrefixOperator */: return checkPrefixExpression(node); - case 146 /* PostfixOperator */: + case 152 /* PostfixOperator */: return checkPostfixExpression(node); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 149 /* OmittedExpression */: + case 157 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -13843,7 +14078,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 121 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -13858,10 +14093,10 @@ var ts; } } function checkReferencesInInitializer(n) { - if (n.kind === 59 /* Identifier */) { + if (n.kind === 63 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 118 /* Parameter */) { + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); return; @@ -13895,10 +14130,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -13907,7 +14142,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -13921,7 +14156,7 @@ var ts; var declaration = indexSymbol.declarations[i]; if (declaration.parameters.length == 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -13929,7 +14164,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -13963,39 +14198,37 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 139 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; + return n.kind === 144 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 135 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 140 /* ObjectLiteral */: return false; + default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 87 /* ThisKeyword */) { + if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 143 /* FunctionExpression */ && n.kind !== 174 /* FunctionDeclaration */) { + else if (n.kind !== 149 /* FunctionExpression */ && n.kind !== 182 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 119 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; + return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 153 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 161 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -14010,15 +14243,15 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 122 /* GetAccessor */) { + if (node.kind === 127 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 122 /* GetAccessor */ ? 123 /* SetAccessor */ : 122 /* GetAccessor */; + var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var thisType = getAnnotatedAccessorType(node); @@ -14042,7 +14275,7 @@ var ts; var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -14084,9 +14317,9 @@ var ts; } var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 177 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 124 /* CallSignature */ || signatureDeclarationNode.kind === 125 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 124 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 185 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14104,7 +14337,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 177 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 185 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -14146,9 +14379,9 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 115 /* Missing */) { + if (node.name && node.name.kind === 120 /* Missing */) { return; } var seen = false; @@ -14164,7 +14397,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 120 /* Method */); + ts.Debug.assert(node.kind === 125 /* Method */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); @@ -14184,17 +14417,17 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 177 /* InterfaceDeclaration */ || node.parent.kind === 129 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 185 /* InterfaceDeclaration */ || node.parent.kind === 134 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 120 /* Method */ || node.kind === 121 /* Constructor */) { + if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14260,7 +14493,7 @@ var ts; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { + if (!(symbol.flags & 29360128 /* Export */)) { return; } } @@ -14288,14 +14521,14 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 177 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 179 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 181 /* ImportDeclaration */: + case 185 /* InterfaceDeclaration */: + return 8388608 /* ExportType */; + case 188 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + return 8388608 /* ExportType */ | 4194304 /* ExportValue */; + case 190 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14303,7 +14536,7 @@ var ts; }); return result; default: - return 524288 /* ExportValue */; + return 4194304 /* ExportValue */; } } } @@ -14353,7 +14586,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 118 /* Parameter */) { + if (node.kind === 123 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -14370,11 +14603,11 @@ var ts; return; } switch (current.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 120 /* Method */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 125 /* Method */: + case 150 /* ArrowFunction */: + case 126 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; @@ -14388,13 +14621,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 119 /* Property */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */) { + if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 118 /* Parameter */ && !node.parent.body) { + if (node.kind === 123 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -14409,7 +14642,7 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -14425,12 +14658,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -14443,14 +14676,27 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 179 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { + if (node.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 184 /* SourceFile */ && ts.isExternalModule(parent)) { + var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 193 /* SourceFile */ && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); } } + function checkCollisionWithConstDeclarations(node) { + if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { + error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -14467,8 +14713,9 @@ var ts; } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined); } + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); @@ -14523,7 +14770,7 @@ var ts; error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); @@ -14538,18 +14785,18 @@ var ts; if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 123 /* SetAccessor */) { + if (func.kind === 128 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined); } - else if (func.kind == 121 /* Constructor */) { + else if (func.kind == 126 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -14568,7 +14815,7 @@ var ts; if (fullTypeCheck && clause.expression) { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { - checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined); } } checkBlock(clause); @@ -14675,10 +14922,10 @@ var ts; if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, 107455 /* Value */)) { error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -14693,7 +14940,7 @@ var ts; if (t !== unknownType) { var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -14709,13 +14956,13 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { + if (base.flags & 536870912 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -14728,26 +14975,26 @@ var ts; if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { continue; } var errorMessage; - if (base.flags & 2048 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 2 /* Property */); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -14755,7 +15002,7 @@ var ts; } } function isAccessor(kind) { - return kind === 122 /* GetAccessor */ || kind === 123 /* SetAccessor */; + return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -14782,13 +15029,46 @@ var ts; } return true; } + function checkInheritedPropertiesAreIdentical(type, typeNode) { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + var seen = {}; + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { prop: p, containingType: type }; + }); + var ok = true; + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!ts.hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + return ok; + } function checkInterfaceDeclaration(node) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 177 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 185 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -14798,7 +15078,7 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); if (checkInheritedPropertiesAreIdentical(type, node.name)) { ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -14810,20 +15090,9 @@ var ts; checkTypeForDuplicateIndexSignatures(node); } } - function getConstantValueForExpression(node) { - var isNegative = false; - if (node.kind === 145 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 29 /* MinusToken */; - } - } - if (node.kind === 6 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; + function checkTypeAliasDeclaration(node) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); + checkSourceElement(node.type); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -14832,18 +15101,32 @@ var ts; var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); + var enumIsConst = ts.isConstEnumDeclaration(node); ts.forEach(node.members, function (member) { if (isNumericName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } } } - else if (ambient) { + else if (ambient && !enumIsConst) { autoValue = undefined; } if (autoValue !== undefined) { @@ -14852,6 +15135,99 @@ var ts; }); nodeLinks.flags |= 128 /* EnumValuesComputed */; } + function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + return evalConstant(initializer); + function evalConstant(e) { + switch (e.kind) { + case 151 /* PrefixOperator */: + var value = evalConstant(e.operand); + if (value === undefined) { + return undefined; + } + switch (e.operator) { + case 32 /* PlusToken */: return value; + case 33 /* MinusToken */: return -value; + case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; + } + return undefined; + case 153 /* BinaryExpression */: + if (!enumIsConst) { + return undefined; + } + var left = evalConstant(e.left); + if (left === undefined) { + return undefined; + } + var right = evalConstant(e.right); + if (right === undefined) { + return undefined; + } + switch (e.operator) { + case 43 /* BarToken */: return left | right; + case 42 /* AmpersandToken */: return left & right; + case 40 /* GreaterThanGreaterThanToken */: return left >> right; + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 39 /* LessThanLessThanToken */: return left << right; + case 44 /* CaretToken */: return left ^ right; + case 34 /* AsteriskToken */: return left * right; + case 35 /* SlashToken */: return left / right; + case 32 /* PlusToken */: return left + right; + case 33 /* MinusToken */: return left - right; + case 36 /* PercentToken */: return left % right; + } + return undefined; + case 6 /* NumericLiteral */: + return +e.text; + case 148 /* ParenExpression */: + return enumIsConst ? evalConstant(e.expression) : undefined; + case 63 /* Identifier */: + case 143 /* IndexedAccess */: + case 142 /* PropertyAccess */: + if (!enumIsConst) { + return undefined; + } + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType; + var propertyName; + if (e.kind === 63 /* Identifier */) { + enumType = currentType; + propertyName = e.text; + } + else { + if (e.kind === 143 /* IndexedAccess */) { + if (e.index.kind !== 7 /* StringLiteral */) { + return undefined; + } + var enumType = getTypeOfNode(e.object); + propertyName = e.index.text; + } + else { + var enumType = getTypeOfNode(e.left); + propertyName = e.right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & 8 /* EnumMember */)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + if (member === propertyDecl) { + return undefined; + } + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node) { if (!fullTypeCheck) { @@ -14865,9 +15241,17 @@ var ts; var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(enumSymbol.declarations, function (decl) { + if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 178 /* EnumDeclaration */) { + if (declaration.kind !== 187 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -14890,7 +15274,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 176 /* ClassDeclaration */ || (declaration.kind === 174 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 184 /* ClassDeclaration */ || (declaration.kind === 182 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -14902,7 +15286,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -14925,7 +15309,7 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 116 /* QualifiedName */) { + while (node.kind === 121 /* QualifiedName */) { node = node.left; } return node; @@ -14938,25 +15322,25 @@ var ts; if (node.entityName) { target = resolveImport(symbol); if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { + if (target.flags & 107455 /* Value */) { var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { + if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) { checkExpression(node.entityName); } else { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); } } - if (target.flags & ts.SymbolFlags.Type) { + if (target.flags & 3152352 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (node.parent.kind === 184 /* SourceFile */) { + if (node.parent.kind === 193 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 180 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 189 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -14970,7 +15354,7 @@ var ts; } } if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); } @@ -14978,7 +15362,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 184 /* SourceFile */) { + if (container.kind !== 193 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -14987,148 +15371,151 @@ var ts; if (!node) return; switch (node.kind) { - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: return checkTypeParameter(node); - case 118 /* Parameter */: + case 123 /* Parameter */: return checkParameter(node); - case 119 /* Property */: + case 124 /* Property */: return checkPropertyDeclaration(node); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return checkSignatureDeclaration(node); - case 120 /* Method */: + case 125 /* Method */: return checkMethodDeclaration(node); - case 121 /* Constructor */: + case 126 /* Constructor */: return checkConstructorDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return checkAccessorDeclaration(node); - case 127 /* TypeReference */: + case 132 /* TypeReference */: return checkTypeReference(node); - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return checkTypeQuery(node); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return checkTypeLiteral(node); - case 130 /* ArrayType */: + case 135 /* ArrayType */: return checkArrayType(node); - case 131 /* TupleType */: + case 136 /* TupleType */: return checkTupleType(node); - case 132 /* UnionType */: + case 137 /* UnionType */: return checkUnionType(node); - case 133 /* ParenType */: + case 138 /* ParenType */: return checkSourceElement(node.type); - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 150 /* Block */: + case 158 /* Block */: return checkBlock(node); - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return checkBody(node); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return checkVariableStatement(node); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return checkExpressionStatement(node); - case 154 /* IfStatement */: + case 162 /* IfStatement */: return checkIfStatement(node); - case 155 /* DoStatement */: + case 163 /* DoStatement */: return checkDoStatement(node); - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return checkWhileStatement(node); - case 157 /* ForStatement */: + case 165 /* ForStatement */: return checkForStatement(node); - case 158 /* ForInStatement */: + case 166 /* ForInStatement */: return checkForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return checkReturnStatement(node); - case 162 /* WithStatement */: + case 170 /* WithStatement */: return checkWithStatement(node); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return checkSwitchStatement(node); - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return checkLabeledStatement(node); - case 167 /* ThrowStatement */: + case 175 /* ThrowStatement */: return checkThrowStatement(node); - case 168 /* TryStatement */: + case 176 /* TryStatement */: return checkTryStatement(node); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return checkClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 186 /* TypeAliasDeclaration */: + return checkTypeAliasDeclaration(node); + case 187 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return checkImportDeclaration(node); - case 182 /* ExportAssignment */: + case 191 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 162 /* WithStatement */: + case 170 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 118 /* Parameter */: - case 119 /* Property */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 136 /* PropertyAssignment */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: - case 184 /* SourceFile */: + case 123 /* Parameter */: + case 124 /* Property */: + case 139 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + case 141 /* PropertyAssignment */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 146 /* TaggedTemplateExpression */: + case 147 /* TypeAssertion */: + case 148 /* ParenExpression */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: + case 153 /* BinaryExpression */: + case 154 /* ConditionalExpression */: + case 158 /* Block */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 159 /* VariableStatement */: + case 161 /* ExpressionStatement */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: + case 169 /* ReturnStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + case 174 /* LabeledStatement */: + case 175 /* ThrowStatement */: + case 176 /* TryStatement */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 181 /* VariableDeclaration */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: + case 193 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15145,7 +15532,7 @@ var ts; checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -15199,7 +15586,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 162 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 170 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15235,27 +15622,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + case 188 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 178 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + case 187 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 143 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15268,166 +15655,102 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 59 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; + return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 122 /* TypeParameter */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 116 /* QualifiedName */) + while (node.parent && node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 127 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 149 /* OmittedExpression */: - return true; - case 116 /* QualifiedName */: - while (node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 128 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 128 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - case 183 /* EnumMember */: - case 136 /* PropertyAssignment */: - return parent.initializer === node; - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 167 /* ThrowStatement */: - case 163 /* SwitchStatement */: - return parent.expression === node; - case 157 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 158 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 141 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 138 /* LastTypeNode */) { return true; } switch (node.kind) { - case 105 /* AnyKeyword */: - case 112 /* NumberKeyword */: - case 114 /* StringKeyword */: - case 106 /* BooleanKeyword */: + case 109 /* AnyKeyword */: + case 116 /* NumberKeyword */: + case 118 /* StringKeyword */: + case 110 /* BooleanKeyword */: return true; - case 93 /* VoidKeyword */: - return node.parent.kind !== 145 /* PrefixOperator */; + case 97 /* VoidKeyword */: + return node.parent.kind !== 151 /* PrefixOperator */; case 7 /* StringLiteral */: - return node.parent.kind === 118 /* Parameter */; - case 59 /* Identifier */: - if (node.parent.kind === 116 /* QualifiedName */) { + return node.parent.kind === 123 /* Parameter */; + case 63 /* Identifier */: + if (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - case 116 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 116 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + case 121 /* QualifiedName */: + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 128 /* TypeQuery */) { + if (parent.kind === 133 /* TypeQuery */) { return false; } - if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 138 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: return node === parent.constraint; - case 119 /* Property */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: + case 124 /* Property */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: return node === parent.type; - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 126 /* Constructor */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node === parent.type; - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return node === parent.type; - case 141 /* TypeAssertion */: + case 147 /* TypeAssertion */: return node === parent.type; - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; + case 146 /* TaggedTemplateExpression */: + return false; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 116 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 181 /* ImportDeclaration */) { + if (node.parent.kind === 190 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 182 /* ExportAssignment */) { + if (node.parent.kind === 191 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 116 /* QualifiedName */ || node.parent.kind === 137 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 142 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 182 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); + if (entityName.parent.kind === 191 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -15435,12 +15758,12 @@ var ts; if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (isExpression(entityName)) { - if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; + if (ts.isExpression(entityName)) { + if (entityName.kind === 63 /* Identifier */) { + var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 116 /* QualifiedName */ || entityName.kind === 137 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 142 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15452,8 +15775,8 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 127 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; + var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */; + meaning |= 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; @@ -15465,32 +15788,32 @@ var ts; if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 182 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 191 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { - case 59 /* Identifier */: - case 137 /* PropertyAccess */: - case 116 /* QualifiedName */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: return getSymbolOfEntityName(node); - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 107 /* ConstructorKeyword */: + case 111 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 121 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 181 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 190 /* ImportDeclaration */ && node.parent.externalModuleName === node) { var importSymbol = getSymbolOfNode(node.parent); var moduleType = getTypeOfSymbol(importSymbol); return moduleType ? moduleType.symbol : undefined; } case 6 /* NumericLiteral */: - if (node.parent.kind == 138 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 143 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15507,7 +15830,7 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } - if (isExpression(node)) { + if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeNode(node)) { @@ -15555,7 +15878,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 134217728 /* UnionProperty */) { + if (symbol.flags & 1073741824 /* UnionProperty */) { var symbols = []; var name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -15563,7 +15886,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 33554432 /* Transient */) { + else if (symbol.flags & 268435456 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -15572,7 +15895,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 184 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 193 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15584,7 +15907,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) { return false; } } @@ -15605,7 +15928,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 179 /* ModuleDeclaration */ || node.kind === 178 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 188 /* ModuleDeclaration */ || node.kind === 187 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15616,7 +15939,7 @@ var ts; var symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { symbol = exportSymbol; } if (symbol.parent) { @@ -15626,29 +15949,35 @@ var ts; } function getExportAssignmentName(node) { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 184 /* SourceFile */ || !node.entityName) { + function isTopLevelValueImportWithEntityName(node) { + if (node.parent.kind !== 193 /* SourceFile */ || !node.entityName) { return false; } var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; } + function hasEarlyErrors(sourceFile) { + return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); + } + function isImportResolvedToValue(symbol) { + var target = resolveImport(symbol); + return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); + } + function isConstEnumOrConstEnumOnlyModule(s) { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; + } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } @@ -15669,10 +15998,10 @@ var ts; } function getConstantValue(node) { var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { + if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 183 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 192 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -15680,7 +16009,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & 2048 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -15696,8 +16025,9 @@ var ts; isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, + hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, @@ -15837,10 +16167,10 @@ var ts; { name: "target", shortName: "t", - type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */ }, - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5, + type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, + description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_or_es5 + error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 }, { name: "version", @@ -15853,6 +16183,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "preserveConstEnums", + type: "boolean", + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code } ]; var shortOptionNames = {}; @@ -15904,9 +16239,10 @@ var ts; options[opt.name] = args[i++] || ""; break; default: - var value = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; + var map = opt.type; + var key = (args[i++] || "").toLowerCase(); + if (ts.hasProperty(map, key)) { + options[opt.name] = map[key]; } else { errors.push(ts.createCompilerDiagnostic(opt.error)); @@ -16222,13 +16558,18 @@ var ts; else { var checker = program.getTypeChecker(true); var checkStart = new Date().getTime(); - var semanticErrors = checker.getDiagnostics(); - var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; - exitStatus = emitOutput.emitResultStatus; - var reportStart = new Date().getTime(); - errors = ts.concatenate(semanticErrors, emitErrors); + errors = checker.getDiagnostics(); + if (!checker.hasEarlyErrors()) { + var emitStart = new Date().getTime(); + var emitOutput = checker.emitFiles(); + var emitErrors = emitOutput.errors; + exitStatus = emitOutput.emitResultStatus; + var reportStart = new Date().getTime(); + errors = ts.concatenate(errors, emitErrors); + } + else { + exitStatus = 1 /* AllOutputGenerationSkipped */; + } } reportDiagnostics(errors); if (commandLine.options.diagnostics) { diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 6bd9677a26a..ea97ea9ea75 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -128,7 +128,14 @@ var ts; Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - An_enum_member_cannot_have_a_numeric_name: { code: 1151, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, @@ -149,17 +156,16 @@ var ts; Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, + Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, + Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, @@ -172,7 +178,6 @@ var ts; Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, @@ -182,7 +187,6 @@ var ts; Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, @@ -243,12 +247,9 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, @@ -256,7 +257,6 @@ var ts; Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, @@ -275,6 +275,15 @@ var ts; Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -354,6 +363,15 @@ var ts; Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, @@ -368,8 +386,9 @@ var ts; Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, @@ -391,7 +410,7 @@ var ts; Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, @@ -421,111 +440,112 @@ var ts; var ts; (function (ts) { var textToToken = { - "any": 105 /* AnyKeyword */, - "boolean": 106 /* BooleanKeyword */, - "break": 60 /* BreakKeyword */, - "case": 61 /* CaseKeyword */, - "catch": 62 /* CatchKeyword */, - "class": 63 /* ClassKeyword */, - "continue": 65 /* ContinueKeyword */, - "const": 64 /* ConstKeyword */, - "constructor": 107 /* ConstructorKeyword */, - "debugger": 66 /* DebuggerKeyword */, - "declare": 108 /* DeclareKeyword */, - "default": 67 /* DefaultKeyword */, - "delete": 68 /* DeleteKeyword */, - "do": 69 /* DoKeyword */, - "else": 70 /* ElseKeyword */, - "enum": 71 /* EnumKeyword */, - "export": 72 /* ExportKeyword */, - "extends": 73 /* ExtendsKeyword */, - "false": 74 /* FalseKeyword */, - "finally": 75 /* FinallyKeyword */, - "for": 76 /* ForKeyword */, - "function": 77 /* FunctionKeyword */, - "get": 109 /* GetKeyword */, - "if": 78 /* IfKeyword */, - "implements": 96 /* ImplementsKeyword */, - "import": 79 /* ImportKeyword */, - "in": 80 /* InKeyword */, - "instanceof": 81 /* InstanceOfKeyword */, - "interface": 97 /* InterfaceKeyword */, - "let": 98 /* LetKeyword */, - "module": 110 /* ModuleKeyword */, - "new": 82 /* NewKeyword */, - "null": 83 /* NullKeyword */, - "number": 112 /* NumberKeyword */, - "package": 99 /* PackageKeyword */, - "private": 100 /* PrivateKeyword */, - "protected": 101 /* ProtectedKeyword */, - "public": 102 /* PublicKeyword */, - "require": 111 /* RequireKeyword */, - "return": 84 /* ReturnKeyword */, - "set": 113 /* SetKeyword */, - "static": 103 /* StaticKeyword */, - "string": 114 /* StringKeyword */, - "super": 85 /* SuperKeyword */, - "switch": 86 /* SwitchKeyword */, - "this": 87 /* ThisKeyword */, - "throw": 88 /* ThrowKeyword */, - "true": 89 /* TrueKeyword */, - "try": 90 /* TryKeyword */, - "typeof": 91 /* TypeOfKeyword */, - "var": 92 /* VarKeyword */, - "void": 93 /* VoidKeyword */, - "while": 94 /* WhileKeyword */, - "with": 95 /* WithKeyword */, - "yield": 104 /* YieldKeyword */, - "{": 9 /* OpenBraceToken */, - "}": 10 /* CloseBraceToken */, - "(": 11 /* OpenParenToken */, - ")": 12 /* CloseParenToken */, - "[": 13 /* OpenBracketToken */, - "]": 14 /* CloseBracketToken */, - ".": 15 /* DotToken */, - "...": 16 /* DotDotDotToken */, - ";": 17 /* SemicolonToken */, - ",": 18 /* CommaToken */, - "<": 19 /* LessThanToken */, - ">": 20 /* GreaterThanToken */, - "<=": 21 /* LessThanEqualsToken */, - ">=": 22 /* GreaterThanEqualsToken */, - "==": 23 /* EqualsEqualsToken */, - "!=": 24 /* ExclamationEqualsToken */, - "===": 25 /* EqualsEqualsEqualsToken */, - "!==": 26 /* ExclamationEqualsEqualsToken */, - "=>": 27 /* EqualsGreaterThanToken */, - "+": 28 /* PlusToken */, - "-": 29 /* MinusToken */, - "*": 30 /* AsteriskToken */, - "/": 31 /* SlashToken */, - "%": 32 /* PercentToken */, - "++": 33 /* PlusPlusToken */, - "--": 34 /* MinusMinusToken */, - "<<": 35 /* LessThanLessThanToken */, - ">>": 36 /* GreaterThanGreaterThanToken */, - ">>>": 37 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 38 /* AmpersandToken */, - "|": 39 /* BarToken */, - "^": 40 /* CaretToken */, - "!": 41 /* ExclamationToken */, - "~": 42 /* TildeToken */, - "&&": 43 /* AmpersandAmpersandToken */, - "||": 44 /* BarBarToken */, - "?": 45 /* QuestionToken */, - ":": 46 /* ColonToken */, - "=": 47 /* EqualsToken */, - "+=": 48 /* PlusEqualsToken */, - "-=": 49 /* MinusEqualsToken */, - "*=": 50 /* AsteriskEqualsToken */, - "/=": 51 /* SlashEqualsToken */, - "%=": 52 /* PercentEqualsToken */, - "<<=": 53 /* LessThanLessThanEqualsToken */, - ">>=": 54 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 56 /* AmpersandEqualsToken */, - "|=": 57 /* BarEqualsToken */, - "^=": 58 /* CaretEqualsToken */ + "any": 109 /* AnyKeyword */, + "boolean": 110 /* BooleanKeyword */, + "break": 64 /* BreakKeyword */, + "case": 65 /* CaseKeyword */, + "catch": 66 /* CatchKeyword */, + "class": 67 /* ClassKeyword */, + "continue": 69 /* ContinueKeyword */, + "const": 68 /* ConstKeyword */, + "constructor": 111 /* ConstructorKeyword */, + "debugger": 70 /* DebuggerKeyword */, + "declare": 112 /* DeclareKeyword */, + "default": 71 /* DefaultKeyword */, + "delete": 72 /* DeleteKeyword */, + "do": 73 /* DoKeyword */, + "else": 74 /* ElseKeyword */, + "enum": 75 /* EnumKeyword */, + "export": 76 /* ExportKeyword */, + "extends": 77 /* ExtendsKeyword */, + "false": 78 /* FalseKeyword */, + "finally": 79 /* FinallyKeyword */, + "for": 80 /* ForKeyword */, + "function": 81 /* FunctionKeyword */, + "get": 113 /* GetKeyword */, + "if": 82 /* IfKeyword */, + "implements": 100 /* ImplementsKeyword */, + "import": 83 /* ImportKeyword */, + "in": 84 /* InKeyword */, + "instanceof": 85 /* InstanceOfKeyword */, + "interface": 101 /* InterfaceKeyword */, + "let": 102 /* LetKeyword */, + "module": 114 /* ModuleKeyword */, + "new": 86 /* NewKeyword */, + "null": 87 /* NullKeyword */, + "number": 116 /* NumberKeyword */, + "package": 103 /* PackageKeyword */, + "private": 104 /* PrivateKeyword */, + "protected": 105 /* ProtectedKeyword */, + "public": 106 /* PublicKeyword */, + "require": 115 /* RequireKeyword */, + "return": 88 /* ReturnKeyword */, + "set": 117 /* SetKeyword */, + "static": 107 /* StaticKeyword */, + "string": 118 /* StringKeyword */, + "super": 89 /* SuperKeyword */, + "switch": 90 /* SwitchKeyword */, + "this": 91 /* ThisKeyword */, + "throw": 92 /* ThrowKeyword */, + "true": 93 /* TrueKeyword */, + "try": 94 /* TryKeyword */, + "type": 119 /* TypeKeyword */, + "typeof": 95 /* TypeOfKeyword */, + "var": 96 /* VarKeyword */, + "void": 97 /* VoidKeyword */, + "while": 98 /* WhileKeyword */, + "with": 99 /* WithKeyword */, + "yield": 108 /* YieldKeyword */, + "{": 13 /* OpenBraceToken */, + "}": 14 /* CloseBraceToken */, + "(": 15 /* OpenParenToken */, + ")": 16 /* CloseParenToken */, + "[": 17 /* OpenBracketToken */, + "]": 18 /* CloseBracketToken */, + ".": 19 /* DotToken */, + "...": 20 /* DotDotDotToken */, + ";": 21 /* SemicolonToken */, + ",": 22 /* CommaToken */, + "<": 23 /* LessThanToken */, + ">": 24 /* GreaterThanToken */, + "<=": 25 /* LessThanEqualsToken */, + ">=": 26 /* GreaterThanEqualsToken */, + "==": 27 /* EqualsEqualsToken */, + "!=": 28 /* ExclamationEqualsToken */, + "===": 29 /* EqualsEqualsEqualsToken */, + "!==": 30 /* ExclamationEqualsEqualsToken */, + "=>": 31 /* EqualsGreaterThanToken */, + "+": 32 /* PlusToken */, + "-": 33 /* MinusToken */, + "*": 34 /* AsteriskToken */, + "/": 35 /* SlashToken */, + "%": 36 /* PercentToken */, + "++": 37 /* PlusPlusToken */, + "--": 38 /* MinusMinusToken */, + "<<": 39 /* LessThanLessThanToken */, + ">>": 40 /* GreaterThanGreaterThanToken */, + ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 42 /* AmpersandToken */, + "|": 43 /* BarToken */, + "^": 44 /* CaretToken */, + "!": 45 /* ExclamationToken */, + "~": 46 /* TildeToken */, + "&&": 47 /* AmpersandAmpersandToken */, + "||": 48 /* BarBarToken */, + "?": 49 /* QuestionToken */, + ":": 50 /* ColonToken */, + "=": 51 /* EqualsToken */, + "+=": 52 /* PlusEqualsToken */, + "-=": 53 /* MinusEqualsToken */, + "*=": 54 /* AsteriskEqualsToken */, + "/=": 55 /* SlashEqualsToken */, + "%=": 56 /* PercentEqualsToken */, + "<<=": 57 /* LessThanLessThanEqualsToken */, + ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 60 /* AmpersandEqualsToken */, + "|=": 61 /* BarEqualsToken */, + "^=": 62 /* CaretEqualsToken */ }; var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; @@ -827,10 +847,10 @@ var ts; } return +(text.substring(start, pos)); } - function scanHexDigits(count, exact) { + function scanHexDigits(count, mustMatchCount) { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; @@ -870,61 +890,7 @@ var ts; } if (ch === 92 /* backslash */) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -937,6 +903,102 @@ var ts; } return result; } + function scanTemplateAndSetTokenValue() { + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; + pos++; + var start = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(ts.Diagnostics.Unexpected_end_of_text); + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96 /* backtick */) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; + break; + } + if (currChar === 92 /* backslash */) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + if (currChar === 13 /* carriageReturn */) { + contents += text.substring(start, pos); + if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + pos++; + } + ts.Debug.assert(resultingToken !== undefined); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence() { + pos++; + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case 48 /* _0 */: + return "\0"; + case 98 /* b */: + return "\b"; + case 116 /* t */: + return "\t"; + case 110 /* n */: + return "\n"; + case 118 /* v */: + return "\v"; + case 102 /* f */: + return "\f"; + case 114 /* r */: + return "\r"; + case 39 /* singleQuote */: + return "\'"; + case 34 /* doubleQuote */: + return "\""; + case 120 /* x */: + case 117 /* u */: + var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(ts.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + case 13 /* carriageReturn */: + if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: + return ""; + default: + return String.fromCharCode(ch); + } + } function peekUnicodeEscape() { if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { var start = pos; @@ -980,7 +1042,7 @@ var ts; return token = textToToken[tokenValue]; } } - return token = 59 /* Identifier */; + return token = 63 /* Identifier */; } function scan() { startPos = pos; @@ -1025,64 +1087,66 @@ var ts; case 33 /* exclamation */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 26 /* ExclamationEqualsEqualsToken */; + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 24 /* ExclamationEqualsToken */; + return pos += 2, token = 28 /* ExclamationEqualsToken */; } - return pos++, token = 41 /* ExclamationToken */; + return pos++, token = 45 /* ExclamationToken */; case 34 /* doubleQuote */: case 39 /* singleQuote */: tokenValue = scanString(); return token = 7 /* StringLiteral */; + case 96 /* backtick */: + return token = scanTemplateAndSetTokenValue(); case 37 /* percent */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* PercentEqualsToken */; + return pos += 2, token = 56 /* PercentEqualsToken */; } - return pos++, token = 32 /* PercentToken */; + return pos++, token = 36 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 43 /* AmpersandAmpersandToken */; + return pos += 2, token = 47 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AmpersandEqualsToken */; + return pos += 2, token = 60 /* AmpersandEqualsToken */; } - return pos++, token = 38 /* AmpersandToken */; + return pos++, token = 42 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 11 /* OpenParenToken */; + return pos++, token = 15 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 12 /* CloseParenToken */; + return pos++, token = 16 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* AsteriskEqualsToken */; + return pos += 2, token = 54 /* AsteriskEqualsToken */; } - return pos++, token = 30 /* AsteriskToken */; + return pos++, token = 34 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 33 /* PlusPlusToken */; + return pos += 2, token = 37 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PlusEqualsToken */; + return pos += 2, token = 52 /* PlusEqualsToken */; } - return pos++, token = 28 /* PlusToken */; + return pos++, token = 32 /* PlusToken */; case 44 /* comma */: - return pos++, token = 18 /* CommaToken */; + return pos++, token = 22 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 34 /* MinusMinusToken */; + return pos += 2, token = 38 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 49 /* MinusEqualsToken */; + return pos += 2, token = 53 /* MinusEqualsToken */; } - return pos++, token = 29 /* MinusToken */; + return pos++, token = 33 /* MinusToken */; case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanNumber(); return token = 6 /* NumericLiteral */; } if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 16 /* DotDotDotToken */; + return pos += 3, token = 20 /* DotDotDotToken */; } - return pos++, token = 15 /* DotToken */; + return pos++, token = 19 /* DotToken */; case 47 /* slash */: if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1131,9 +1195,9 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 51 /* SlashEqualsToken */; + return pos += 2, token = 55 /* SlashEqualsToken */; } - return pos++, token = 31 /* SlashToken */; + return pos++, token = 35 /* SlashToken */; case 48 /* _0 */: if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; @@ -1161,58 +1225,58 @@ var ts; tokenValue = "" + scanNumber(); return token = 6 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 46 /* ColonToken */; + return pos++, token = 50 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 17 /* SemicolonToken */; + return pos++, token = 21 /* SemicolonToken */; case 60 /* lessThan */: if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 53 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 35 /* LessThanLessThanToken */; + return pos += 2, token = 39 /* LessThanLessThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 21 /* LessThanEqualsToken */; + return pos += 2, token = 25 /* LessThanEqualsToken */; } - return pos++, token = 19 /* LessThanToken */; + return pos++, token = 23 /* LessThanToken */; case 61 /* equals */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 25 /* EqualsEqualsEqualsToken */; + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 23 /* EqualsEqualsToken */; + return pos += 2, token = 27 /* EqualsEqualsToken */; } if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 27 /* EqualsGreaterThanToken */; + return pos += 2, token = 31 /* EqualsGreaterThanToken */; } - return pos++, token = 47 /* EqualsToken */; + return pos++, token = 51 /* EqualsToken */; case 62 /* greaterThan */: - return pos++, token = 20 /* GreaterThanToken */; + return pos++, token = 24 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 45 /* QuestionToken */; + return pos++, token = 49 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 13 /* OpenBracketToken */; + return pos++, token = 17 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 14 /* CloseBracketToken */; + return pos++, token = 18 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* CaretEqualsToken */; + return pos += 2, token = 62 /* CaretEqualsToken */; } - return pos++, token = 40 /* CaretToken */; + return pos++, token = 44 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 9 /* OpenBraceToken */; + return pos++, token = 13 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 44 /* BarBarToken */; + return pos += 2, token = 48 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* BarEqualsToken */; + return pos += 2, token = 61 /* BarEqualsToken */; } - return pos++, token = 39 /* BarToken */; + return pos++, token = 43 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 10 /* CloseBraceToken */; + return pos++, token = 14 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 42 /* TildeToken */; + return pos++, token = 46 /* TildeToken */; case 92 /* backslash */: var ch = peekUnicodeEscape(); if (ch >= 0 && isIdentifierStart(ch)) { @@ -1248,27 +1312,27 @@ var ts; } } function reScanGreaterToken() { - if (token === 20 /* GreaterThanToken */) { + if (token === 24 /* GreaterThanToken */) { if (text.charCodeAt(pos) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 37 /* GreaterThanGreaterThanGreaterThanToken */; + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 36 /* GreaterThanGreaterThanToken */; + return pos++, token = 40 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 22 /* GreaterThanEqualsToken */; + return pos++, token = 26 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -1307,6 +1371,11 @@ var ts; } return token; } + function reScanTemplateToken() { + ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } function tryScan(callback) { var savePos = pos; var saveStartPos = startPos; @@ -1346,10 +1415,11 @@ var ts; getTokenText: function () { return text.substring(tokenPos, pos); }, getTokenValue: function () { return tokenValue; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 59 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, scan: scan, setText: setText, setTextPos: setTextPos, @@ -1360,229 +1430,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 6] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 7] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 8] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 9] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 10] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 11] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 12] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 13] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 14] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 15] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 16] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 17] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 18] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 19] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 20] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 21] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 22] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 23] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 24] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 25] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 26] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 27] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 28] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 29] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 30] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 31] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 32] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 33] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 34] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 35] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 36] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 37] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 38] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 39] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 40] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 41] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 42] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 43] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 44] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 45] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 46] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 47] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 48] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 49] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 50] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 51] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 52] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 53] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 54] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 55] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 56] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 57] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 58] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 59] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 60] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 61] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 62] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 63] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 64] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 65] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 66] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 67] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 68] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 69] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 70] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 71] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 72] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 73] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 74] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 75] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 76] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 77] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 78] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 79] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 80] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 81] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 82] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 83] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 84] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 85] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 86] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 87] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 88] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 89] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 90] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 91] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 92] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 93] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 94] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 95] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 96] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 97] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 98] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 99] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 100] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 101] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 102] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 103] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 104] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 105] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 106] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 107] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 108] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 109] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 110] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 111] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 115] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 116] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 117] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 118] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 119] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 120] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 121] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 122] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 123] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 124] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 125] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 126] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 127] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 128] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 129] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 130] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 131] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 132] = "UnionType"; - SyntaxKind[SyntaxKind["ParenType"] = 133] = "ParenType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 134] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 135] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 136] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 137] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 138] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 139] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 140] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 141] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 142] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 143] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 144] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 145] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 146] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 147] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 148] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 149] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 150] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 151] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 152] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 153] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 154] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 155] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 156] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 157] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 158] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 159] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 160] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 161] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 162] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 163] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 164] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 165] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 166] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 167] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 168] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 169] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 170] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 171] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 172] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 173] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 174] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 175] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 176] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 177] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 178] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 179] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 180] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 181] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 182] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 183] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 184] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 185] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 186] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 187] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.ParenType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.StringKeyword] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Protected"] = 0x00000040] = "Protected"; - NodeFlags[NodeFlags["Static"] = 0x00000080] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; (function (EmitReturnStatus) { EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; @@ -1592,277 +1439,12 @@ var ts; EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); var EmitReturnStatus = ts.EmitReturnStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 0x00000004] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 0x00000008] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0x00000010] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 0x00000020] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 0x00000040] = "InElementType"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0x00000000] = "None"; - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 0x00000001] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 0x00000002] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 0x08000000] = "UnionProperty"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 0x00000080] = "EnumValuesComputed"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 0x00002000] = "Tuple"; - TypeFlags[TypeFlags["Union"] = 0x00004000] = "Union"; - TypeFlags[TypeFlags["Anonymous"] = 0x00008000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00010000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Tuple | TypeFlags.Anonymous] = "ObjectType"; - TypeFlags[TypeFlags["Structured"] = TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.Union | TypeFlags.TypeParameter] = "Structured"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); var ts; (function (ts) { @@ -2068,7 +1650,8 @@ var ts; length: length, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createFileDiagnostic = createFileDiagnostic; @@ -2083,7 +1666,8 @@ var ts; length: undefined, messageText: text, category: message.category, - code: message.code + code: message.code, + isEarly: message.isEarly }; } ts.createCompilerDiagnostic = createCompilerDiagnostic; @@ -2100,6 +1684,12 @@ var ts; }; } ts.chainDiagnosticMessages = chainDiagnosticMessages; + function concatenateDiagnosticMessageChains(headChain, tailChain) { + Debug.assert(!headChain.next); + headChain.next = tailChain; + return headChain; + } + ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); @@ -2130,12 +1720,12 @@ var ts; ts.flattenDiagnosticChain = flattenDiagnosticChain; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFilename(diagnostic) { @@ -2153,7 +1743,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -2382,13 +1972,6 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; var Debug; (function (Debug) { var currentAssertionLevel = 0 /* None */; @@ -2414,7 +1997,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(187 /* Count */); + var nodeConstructors = new Array(196 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2427,7 +2010,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 184 /* SourceFile */) + while (node && node.kind !== 193 /* SourceFile */) node = node.parent; return node; } @@ -2464,13 +2047,13 @@ var ts; } ts.unescapeIdentifier = unescapeIdentifier; function identifierToString(identifier) { - return identifier.kind === 115 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + return identifier.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); } ts.identifierToString = identifierToString; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = node.kind === 115 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); + var start = node.kind === 120 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2486,12 +2069,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: + case 181 /* VariableDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 188 /* ModuleDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: errorSpan = node.name; break; } @@ -2506,12 +2089,16 @@ var ts; return (file.flags & 1024 /* DeclarationFile */) !== 0; } ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return (node.flags & 4096 /* Const */) !== 0; + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 153 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 161 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 59 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); + return node.kind === 63 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); } function isUseStrictPrologueDirective(node) { ts.Debug.assert(isPrologueDirective(node)); @@ -2519,7 +2106,7 @@ var ts; } function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 118 /* Parameter */ || node.kind === 117 /* TypeParameter */) { + if (node.kind === 123 /* Parameter */ || node.kind === 122 /* TypeParameter */) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2555,120 +2142,128 @@ var ts; if (!node) return; switch (node.kind) { - case 116 /* QualifiedName */: + case 121 /* QualifiedName */: return child(node.left) || child(node.right); - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 118 /* Parameter */: + case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 119 /* Property */: - case 136 /* PropertyAssignment */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 127 /* TypeReference */: + case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return child(node.exprName); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return children(node.members); - case 130 /* ArrayType */: + case 135 /* ArrayType */: return child(node.elementType); - case 131 /* TupleType */: + case 136 /* TupleType */: return children(node.elementTypes); - case 132 /* UnionType */: + case 137 /* UnionType */: return children(node.types); - case 133 /* ParenType */: + case 138 /* ParenType */: return child(node.type); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return children(node.elements); - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return children(node.properties); - case 137 /* PropertyAccess */: + case 142 /* PropertyAccess */: return child(node.left) || child(node.right); - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return child(node.object) || child(node.index); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 141 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return child(node.tag) || child(node.template); + case 147 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return child(node.expression); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return child(node.operand); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return child(node.left) || child(node.right); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 184 /* SourceFile */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 193 /* SourceFile */: return children(node.statements); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return children(node.declarations); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return child(node.expression); - case 154 /* IfStatement */: + case 162 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 155 /* DoStatement */: + case 163 /* DoStatement */: return child(node.statement) || child(node.expression); - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 157 /* ForStatement */: + case 165 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 158 /* ForInStatement */: + case 166 /* ForInStatement */: return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return child(node.label); - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return child(node.expression); - case 162 /* WithStatement */: + case 170 /* WithStatement */: return child(node.expression) || child(node.statement); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 167 /* ThrowStatement */: + case 175 /* ThrowStatement */: return child(node.expression); - case 168 /* TryStatement */: + case 176 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 178 /* EnumDeclaration */: + case 186 /* TypeAliasDeclaration */: + return child(node.name) || child(node.type); + case 187 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 183 /* EnumMember */: + case 192 /* EnumMember */: return child(node.name) || child(node.initializer); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 182 /* ExportAssignment */: + case 191 /* ExportAssignment */: return child(node.exportName); + case 155 /* TemplateExpression */: + return child(node.head) || children(node.templateSpans); + case 156 /* TemplateSpan */: + return child(node.expression) || child(node.literal); } } ts.forEachChild = forEachChild; @@ -2676,24 +2271,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return visitor(node); - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 158 /* Block */: + case 183 /* FunctionBlock */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 170 /* WithStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + case 174 /* LabeledStatement */: + case 176 /* TryStatement */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: return forEachChild(node, traverse); } } @@ -2702,13 +2297,13 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: return true; } } @@ -2731,20 +2326,20 @@ var ts; return undefined; } switch (node.kind) { - case 144 /* ArrowFunction */: + case 150 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 179 /* ModuleDeclaration */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 178 /* EnumDeclaration */: - case 184 /* SourceFile */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 188 /* ModuleDeclaration */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* EnumDeclaration */: + case 193 /* SourceFile */: return node; } } @@ -2757,20 +2352,103 @@ var ts; return undefined; } switch (node.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; + function isExpression(node) { + switch (node.kind) { + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: + case 8 /* RegularExpressionLiteral */: + case 139 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 146 /* TaggedTemplateExpression */: + case 147 /* TypeAssertion */: + case 148 /* ParenExpression */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: + case 153 /* BinaryExpression */: + case 154 /* ConditionalExpression */: + case 155 /* TemplateExpression */: + case 157 /* OmittedExpression */: + return true; + case 121 /* QualifiedName */: + while (node.parent.kind === 121 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 133 /* TypeQuery */; + case 63 /* Identifier */: + if (node.parent.kind === 133 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: + case 192 /* EnumMember */: + case 141 /* PropertyAssignment */: + return parent.initializer === node; + case 161 /* ExpressionStatement */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 169 /* ReturnStatement */: + case 170 /* WithStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 175 /* ThrowStatement */: + case 171 /* SwitchStatement */: + return parent.expression === node; + case 165 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 166 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 147 /* TypeAssertion */: + return node === parent.operand; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function hasRestParameters(s) { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; } ts.hasRestParameters = hasRestParameters; + function isLiteralKind(kind) { + return 6 /* FirstLiteralToken */ <= kind && kind <= 9 /* LastLiteralToken */; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 7 /* StringLiteral */ || kind === 9 /* NoSubstitutionTemplateLiteral */; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isTemplateLiteralKind(kind) { + return 9 /* FirstTemplateToken */ <= kind && kind <= 12 /* LastTemplateToken */; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; function isInAmbientContext(node) { while (node) { if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) @@ -2782,21 +2460,22 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 122 /* TypeParameter */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return true; } return false; @@ -2804,24 +2483,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 172 /* DebuggerStatement */: - case 155 /* DoStatement */: - case 153 /* ExpressionStatement */: - case 152 /* EmptyStatement */: - case 158 /* ForInStatement */: - case 157 /* ForStatement */: - case 154 /* IfStatement */: - case 166 /* LabeledStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: - case 88 /* ThrowKeyword */: - case 168 /* TryStatement */: - case 151 /* VariableStatement */: - case 156 /* WhileStatement */: - case 162 /* WithStatement */: - case 182 /* ExportAssignment */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 180 /* DebuggerStatement */: + case 163 /* DoStatement */: + case 161 /* ExpressionStatement */: + case 160 /* EmptyStatement */: + case 166 /* ForInStatement */: + case 165 /* ForStatement */: + case 162 /* IfStatement */: + case 174 /* LabeledStatement */: + case 169 /* ReturnStatement */: + case 171 /* SwitchStatement */: + case 92 /* ThrowKeyword */: + case 176 /* TryStatement */: + case 159 /* VariableStatement */: + case 164 /* WhileStatement */: + case 170 /* WithStatement */: + case 191 /* ExportAssignment */: return true; default: return false; @@ -2829,14 +2508,14 @@ var ts; } ts.isStatement = isStatement; function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 59 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { + if (name.kind !== 63 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 143 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 149 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 170 /* CatchBlock */) { + if (parent.kind === 178 /* CatchBlock */) { return parent.variable === name; } return false; @@ -2844,15 +2523,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return node; - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -2872,107 +2552,44 @@ var ts; return undefined; } ts.getAncestor = getAncestor; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 16] = "TupleElementTypes"; - ParsingContext[ParsingContext["Count"] = 17] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; - case 16 /* TupleElementTypes */: - return ts.Diagnostics.Type_expected; + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* ModuleElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* BlockStatements */: return ts.Diagnostics.Statement_expected; + case 3 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 4 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; + case 5 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 6 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 8 /* BaseTypeReferences */: return ts.Diagnostics.Type_reference_expected; + case 9 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 10 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 11 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 12 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 13 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 14 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 15 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 16 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; } } ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; + return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { - return ts.SyntaxKind.FirstTriviaToken <= token && token <= ts.SyntaxKind.LastTriviaToken; + return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; } ts.isTrivia = isTrivia; function isModifier(token) { switch (token) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - case 72 /* ExportKeyword */: - case 108 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + case 76 /* ExportKeyword */: + case 112 /* DeclareKeyword */: return true; } return false; @@ -3134,6 +2751,9 @@ var ts; function reScanSlashToken() { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken() { + return token = scanner.reScanTemplateToken(); + } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; var saveSyntacticErrorsLength = file.syntacticErrors.length; @@ -3163,7 +2783,7 @@ var ts; return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); } function isIdentifier() { - return token === 59 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); + return token === 63 /* Identifier */ || (isInStrictMode ? token > 108 /* LastFutureReservedWord */ : token > 99 /* LastReservedWord */); } function parseExpected(t) { if (token === t) { @@ -3181,14 +2801,14 @@ var ts; return false; } function canParseSemicolon() { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { return true; } - return token === 10 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token === 14 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { nextToken(); } } @@ -3210,7 +2830,7 @@ var ts; return node; } function createMissingNode() { - return createNode(115 /* Missing */); + return createNode(120 /* Missing */); } function internIdentifier(text) { return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); @@ -3218,7 +2838,7 @@ var ts; function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { - var node = createNode(59 /* Identifier */); + var node = createNode(63 /* Identifier */); var text = escapeIdentifier(scanner.getTokenValue()); node.text = internIdentifier(text); nextToken(); @@ -3233,10 +2853,10 @@ var ts; return createIdentifier(isIdentifier()); } function parseIdentifierName() { - return createIdentifier(token >= 59 /* Identifier */); + return createIdentifier(token >= 63 /* Identifier */); } function isPropertyName() { - return token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; + return token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; } function parsePropertyName() { if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { @@ -3247,13 +2867,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function parseAnyContextualModifier() { return isModifier(token) && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function isListElement(kind, inErrorRecovery) { @@ -3265,28 +2885,28 @@ var ts; case 4 /* SwitchClauseStatements */: return isStatement(inErrorRecovery); case 3 /* SwitchClauses */: - return token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 5 /* TypeMembers */: - return isTypeMember(); + return isStartOfTypeMember(); case 6 /* ClassMembers */: return lookAhead(isClassMemberStart); case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: return isPropertyName(); case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 73 /* ExtendsKeyword */ && token !== 96 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + return isIdentifier() && ((token !== 77 /* ExtendsKeyword */ && token !== 100 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); case 9 /* VariableDeclarations */: case 14 /* TypeParameters */: return isIdentifier(); case 10 /* ArgumentExpressions */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 12 /* ArrayLiteralMembers */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 13 /* Parameters */: - return isParameter(); + return isStartOfParameter(); case 15 /* TypeArguments */: case 16 /* TupleElementTypes */: - return token === 18 /* CommaToken */ || isType(); + return token === 22 /* CommaToken */ || isStartOfType(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } @@ -3302,34 +2922,34 @@ var ts; case 6 /* ClassMembers */: case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: - return token === 10 /* CloseBraceToken */; + return token === 14 /* CloseBraceToken */; case 4 /* SwitchClauseStatements */: - return token === 10 /* CloseBraceToken */ || token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 14 /* CloseBraceToken */ || token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 8 /* BaseTypeReferences */: - return token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 14 /* TypeParameters */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */ || token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */ || token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 10 /* ArgumentExpressions */: - return token === 12 /* CloseParenToken */ || token === 17 /* SemicolonToken */; + return token === 16 /* CloseParenToken */ || token === 21 /* SemicolonToken */; case 12 /* ArrayLiteralMembers */: case 16 /* TupleElementTypes */: - return token === 14 /* CloseBracketToken */; + return token === 18 /* CloseBracketToken */; case 13 /* Parameters */: - return token === 12 /* CloseParenToken */ || token === 14 /* CloseBracketToken */ || token === 9 /* OpenBraceToken */; + return token === 16 /* CloseParenToken */ || token === 18 /* CloseBracketToken */ || token === 13 /* OpenBraceToken */; case 15 /* TypeArguments */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */; } } function isVariableDeclaratorListTerminator() { if (canParseSemicolon()) { return true; } - if (token === 80 /* InKeyword */) { + if (token === 84 /* InKeyword */) { return true; } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } return false; @@ -3390,7 +3010,7 @@ var ts; if (isListElement(kind, false)) { result.push(parseElement()); commaStart = scanner.getTokenPos(); - if (parseOptional(18 /* CommaToken */)) { + if (parseOptional(22 /* CommaToken */)) { continue; } commaStart = -1; @@ -3445,8 +3065,8 @@ var ts; } function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); - while (parseOptional(15 /* DotToken */)) { - var node = createNode(116 /* QualifiedName */, entity.pos); + while (parseOptional(19 /* DotToken */)) { + var node = createNode(121 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3458,6 +3078,35 @@ var ts; nextToken(); return finishNode(node); } + function parseTemplateExpression() { + var template = createNode(155 /* TemplateExpression */); + template.head = parseLiteralNode(); + ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); + var templateSpans = []; + templateSpans.pos = getNodePos(); + do { + templateSpans.push(parseTemplateSpan()); + } while (templateSpans[templateSpans.length - 1].literal.kind === 11 /* TemplateMiddle */); + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + return finishNode(template); + } + function parseTemplateSpan() { + var span = createNode(156 /* TemplateSpan */); + span.expression = parseExpression(false); + var literal; + if (token === 14 /* CloseBraceToken */) { + reScanTemplateToken(); + literal = parseLiteralNode(); + } + else { + error(ts.Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + span.literal = literal; + return finishNode(span); + } function parseLiteralNode(internName) { var node = createNode(token); var text = scanner.getTokenValue(); @@ -3476,30 +3125,31 @@ var ts; return node; } function parseStringLiteral() { - if (token === 7 /* StringLiteral */) + if (token === 7 /* StringLiteral */) { return parseLiteralNode(true); + } error(ts.Diagnostics.String_literal_expected); return createMissingNode(); } function parseTypeReference() { - var node = createNode(127 /* TypeReference */); + var node = createNode(132 /* TypeReference */); node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && token === 23 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(128 /* TypeQuery */); - parseExpected(91 /* TypeOfKeyword */); + var node = createNode(133 /* TypeQuery */); + parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(117 /* TypeParameter */); + var node = createNode(122 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(73 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { + if (parseOptional(77 /* ExtendsKeyword */)) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { @@ -3510,9 +3160,9 @@ var ts; return finishNode(node); } function parseTypeParameters() { - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); if (!result.length) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -3522,23 +3172,23 @@ var ts; } } function parseParameterType() { - return parseOptional(46 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; } - function isParameter() { - return token === 16 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + function isStartOfParameter() { + return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(118 /* Parameter */); + var node = createNode(123 /* Parameter */); node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(16 /* DotDotDotToken */)) { + if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 115 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 120 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } node.type = parseParameterType(); @@ -3546,11 +3196,11 @@ var ts; return finishNode(node); } function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 125 /* ConstructSignature */) { - parseExpected(82 /* NewKeyword */); + if (kind === 130 /* ConstructSignature */) { + parseExpected(86 /* NewKeyword */); } var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(11 /* OpenParenToken */, 12 /* CloseParenToken */); + var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); checkParameterList(parameters); var type; if (returnTokenRequired) { @@ -3617,10 +3267,10 @@ var ts; return finishNode(node); } function parseIndexSignatureMember() { - var node = createNode(126 /* IndexSignature */); + var node = createNode(131 /* IndexSignature */); var errorCountBeforeIndexSignature = file.syntacticErrors.length; var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); var indexerLength = scanner.getStartPos() - indexerStart; node.type = parseTypeAnnotation(); parseSemicolon(); @@ -3645,7 +3295,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); return; } - else if (parameter.flags & ts.NodeFlags.Modifier) { + else if (parameter.flags & 243 /* Modifier */) { grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); return; } @@ -3661,7 +3311,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); return; } - else if (parameter.type.kind !== 114 /* StringKeyword */ && parameter.type.kind !== 112 /* NumberKeyword */) { + else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); return; } @@ -3673,58 +3323,58 @@ var ts; function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 120 /* Method */; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node.kind = 125 /* Method */; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 119 /* Property */; + node.kind = 124 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); return finishNode(node); } - function isTypeMember() { + function isStartOfTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 17 /* OpenBracketToken */: return true; default: - return isPropertyName() && lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */ || token === 45 /* QuestionToken */ || token === 46 /* ColonToken */ || canParseSemicolon(); }); + return isPropertyName() && lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */ || token === 49 /* QuestionToken */ || token === 50 /* ColonToken */ || canParseSemicolon(); }); } } function parseTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseSignatureMember(124 /* CallSignature */, 46 /* ColonToken */); - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); + case 17 /* OpenBracketToken */: return parseIndexSignatureMember(); - case 82 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(125 /* ConstructSignature */, 46 /* ColonToken */); + case 86 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { + return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); } case 7 /* StringLiteral */: case 6 /* NumericLiteral */: return parsePropertyOrMethod(); default: - if (token >= 59 /* Identifier */) { + if (token >= 63 /* Identifier */) { return parsePropertyOrMethod(); } } } function parseTypeLiteral() { - var node = createNode(129 /* TypeLiteral */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(134 /* TypeLiteral */); + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -3732,26 +3382,26 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(131 /* TupleType */); + var node = createNode(136 /* TupleType */); var startTokenPos = scanner.getTokenPos(); var startErrorCount = file.syntacticErrors.length; - node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 17 /* OpenBracketToken */, 18 /* CloseBracketToken */); if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); } return finishNode(node); } function parseParenType() { - var node = createNode(133 /* ParenType */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(138 /* ParenType */); + parseExpected(15 /* OpenParenToken */); node.type = parseType(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseFunctionType(signatureKind) { - var node = createNode(129 /* TypeLiteral */); + var node = createNode(134 /* TypeLiteral */); var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); + var sig = parseSignature(signatureKind, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; @@ -3761,24 +3411,24 @@ var ts; } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 15 /* DotToken */ ? undefined : node; + return token === 19 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return parseTypeQuery(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseTypeLiteral(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseTupleType(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenType(); default: if (isIdentifier()) { @@ -3788,23 +3438,23 @@ var ts; error(ts.Diagnostics.Type_expected); return createMissingNode(); } - function isType() { + function isStartOfType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - case 91 /* TypeOfKeyword */: - case 9 /* OpenBraceToken */: - case 13 /* OpenBracketToken */: - case 19 /* LessThanToken */: - case 82 /* NewKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: + case 95 /* TypeOfKeyword */: + case 13 /* OpenBraceToken */: + case 17 /* OpenBracketToken */: + case 23 /* LessThanToken */: + case 86 /* NewKeyword */: return true; - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return lookAhead(function () { nextToken(); - return token === 12 /* CloseParenToken */ || isParameter() || isType(); + return token === 16 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); @@ -3812,9 +3462,9 @@ var ts; } function parsePrimaryType() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { - parseExpected(14 /* CloseBracketToken */); - var node = createNode(130 /* ArrayType */, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { + parseExpected(18 /* CloseBracketToken */); + var node = createNode(135 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -3822,33 +3472,33 @@ var ts; } function parseUnionType() { var type = parsePrimaryType(); - if (token === 39 /* BarToken */) { + if (token === 43 /* BarToken */) { var types = [type]; types.pos = type.pos; - while (parseOptional(39 /* BarToken */)) { + while (parseOptional(43 /* BarToken */)) { types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(132 /* UnionType */, type.pos); + var node = createNode(137 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } return type; } - function isFunctionType() { - return token === 19 /* LessThanToken */ || token === 11 /* OpenParenToken */ && lookAhead(function () { + function isStartOfFunctionType() { + return token === 23 /* LessThanToken */ || token === 15 /* OpenParenToken */ && lookAhead(function () { nextToken(); - if (token === 12 /* CloseParenToken */ || token === 16 /* DotDotDotToken */) { + if (token === 16 /* CloseParenToken */ || token === 20 /* DotDotDotToken */) { return true; } if (isIdentifier() || isModifier(token)) { nextToken(); - if (token === 46 /* ColonToken */ || token === 18 /* CommaToken */ || token === 45 /* QuestionToken */ || token === 47 /* EqualsToken */ || isIdentifier() || isModifier(token)) { + if (token === 50 /* ColonToken */ || token === 22 /* CommaToken */ || token === 49 /* QuestionToken */ || token === 51 /* EqualsToken */ || isIdentifier() || isModifier(token)) { return true; } - if (token === 12 /* CloseParenToken */) { + if (token === 16 /* CloseParenToken */) { nextToken(); - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } } @@ -3857,66 +3507,68 @@ var ts; }); } function parseType() { - if (isFunctionType()) { - return parseFunctionType(124 /* CallSignature */); + if (isStartOfFunctionType()) { + return parseFunctionType(129 /* CallSignature */); } - if (token === 82 /* NewKeyword */) { - return parseFunctionType(125 /* ConstructSignature */); + if (token === 86 /* NewKeyword */) { + return parseFunctionType(130 /* ConstructSignature */); } return parseUnionType(); } function parseTypeAnnotation() { - return parseOptional(46 /* ColonToken */) ? parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? parseType() : undefined; } - function isExpression() { + function isStartOfExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 11 /* OpenParenToken */: - case 13 /* OpenBracketToken */: - case 9 /* OpenBraceToken */: - case 77 /* FunctionKeyword */: - case 82 /* NewKeyword */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - case 19 /* LessThanToken */: - case 59 /* Identifier */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 15 /* OpenParenToken */: + case 17 /* OpenBracketToken */: + case 13 /* OpenBraceToken */: + case 81 /* FunctionKeyword */: + case 86 /* NewKeyword */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: + case 23 /* LessThanToken */: + case 63 /* Identifier */: return true; default: return isIdentifier(); } } - function isExpressionStatement() { - return token !== 9 /* OpenBraceToken */ && token !== 77 /* FunctionKeyword */ && isExpression(); + function isStartOfExpressionStatement() { + return token !== 13 /* OpenBraceToken */ && token !== 81 /* FunctionKeyword */ && isStartOfExpression(); } function parseExpression(noIn) { var expr = parseAssignmentExpression(noIn); - while (parseOptional(18 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 18 /* CommaToken */, parseAssignmentExpression(noIn)); + while (parseOptional(22 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 22 /* CommaToken */, parseAssignmentExpression(noIn)); } return expr; } function parseInitializer(inParameter, noIn) { - if (token !== 47 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 9 /* OpenBraceToken */) || !isExpression()) { + if (token !== 51 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 13 /* OpenBraceToken */) || !isStartOfExpression()) { return undefined; } } - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { @@ -3925,7 +3577,7 @@ var ts; return arrowExpression; } var expr = parseConditionalExpression(noIn); - if (expr.kind === 59 /* Identifier */ && token === 27 /* EqualsGreaterThanToken */) { + if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { @@ -3941,33 +3593,36 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 140 /* NewExpression */: - case 139 /* CallExpression */: - case 134 /* ArrayLiteral */: - case 142 /* ParenExpression */: - case 135 /* ObjectLiteral */: - case 143 /* FunctionExpression */: - case 59 /* Identifier */: - case 115 /* Missing */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 145 /* NewExpression */: + case 144 /* CallExpression */: + case 146 /* TaggedTemplateExpression */: + case 139 /* ArrayLiteral */: + case 148 /* ParenExpression */: + case 140 /* ObjectLiteral */: + case 149 /* FunctionExpression */: + case 63 /* Identifier */: + case 120 /* Missing */: case 8 /* RegularExpressionLiteral */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 74 /* FalseKeyword */: - case 83 /* NullKeyword */: - case 87 /* ThisKeyword */: - case 89 /* TrueKeyword */: - case 85 /* SuperKeyword */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 155 /* TemplateExpression */: + case 78 /* FalseKeyword */: + case 87 /* NullKeyword */: + case 91 /* ThisKeyword */: + case 93 /* TrueKeyword */: + case 89 /* SuperKeyword */: return true; } } return false; } function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(118 /* Parameter */, identifier.pos); + ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(31 /* EqualsGreaterThanToken */); + var parameter = createNode(123 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -3984,17 +3639,17 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (parseExpected(31 /* EqualsGreaterThanToken */) || token === 13 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { - parseExpected(27 /* EqualsGreaterThanToken */); + parseExpected(31 /* EqualsGreaterThanToken */); return parseArrowExpressionTail(pos, sig, false); } else { @@ -4002,35 +3657,35 @@ var ts; } } function isParenthesizedArrowFunctionExpression() { - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { return lookAhead(function () { var first = token; var second = nextToken(); - if (first === 11 /* OpenParenToken */) { - if (second === 12 /* CloseParenToken */) { + if (first === 15 /* OpenParenToken */) { + if (second === 16 /* CloseParenToken */) { var third = nextToken(); switch (third) { - case 27 /* EqualsGreaterThanToken */: - case 46 /* ColonToken */: - case 9 /* OpenBraceToken */: + case 31 /* EqualsGreaterThanToken */: + case 50 /* ColonToken */: + case 13 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; } } - if (second === 16 /* DotDotDotToken */) { + if (second === 20 /* DotDotDotToken */) { return 1 /* True */; } if (!isIdentifier()) { return 0 /* False */; } - if (nextToken() === 46 /* ColonToken */) { + if (nextToken() === 50 /* ColonToken */) { return 1 /* True */; } return 2 /* Unknown */; } else { - ts.Debug.assert(first === 19 /* LessThanToken */); + ts.Debug.assert(first === 23 /* LessThanToken */); if (!isIdentifier()) { return 0 /* False */; } @@ -4038,15 +3693,15 @@ var ts; } }); } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return 1 /* True */; } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (token === 31 /* EqualsGreaterThanToken */ || token === 13 /* OpenBraceToken */) { return sig; } return undefined; @@ -4054,27 +3709,27 @@ var ts; } function parseArrowExpressionTail(pos, sig, noIn) { var body; - if (token === 9 /* OpenBraceToken */) { + if (token === 13 /* OpenBraceToken */) { body = parseBody(false); } - else if (isStatement(true) && !isExpressionStatement() && token !== 77 /* FunctionKeyword */) { + else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { body = parseBody(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(144 /* ArrowFunction */, pos, undefined, sig, body); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, body); } function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); - while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(148 /* ConditionalExpression */, expr.pos); + while (parseOptional(49 /* QuestionToken */)) { + var node = createNode(154 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.whenFalse = parseAssignmentExpression(noIn); expr = finishNode(node); } @@ -4087,7 +3742,7 @@ var ts; while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 80 /* InKeyword */)) { + if (precedence && precedence > minPrecedence && (!noIn || token !== 84 /* InKeyword */)) { var operator = token; nextToken(); expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); @@ -4098,44 +3753,44 @@ var ts; } function getOperatorPrecedence() { switch (token) { - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return 1; - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return 2; - case 39 /* BarToken */: + case 43 /* BarToken */: return 3; - case 40 /* CaretToken */: + case 44 /* CaretToken */: return 4; - case 38 /* AmpersandToken */: + case 42 /* AmpersandToken */: return 5; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: return 6; - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: return 7; - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 28 /* PlusToken */: - case 29 /* MinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: return 9; - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: return 10; } return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(147 /* BinaryExpression */, left.pos); + var node = createNode(153 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4144,52 +3799,52 @@ var ts; function parseUnaryExpression() { var pos = getNodePos(); switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var operator = token; nextToken(); var operand = parseUnaryExpression(); if (isInStrictMode) { - if ((operator === 33 /* PlusPlusToken */ || operator === 34 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { + if ((operator === 37 /* PlusPlusToken */ || operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { reportInvalidUseInStrictMode(operand); } - else if (operator === 68 /* DeleteKeyword */ && operand.kind === 59 /* Identifier */) { + else if (operator === 72 /* DeleteKeyword */ && operand.kind === 63 /* Identifier */) { grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } } - return makeUnaryExpression(145 /* PrefixOperator */, pos, operator, operand); - case 19 /* LessThanToken */: + return makeUnaryExpression(151 /* PrefixOperator */, pos, operator, operand); + case 23 /* LessThanToken */: return parseTypeAssertion(); } var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 85 /* SuperKeyword */ && token !== 11 /* OpenParenToken */ && token !== 15 /* DotToken */; + var illegalUsageOfSuperKeyword = primaryExpression.kind === 89 /* SuperKeyword */ && token !== 15 /* OpenParenToken */ && token !== 19 /* DotToken */; if (illegalUsageOfSuperKeyword) { error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 33 /* PlusPlusToken */ || token === 34 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { reportInvalidUseInStrictMode(expr); } var operator = token; nextToken(); - expr = makeUnaryExpression(146 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(152 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(141 /* TypeAssertion */); - parseExpected(19 /* LessThanToken */); + var node = createNode(147 /* TypeAssertion */); + parseExpected(23 /* LessThanToken */); node.type = parseType(); - parseExpected(20 /* GreaterThanToken */); + parseExpected(24 /* GreaterThanToken */); node.operand = parseUnaryExpression(); return finishNode(node); } @@ -4201,11 +3856,11 @@ var ts; } function parseCallAndAccess(expr, inNewExpression) { while (true) { - var dotStart = scanner.getTokenPos(); - if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(137 /* PropertyAccess */, expr.pos); + var dotOrBracketStart = scanner.getTokenPos(); + if (parseOptional(19 /* DotToken */)) { + var propertyAccess = createNode(142 /* PropertyAccess */, expr.pos); if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { - grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.Identifier_expected); var id = createMissingNode(); } else { @@ -4216,13 +3871,12 @@ var ts; expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(138 /* IndexedAccess */, expr.pos); + if (parseOptional(17 /* OpenBracketToken */)) { + var indexedAccess = createNode(143 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; - if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { + if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); @@ -4230,79 +3884,92 @@ var ts; var literal = indexedAccess.index; literal.text = internIdentifier(literal.text); } - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); } expr = finishNode(indexedAccess); continue; } - if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(139 /* CallExpression */, expr.pos); + if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(144 /* CallExpression */, expr.pos); callExpr.func = expr; - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; } else { - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); } callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } + if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { + var tagExpression = createNode(146 /* TaggedTemplateExpression */, expr.pos); + tagExpression.tag = expr; + tagExpression.template = token === 9 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); + expr = finishNode(tagExpression); + if (languageVersion < 2 /* ES6 */) { + grammarErrorOnNode(expr, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + continue; + } return expr; } } function parseTypeArgumentsAndOpenParen() { var result = parseTypeArguments(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); return result; } function parseTypeArguments() { var typeArgumentListStart = scanner.getTokenPos(); var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); } return result; } function parseSingleTypeArgument() { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); - return createNode(115 /* Missing */); + return createNode(120 /* Missing */); } return parseType(); } function parsePrimaryExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return parseTokenNode(); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenExpression(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseArrayLiteral(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseObjectLiteral(); - case 77 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionExpression(); - case 82 /* NewKeyword */: + case 86 /* NewKeyword */: return parseNewExpression(); - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; + case 10 /* TemplateHead */: + return parseTemplateExpression(); default: if (isIdentifier()) { return parseIdentifier(); @@ -4312,20 +3979,20 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(142 /* ParenExpression */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(148 /* ParenExpression */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { if (omittedExpressionDiagnostic) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); } - return createNode(149 /* OmittedExpression */); + return createNode(157 /* OmittedExpression */); } return parseAssignmentExpression(); } @@ -4336,24 +4003,24 @@ var ts; return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); } function parseArrayLiteral() { - var node = createNode(134 /* ArrayLiteral */); - parseExpected(13 /* OpenBracketToken */); + var node = createNode(139 /* ArrayLiteral */); + parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(136 /* PropertyAssignment */); + var node = createNode(141 /* PropertyAssignment */); node.name = parsePropertyName(); - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); - node.initializer = makeFunctionExpression(143 /* FunctionExpression */, node.pos, undefined, sig, body); + node.initializer = makeFunctionExpression(149 /* FunctionExpression */, node.pos, undefined, sig, body); } else { - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } return finishNode(node); @@ -4361,41 +4028,41 @@ var ts; function parseObjectLiteralMember() { var initialPos = getNodePos(); var initialToken = token; - if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 122 /* GetAccessor */ : 123 /* SetAccessor */; + if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { + var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(135 /* ObjectLiteral */); - parseExpected(9 /* OpenBraceToken */); + var node = createNode(140 /* ObjectLiteral */); + parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; } node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); var seen = {}; var Property = 1; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; ts.forEach(node.properties, function (p) { - if (p.kind === 149 /* OmittedExpression */) { + if (p.kind === 157 /* OmittedExpression */) { return; } var currentKind; - if (p.kind === 136 /* PropertyAssignment */) { + if (p.kind === 141 /* PropertyAssignment */) { currentKind = Property; } - else if (p.kind === 122 /* GetAccessor */) { + else if (p.kind === 127 /* GetAccessor */) { currentKind = GetAccessor; } - else if (p.kind === 123 /* SetAccessor */) { + else if (p.kind === 128 /* SetAccessor */) { currentKind = SetAccesor; } else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); + ts.Debug.fail("Unexpected syntax kind:" + p.kind); } if (!ts.hasProperty(seen, p.name.text)) { seen[p.name.text] = currentKind; @@ -4424,14 +4091,14 @@ var ts; } function parseFunctionExpression() { var pos = getNodePos(); - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { reportInvalidUseInStrictMode(name); } - return makeFunctionExpression(143 /* FunctionExpression */, pos, name, sig, body); + return makeFunctionExpression(149 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4443,20 +4110,23 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(140 /* NewExpression */); - parseExpected(82 /* NewKeyword */); + var node = createNode(145 /* NewExpression */); + parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } return finishNode(node); } + function parseStatementAllowingLetDeclaration() { + return parseStatement(true); + } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(150 /* Block */); - if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(10 /* CloseBraceToken */); + var node = createNode(158 /* Block */); + if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -4476,7 +4146,7 @@ var ts; } labelledStatementInfo.pushFunctionBoundary(); var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 175 /* FunctionBlock */; + block.kind = 183 /* FunctionBlock */; labelledStatementInfo.pop(); inFunctionBody = saveInFunctionBody; inSwitchStatement = saveInSwitchStatement; @@ -4484,64 +4154,82 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(152 /* EmptyStatement */); - parseExpected(17 /* SemicolonToken */); + var node = createNode(160 /* EmptyStatement */); + parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(154 /* IfStatement */); - parseExpected(78 /* IfKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(162 /* IfStatement */); + parseExpected(82 /* IfKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement() : undefined; + parseExpected(16 /* CloseParenToken */); + node.thenStatement = parseStatement(false); + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement(false) : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(155 /* DoStatement */); - parseExpected(69 /* DoKeyword */); + var node = createNode(163 /* DoStatement */); + parseExpected(73 /* DoKeyword */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseOptional(17 /* SemicolonToken */); + parseExpected(16 /* CloseParenToken */); + parseOptional(21 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(156 /* WhileStatement */); - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(164 /* WhileStatement */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); + node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(node); } function parseForOrForInStatement() { var pos = getNodePos(); - parseExpected(76 /* ForKeyword */); - parseExpected(11 /* OpenParenToken */); - if (token !== 17 /* SemicolonToken */) { - if (parseOptional(92 /* VarKeyword */)) { + parseExpected(80 /* ForKeyword */); + parseExpected(15 /* OpenParenToken */); + if (token !== 21 /* SemicolonToken */) { + if (parseOptional(96 /* VarKeyword */)) { var declarations = parseVariableDeclarationList(0, true); if (!declarations.length) { error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } } + else if (parseOptional(102 /* LetKeyword */)) { + var declarations = parseVariableDeclarationList(2048 /* Let */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (parseOptional(68 /* ConstKeyword */)) { + var declarations = parseVariableDeclarationList(4096 /* Const */, true); + if (!declarations.length) { + error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + if (languageVersion < 2 /* ES6 */) { + grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } else { var varOrInit = parseExpression(true); } } var forOrForInStatement; - if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(158 /* ForInStatement */, pos); + if (parseOptional(84 /* InKeyword */)) { + var forInStatement = createNode(166 /* ForInStatement */, pos); if (declarations) { if (declarations.length > 1) { error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); @@ -4552,36 +4240,36 @@ var ts; forInStatement.variable = varOrInit; } forInStatement.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forInStatement; } else { - var forStatement = createNode(157 /* ForStatement */, pos); + var forStatement = createNode(165 /* ForStatement */, pos); if (declarations) forStatement.declarations = declarations; if (varOrInit) forStatement.initializer = varOrInit; - parseExpected(17 /* SemicolonToken */); - if (token !== 17 /* SemicolonToken */ && token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); } - parseExpected(17 /* SemicolonToken */); - if (token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 16 /* CloseParenToken */) { forStatement.iterator = parseExpression(); } - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(); + forOrForInStatement.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); + parseExpected(kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); if (!canParseSemicolon()) node.label = parseIdentifier(); parseSemicolon(); @@ -4597,7 +4285,7 @@ var ts; return node; } function checkBareBreakOrContinueStatement(node) { - if (node.kind === 160 /* BreakStatement */) { + if (node.kind === 168 /* BreakStatement */) { if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { return; } @@ -4606,7 +4294,7 @@ var ts; return; } } - else if (node.kind === 159 /* ContinueStatement */) { + else if (node.kind === 167 /* ContinueStatement */) { if (inIterationStatement === 1 /* Nested */) { return; } @@ -4622,7 +4310,7 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 159 /* ContinueStatement */, false); + var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 167 /* ContinueStatement */, false); if (nodeIsNestedInLabel === 1 /* Nested */) { return; } @@ -4630,10 +4318,10 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); return; } - if (node.kind === 159 /* ContinueStatement */) { + if (node.kind === 167 /* ContinueStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); } - else if (node.kind === 160 /* BreakStatement */) { + else if (node.kind === 168 /* BreakStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); } else { @@ -4641,11 +4329,11 @@ var ts; } } function parseReturnStatement() { - var node = createNode(161 /* ReturnStatement */); + var node = createNode(169 /* ReturnStatement */); var errorCountBeforeReturnStatement = file.syntacticErrors.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(84 /* ReturnKeyword */); + parseExpected(88 /* ReturnKeyword */); if (!canParseSemicolon()) node.expression = parseExpression(); parseSemicolon(); @@ -4655,14 +4343,14 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(162 /* WithStatement */); + var node = createNode(170 /* WithStatement */); var startPos = scanner.getTokenPos(); - parseExpected(95 /* WithKeyword */); + parseExpected(99 /* WithKeyword */); var endPos = scanner.getStartPos(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.statement = parseStatement(); + parseExpected(16 /* CloseParenToken */); + node.statement = parseStatement(false); node = finishNode(node); if (isInStrictMode) { grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); @@ -4670,36 +4358,36 @@ var ts; return node; } function parseCaseClause() { - var node = createNode(164 /* CaseClause */); - parseExpected(61 /* CaseKeyword */); + var node = createNode(172 /* CaseClause */); + parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + parseExpected(50 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseDefaultClause() { - var node = createNode(165 /* DefaultClause */); - parseExpected(67 /* DefaultKeyword */); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); + var node = createNode(173 /* DefaultClause */); + parseExpected(71 /* DefaultKeyword */); + parseExpected(50 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(163 /* SwitchStatement */); - parseExpected(86 /* SwitchKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(171 /* SwitchStatement */); + parseExpected(90 /* SwitchKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseExpected(9 /* OpenBraceToken */); + parseExpected(16 /* CloseParenToken */); + parseExpected(13 /* OpenBraceToken */); var saveInSwitchStatement = inSwitchStatement; inSwitchStatement = 1 /* Nested */; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); inSwitchStatement = saveInSwitchStatement; - parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 165 /* DefaultClause */; }); + parseExpected(14 /* CloseBraceToken */); + var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 173 /* DefaultClause */; }); for (var i = 1, n = defaultClauses.length; i < n; i++) { var clause = defaultClauses[i]; var start = ts.skipTrivia(file.text, clause.pos); @@ -4709,8 +4397,8 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(167 /* ThrowStatement */); - parseExpected(88 /* ThrowKeyword */); + var node = createNode(175 /* ThrowStatement */); + parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); } @@ -4719,13 +4407,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(168 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 169 /* TryBlock */); - if (token === 62 /* CatchKeyword */) { + var node = createNode(176 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 177 /* TryBlock */); + if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } - if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 171 /* FinallyBlock */); + if (token === 79 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 179 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4742,15 +4430,15 @@ var ts; } function parseCatchBlock() { var pos = getNodePos(); - parseExpected(62 /* CatchKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(66 /* CatchKeyword */); + parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); var typeAnnotationColonStart = scanner.getTokenPos(); var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 170 /* CatchBlock */; + result.kind = 178 /* CatchBlock */; result.pos = pos; result.variable = variable; if (typeAnnotation) { @@ -4762,130 +4450,134 @@ var ts; return result; } function parseDebuggerStatement() { - var node = createNode(172 /* DebuggerStatement */); - parseExpected(66 /* DebuggerKeyword */); + var node = createNode(180 /* DebuggerStatement */); + parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function isIterationStatementStart() { - return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; + return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } - function parseStatementWithLabelSet() { + function parseStatementWithLabelSet(allowLetAndConstDeclarations) { labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); + var statement = parseStatement(allowLetAndConstDeclarations); labelledStatementInfo.pop(); return statement; } function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); + return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } - function parseLabelledStatement() { - var node = createNode(166 /* LabeledStatement */); + function parseLabeledStatement(allowLetAndConstDeclarations) { + var node = createNode(174 /* LabeledStatement */); node.label = parseIdentifier(); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); } labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); + node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(153 /* ExpressionStatement */); + var node = createNode(161 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); } function isStatement(inErrorRecovery) { switch (token) { - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return !inErrorRecovery; - case 9 /* OpenBraceToken */: - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: - case 78 /* IfKeyword */: - case 69 /* DoKeyword */: - case 94 /* WhileKeyword */: - case 76 /* ForKeyword */: - case 65 /* ContinueKeyword */: - case 60 /* BreakKeyword */: - case 84 /* ReturnKeyword */: - case 95 /* WithKeyword */: - case 86 /* SwitchKeyword */: - case 88 /* ThrowKeyword */: - case 90 /* TryKeyword */: - case 66 /* DebuggerKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 13 /* OpenBraceToken */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 81 /* FunctionKeyword */: + case 82 /* IfKeyword */: + case 73 /* DoKeyword */: + case 98 /* WhileKeyword */: + case 80 /* ForKeyword */: + case 69 /* ContinueKeyword */: + case 64 /* BreakKeyword */: + case 88 /* ReturnKeyword */: + case 99 /* WithKeyword */: + case 90 /* SwitchKeyword */: + case 92 /* ThrowKeyword */: + case 94 /* TryKeyword */: + case 70 /* DebuggerKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return true; - case 97 /* InterfaceKeyword */: - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - if (isDeclaration()) { + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + return !isConstEnum; + case 101 /* InterfaceKeyword */: + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 119 /* TypeKeyword */: + if (isDeclarationStart()) { return false; } - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 59 /* Identifier */; })) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 63 /* Identifier */; })) { return false; } default: - return isExpression(); + return isStartOfExpression(); } } - function parseStatement() { + function parseStatement(allowLetAndConstDeclarations) { switch (token) { - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseBlock(false, false); - case 92 /* VarKeyword */: - return parseVariableStatement(); - case 77 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + return parseVariableStatement(allowLetAndConstDeclarations); + case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return parseEmptyStatement(); - case 78 /* IfKeyword */: + case 82 /* IfKeyword */: return parseIfStatement(); - case 69 /* DoKeyword */: + case 73 /* DoKeyword */: return parseDoStatement(); - case 94 /* WhileKeyword */: + case 98 /* WhileKeyword */: return parseWhileStatement(); - case 76 /* ForKeyword */: + case 80 /* ForKeyword */: return parseForOrForInStatement(); - case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(159 /* ContinueStatement */); - case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(160 /* BreakStatement */); - case 84 /* ReturnKeyword */: + case 69 /* ContinueKeyword */: + return parseBreakOrContinueStatement(167 /* ContinueStatement */); + case 64 /* BreakKeyword */: + return parseBreakOrContinueStatement(168 /* BreakStatement */); + case 88 /* ReturnKeyword */: return parseReturnStatement(); - case 95 /* WithKeyword */: + case 99 /* WithKeyword */: return parseWithStatement(); - case 86 /* SwitchKeyword */: + case 90 /* SwitchKeyword */: return parseSwitchStatement(); - case 88 /* ThrowKeyword */: + case 92 /* ThrowKeyword */: return parseThrowStatement(); - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return parseTryStatement(); - case 66 /* DebuggerKeyword */: + case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: if (isLabel()) { - return parseLabelledStatement(); + return parseLabeledStatement(allowLetAndConstDeclarations); } return parseExpressionStatement(); } } - function parseStatementOrFunction() { - return token === 77 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } function parseAndCheckFunctionBody(isConstructor) { var initialPosition = scanner.getTokenPos(); var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 9 /* OpenBraceToken */) { + if (token === 13 /* OpenBraceToken */) { var body = parseBody(false); if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; @@ -4900,7 +4592,7 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(173 /* VariableDeclaration */); + var node = createNode(181 /* VariableDeclaration */); node.flags = flags; var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); @@ -4911,6 +4603,9 @@ var ts; if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } + if (!inAmbientContext && !node.initializer && flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { reportInvalidUseInStrictMode(node.name); } @@ -4919,27 +4614,52 @@ var ts; function parseVariableDeclarationList(flags, noIn) { return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); } - function parseVariableStatement(pos, flags) { - var node = createNode(151 /* VariableStatement */, pos); + function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { + var node = createNode(159 /* VariableStatement */, pos); if (flags) node.flags = flags; var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(92 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); + if (token === 102 /* LetKeyword */) { + node.flags |= 2048 /* Let */; + } + else if (token === 68 /* ConstKeyword */) { + node.flags |= 4096 /* Const */; + } + else if (token !== 96 /* VarKeyword */) { + error(ts.Diagnostics.var_let_or_const_expected); + } + nextToken(); + node.declarations = parseVariableDeclarationList(node.flags, false); parseSemicolon(); finishNode(node); if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); } + if (languageVersion < 2 /* ES6 */) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + else if (!allowLetAndConstDeclarations) { + if (node.flags & 2048 /* Let */) { + grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } return node; } function parseFunctionDeclaration(pos, flags) { - var node = createNode(174 /* FunctionDeclaration */, pos); + var node = createNode(182 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -4950,10 +4670,10 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, flags) { - var node = createNode(121 /* Constructor */, pos); + var node = createNode(126 /* Constructor */, pos); node.flags = flags; - parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + parseExpected(111 /* ConstructorKeyword */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -4970,14 +4690,14 @@ var ts; var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; var name = parsePropertyName(); var questionStart = scanner.getTokenPos(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(120 /* Method */, pos); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var method = createNode(125 /* Method */, pos); method.flags = flags; method.name = name; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; @@ -4985,7 +4705,7 @@ var ts; return finishNode(method); } else { - var property = createNode(119 /* Property */, pos); + var property = createNode(124 /* Property */, pos); property.flags = flags; property.name = name; property.type = parseTypeAnnotation(); @@ -5012,10 +4732,10 @@ var ts; else if (accessor.typeParameters) { grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 122 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 123 /* SetAccessor */) { + else if (kind === 128 /* SetAccessor */) { if (accessor.type) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -5027,7 +4747,7 @@ var ts; if (parameter.flags & 8 /* Rest */) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); } - else if (parameter.flags & ts.NodeFlags.Modifier) { + else if (parameter.flags & 243 /* Modifier */) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } else if (parameter.flags & 4 /* QuestionMark */) { @@ -5045,7 +4765,7 @@ var ts; var node = createNode(kind, pos); node.flags = flags; node.name = parsePropertyName(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5068,19 +4788,19 @@ var ts; idToken = token; nextToken(); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { return true; } if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 113 /* SetKeyword */ || idToken === 109 /* GetKeyword */) { + if (!isKeyword(idToken) || idToken === 117 /* SetKeyword */ || idToken === 113 /* GetKeyword */) { return true; } switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 46 /* ColonToken */: - case 47 /* EqualsToken */: - case 45 /* QuestionToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 50 /* ColonToken */: + case 51 /* EqualsToken */: + case 49 /* QuestionToken */: return true; default: return canParseSemicolon(); @@ -5105,8 +4825,8 @@ var ts; break; var modifierLength = scanner.getStartPos() - modifierStart; switch (modifierToken) { - case 102 /* PublicKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 106 /* PublicKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5117,8 +4837,8 @@ var ts; } flags |= 16 /* Public */; break; - case 100 /* PrivateKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 104 /* PrivateKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5131,7 +4851,7 @@ var ts; lastPrivateModifierLength = modifierLength; flags |= 32 /* Private */; break; - case 101 /* ProtectedKeyword */: + case 105 /* ProtectedKeyword */: if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } @@ -5145,7 +4865,7 @@ var ts; lastProtectedModifierLength = modifierLength; flags |= 64 /* Protected */; break; - case 103 /* StaticKeyword */: + case 107 /* StaticKeyword */: if (flags & 128 /* Static */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -5159,7 +4879,7 @@ var ts; lastStaticModifierLength = modifierLength; flags |= 128 /* Static */; break; - case 72 /* ExportKeyword */: + case 76 /* ExportKeyword */: if (flags & 1 /* Export */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); } @@ -5174,7 +4894,7 @@ var ts; } flags |= 1 /* Export */; break; - case 108 /* DeclareKeyword */: + case 112 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -5193,26 +4913,26 @@ var ts; break; } } - if (token === 107 /* ConstructorKeyword */ && flags & 128 /* Static */) { + if (token === 111 /* ConstructorKeyword */ && flags & 128 /* Static */) { grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - else if (token === 107 /* ConstructorKeyword */ && flags & 32 /* Private */) { + else if (token === 111 /* ConstructorKeyword */ && flags & 32 /* Private */) { grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } - else if (token === 107 /* ConstructorKeyword */ && flags & 64 /* Protected */) { + else if (token === 111 /* ConstructorKeyword */ && flags & 64 /* Protected */) { grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); } - else if (token === 79 /* ImportKeyword */) { + else if (token === 83 /* ImportKeyword */) { if (flags & 2 /* Ambient */) { grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } } - else if (token === 97 /* InterfaceKeyword */) { + else if (token === 101 /* InterfaceKeyword */) { if (flags & 2 /* Ambient */) { grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } } - else if (token !== 72 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { + else if (token !== 76 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { var declarationStart = scanner.getTokenPos(); var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -5222,19 +4942,19 @@ var ts; function parseClassMemberDeclaration() { var pos = getNodePos(); var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(122 /* GetAccessor */, pos, flags); + if (parseContextualModifier(113 /* GetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(127 /* GetAccessor */, pos, flags); } - if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* SetAccessor */, pos, flags); + if (parseContextualModifier(117 /* SetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(128 /* SetAccessor */, pos, flags); } - if (token === 107 /* ConstructorKeyword */) { + if (token === 111 /* ConstructorKeyword */) { return parseConstructorDeclaration(pos, flags); } - if (token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { return parsePropertyMemberDeclaration(pos, flags); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { if (flags) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -5245,23 +4965,23 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(176 /* ClassDeclaration */, pos); + var node = createNode(184 /* ClassDeclaration */, pos); node.flags = flags; var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(63 /* ClassKeyword */); + parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(73 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; var implementsKeywordStart = scanner.getTokenPos(); var implementsKeywordLength; - if (parseOptional(96 /* ImplementsKeyword */)) { + if (parseOptional(100 /* ImplementsKeyword */)) { implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5272,15 +4992,15 @@ var ts; return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(177 /* InterfaceDeclaration */, pos); + var node = createNode(185 /* InterfaceDeclaration */, pos); node.flags = flags; var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(97 /* InterfaceKeyword */); + parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); var extendsKeywordStart = scanner.getTokenPos(); var extendsKeywordLength; - if (parseOptional(73 /* ExtendsKeyword */)) { + if (parseOptional(77 /* ExtendsKeyword */)) { extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } @@ -5291,14 +5011,25 @@ var ts; } return finishNode(node); } + function parseTypeAliasDeclaration(pos, flags) { + var node = createNode(186 /* TypeAliasDeclaration */, pos); + node.flags = flags; + parseExpected(119 /* TypeKeyword */); + node.name = parseIdentifier(); + parseExpected(51 /* EqualsToken */); + node.type = parseType(); + parseSemicolon(); + return finishNode(node); + } function parseAndCheckEnumDeclaration(pos, flags) { + var enumIsConst = flags & 4096 /* Const */; function isIntegerLiteral(expression) { function isInteger(literalExpression) { return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); } - if (expression.kind === 145 /* PrefixOperator */) { + if (expression.kind === 151 /* PrefixOperator */) { var unaryExpression = expression; - if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { expression = unaryExpression.operand; } } @@ -5309,30 +5040,35 @@ var ts; } var inConstantEnumMemberSection = true; function parseAndCheckEnumMember() { - var node = createNode(183 /* EnumMember */); + var node = createNode(192 /* EnumMember */); var errorCountBeforeEnumMember = file.syntacticErrors.length; node.name = parsePropertyName(); node.initializer = parseInitializer(false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + if (!enumIsConst) { + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); } return finishNode(node); } - var node = createNode(178 /* EnumDeclaration */, pos); + var node = createNode(187 /* EnumDeclaration */, pos); node.flags = flags; - parseExpected(71 /* EnumKeyword */); + if (enumIsConst) { + parseExpected(68 /* ConstKeyword */); + } + parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5340,10 +5076,10 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(180 /* ModuleBlock */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(189 /* ModuleBlock */); + if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -5351,19 +5087,19 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(15 /* DotToken */)) { + if (parseOptional(19 /* DotToken */)) { node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); } else { node.body = parseModuleBody(); ts.forEach(node.body.statements, function (s) { - if (s.kind === 182 /* ExportAssignment */) { + if (s.kind === 191 /* ExportAssignment */) { grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === 181 /* ImportDeclaration */ && s.externalModuleName) { + else if (s.kind === 190 /* ImportDeclaration */ && s.externalModuleName) { grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } }); @@ -5371,7 +5107,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(179 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); if (!inAmbientContext) { @@ -5387,19 +5123,19 @@ var ts; return finishNode(node); } function parseModuleDeclaration(pos, flags) { - parseExpected(110 /* ModuleKeyword */); + parseExpected(114 /* ModuleKeyword */); return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(181 /* ImportDeclaration */, pos); + var node = createNode(190 /* ImportDeclaration */, pos); node.flags = flags; - parseExpected(79 /* ImportKeyword */); + parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); var entityName = parseEntityName(false); - if (entityName.kind === 59 /* Identifier */ && entityName.text === "require" && parseOptional(11 /* OpenParenToken */)) { + if (entityName.kind === 63 /* Identifier */ && entityName.text === "require" && parseOptional(15 /* OpenParenToken */)) { node.externalModuleName = parseStringLiteral(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } else { node.entityName = entityName; @@ -5408,33 +5144,36 @@ var ts; return finishNode(node); } function parseExportAssignmentTail(pos) { - var node = createNode(182 /* ExportAssignment */, pos); + var node = createNode(191 /* ExportAssignment */, pos); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart() { switch (token) { - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + case 81 /* FunctionKeyword */: return true; - case 63 /* ClassKeyword */: - case 97 /* InterfaceKeyword */: - case 71 /* EnumKeyword */: - case 79 /* ImportKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); - case 110 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); - case 72 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 47 /* EqualsToken */ || isDeclaration(); }); - case 108 /* DeclareKeyword */: - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: + case 67 /* ClassKeyword */: + case 101 /* InterfaceKeyword */: + case 75 /* EnumKeyword */: + case 83 /* ImportKeyword */: + case 119 /* TypeKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */; }); + case 114 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */ || token === 7 /* StringLiteral */; }); + case 76 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 51 /* EqualsToken */ || isDeclarationStart(); }); + case 112 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: return lookAhead(function () { nextToken(); - return isDeclaration(); + return isDeclarationStart(); }); } } @@ -5442,10 +5181,10 @@ var ts; var pos = getNodePos(); var errorCountBeforeModifiers = file.syntacticErrors.length; var flags = parseAndCheckModifiers(modifierContext); - if (token === 72 /* ExportKeyword */) { + if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); - if (parseOptional(47 /* EqualsToken */)) { + if (parseOptional(51 /* EqualsToken */)) { var exportAssignmentTail = parseExportAssignmentTail(pos); if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { var modifiersStart = ts.skipTrivia(sourceText, pos); @@ -5460,25 +5199,38 @@ var ts; } var result; switch (token) { - case 92 /* VarKeyword */: - result = parseVariableStatement(pos, flags); + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + result = parseVariableStatement(true, pos, flags); break; - case 77 /* FunctionKeyword */: + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); + } + else { + result = parseVariableStatement(true, pos, flags); + } + break; + case 81 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); break; - case 63 /* ClassKeyword */: + case 67 /* ClassKeyword */: result = parseClassDeclaration(pos, flags); break; - case 97 /* InterfaceKeyword */: + case 101 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; - case 71 /* EnumKeyword */: + case 119 /* TypeKeyword */: + result = parseTypeAliasDeclaration(pos, flags); + break; + case 75 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; - case 110 /* ModuleKeyword */: + case 114 /* ModuleKeyword */: result = parseModuleDeclaration(pos, flags); break; - case 79 /* ImportKeyword */: + case 83 /* ImportKeyword */: result = parseImportDeclaration(pos, flags); break; default: @@ -5488,7 +5240,7 @@ var ts; return result; } function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { return parseSourceElementOrModuleElement(0 /* SourceElements */); @@ -5497,13 +5249,13 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { + if (isDeclarationStart()) { return parseDeclaration(modifierContext); } var statementStart = scanner.getTokenPos(); var statementFirstTokenLength = scanner.getTextPos() - statementStart; var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); + var statement = parseStatement(true); if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } @@ -5555,7 +5307,7 @@ var ts; }; } function getExternalModuleIndicator() { - return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 181 /* ImportDeclaration */ && node.externalModuleName || node.kind === 182 /* ExportAssignment */ ? node : undefined; }); + return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 190 /* ImportDeclaration */ && node.externalModuleName || node.kind === 191 /* ExportAssignment */ ? node : undefined; }); } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; @@ -5563,7 +5315,7 @@ var ts; rootNodeFlags = 1024 /* DeclarationFile */; inAmbientContext = true; } - file = createRootNode(184 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(193 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; @@ -5696,7 +5448,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5714,9 +5466,9 @@ var ts; } } } - else if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 181 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5788,33 +5540,50 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isInstantiated(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { - return false; + function getModuleInstanceState(node) { + if (node.kind === 185 /* InterfaceDeclaration */) { + return 0 /* NonInstantiated */; } - else if (node.kind === 181 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; + else if (node.kind === 187 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; } - else if (node.kind === 180 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; + else if (node.kind === 190 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 179 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; + else if (node.kind === 189 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + return false; + case 2 /* ConstEnumOnly */: + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 188 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); } else { - return true; + return 1 /* Instantiated */; } } - ts.isInstantiated = isInstantiated; + ts.getModuleInstanceState = getModuleInstanceState; function bindSourceFile(file) { var parent; var container; + var blockScopeContainer; var lastContainer; var symbolCount = 0; var Symbol = ts.objectAllocator.getSymbolConstructor(); if (!file.locals) { file.locals = {}; - container = file; + container = blockScopeContainer = file; bind(file); file.symbolCount = symbolCount; } @@ -5827,30 +5596,26 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 179 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 121 /* Constructor */: - return "__constructor"; - case 124 /* CallSignature */: - return "__call"; - case 125 /* ConstructSignature */: - return "__new"; - case 126 /* IndexSignature */: - return "__index"; + case 126 /* Constructor */: return "__constructor"; + case 129 /* CallSignature */: return "__call"; + case 130 /* ConstructSignature */: return "__new"; + case 131 /* IndexSignature */: return "__index"; } } function getDisplayName(node) { @@ -5864,10 +5629,11 @@ var ts; if (node.name) { node.name.parent = node; } + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(declaration))); + file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); + file.semanticErrors.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -5876,8 +5642,8 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 176 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); + if (node.kind === 184 /* ClassDeclaration */ && symbol.exports) { + var prototypeSymbol = createSymbol(4 /* Property */ | 536870912 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; @@ -5899,16 +5665,16 @@ var ts; } function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; + if (symbolKind & 107455 /* Value */) { + exportKind |= 4194304 /* ExportValue */; } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; + if (symbolKind & 3152352 /* Type */) { + exportKind |= 8388608 /* ExportType */; } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; + if (symbolKind & 1536 /* Namespace */) { + exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 181 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 190 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -5922,14 +5688,15 @@ var ts; declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); } } - function bindChildren(node, symbolKind) { - if (symbolKind & ts.SymbolFlags.HasLocals) { + function bindChildren(node, symbolKind, isBlockScopeContainer) { + if (symbolKind & 1041936 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; + var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { + if (symbolKind & 1048560 /* IsContainer */) { container = node; if (lastContainer !== container && !container.nextContainer) { if (lastContainer) { @@ -5938,156 +5705,211 @@ var ts; lastContainer = container; } } + if (isBlockScopeContainer) { + blockScopeContainer = node; + } ts.forEachChild(node, bind); container = saveContainer; parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; } - function bindDeclaration(node, symbolKind, symbolExcludes) { + function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 129 /* TypeLiteral */: - case 135 /* ObjectLiteral */: - case 177 /* InterfaceDeclaration */: + case 134 /* TypeLiteral */: + case 140 /* ObjectLiteral */: + case 185 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); + bindDeclaration(node, 16384 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + bindDeclaration(p, 4 /* Property */, 107455 /* PropertyExcludes */, false); } }); } function bindModuleDeclaration(node) { if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + } + else { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + if (state === 2 /* ConstEnumOnly */) { + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + node.symbol.constEnumOnlyModule = false; + } + } } } - function bindAnonymousDeclaration(node, symbolKind, name) { + function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); + bindChildren(node, symbolKind, isBlockScopeContainer); } function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); + var symbol = createSymbol(1 /* FunctionScopedVariable */, node.variable.text || "__missing"); + addDeclarationToSymbol(symbol, node, 1 /* FunctionScopedVariable */); var saveParent = parent; - parent = node; + var savedBlockScopeContainer = blockScopeContainer; + parent = blockScopeContainer = node; ts.forEachChild(node, bind); parent = saveParent; + blockScopeContainer = savedBlockScopeContainer; + } + function bindBlockScopedVariableDeclaration(node) { + switch (blockScopeContainer.kind) { + case 188 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + case 193 /* SourceFile */: + if (ts.isExternalModule(container)) { + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = {}; + } + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + } + bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 117 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); + case 122 /* TypeParameter */: + bindDeclaration(node, 1048576 /* TypeParameter */, 2103776 /* TypeParameterExcludes */, false); break; - case 118 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); + case 123 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 173 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); + case 181 /* VariableDeclaration */: + if (node.flags & 6144 /* BlockScoped */) { + bindBlockScopedVariableDeclaration(node); + } + else { + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); + } break; - case 119 /* Property */: - case 136 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); + case 124 /* Property */: + case 141 /* PropertyAssignment */: + bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 183 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); + case 192 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 124 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); + case 129 /* CallSignature */: + bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 120 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); break; - case 125 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); + case 130 /* ConstructSignature */: + bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; - case 126 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); + case 131 /* IndexSignature */: + bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 174 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); + case 182 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 121 /* Constructor */: + case 126 /* Constructor */: bindConstructorDeclaration(node); break; - case 122 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); + case 127 /* GetAccessor */: + bindDeclaration(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 123 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); + case 128 /* SetAccessor */: + bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 129 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); + case 134 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 135 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); + case 140 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 176 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); + case 184 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 177 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); + case 185 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 178 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); + case 186 /* TypeAliasDeclaration */: + bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 179 /* ModuleDeclaration */: + case 187 /* EnumDeclaration */: + if (ts.isConstEnumDeclaration(node)) { + bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); + } + else { + bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); + } + break; + case 188 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 181 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); + case 190 /* ImportDeclaration */: + bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"'); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 171 /* SwitchStatement */: + bindChildren(node, 0, true); + break; default: var saveParent = parent; parent = node; @@ -6148,7 +5970,7 @@ var ts; } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } }); @@ -6158,14 +5980,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { + if ((member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 122 /* GetAccessor */ && !getAccessor) { + if (member.kind === 127 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 123 /* SetAccessor */ && !setAccessor) { + if (member.kind === 128 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6488,7 +6310,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 143 /* FunctionExpression */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */ || node.kind === 179 /* ModuleDeclaration */ || node.kind === 176 /* ClassDeclaration */ || node.kind === 178 /* EnumDeclaration */) { + else if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 149 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6570,7 +6392,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 184 /* SourceFile */) { + if (node.kind != 193 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6657,13 +6479,76 @@ var ts; } } function emitLiteral(node) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === 7 /* StringLiteral */ && compilerOptions.sourceMap) { + var text = getLiteralText(); + if (compilerOptions.sourceMap && (node.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + function getLiteralText() { + if (compilerOptions.target < 2 /* ES6 */ && ts.isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node); + } + return getSourceTextOfLocalNode(node); + } + } + function getTemplateLiteralAsStringLiteral(node) { + return '"' + ts.escapeString(node.text) + '"'; + } + function emitTemplateExpression(node) { + if (compilerOptions.target >= 2 /* ES6 */) { + ts.forEachChild(node, emit); + return; + } + ts.Debug.assert(node.parent.kind !== 146 /* TaggedTemplateExpression */); + var templateNeedsParens = ts.isExpression(node.parent) && node.parent.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(node.parent) !== -1 /* LessThan */; + if (templateNeedsParens) { + write("("); + } + emitLiteral(node.head); + ts.forEach(node.templateSpans, function (templateSpan) { + var needsParens = templateSpan.expression.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + write(" + "); + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + if (templateSpan.literal.text.length !== 0) { + write(" + "); + emitLiteral(templateSpan.literal); + } + }); + if (templateNeedsParens) { + write(")"); + } + function comparePrecedenceToBinaryPlus(expression) { + ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); + switch (expression.kind) { + case 153 /* BinaryExpression */: + switch (expression.operator) { + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + return 1 /* GreaterThan */; + case 32 /* PlusToken */: + return 0 /* EqualTo */; + default: + return -1 /* LessThan */; + } + case 154 /* ConditionalExpression */: + return -1 /* LessThan */; + default: + return 1 /* GreaterThan */; + } + } + } + function emitTemplateSpan(span) { + emit(span.expression); + emit(span.literal); } function emitQuotedIdentifier(node) { if (node.kind === 7 /* StringLiteral */) { @@ -6683,29 +6568,29 @@ var ts; function isNonExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* FunctionDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return parent.name === node; - case 160 /* BreakStatement */: - case 159 /* ContinueStatement */: - case 182 /* ExportAssignment */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 191 /* ExportAssignment */: return false; - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return node.parent.label === node; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: return node.parent.variable === node; } } @@ -6779,18 +6664,27 @@ var ts; emit(node.initializer); emitTrailingComments(node); } - function emitPropertyAccess(node) { + function tryEmitConstantValue(node) { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + ts.identifierToString(node.right) + " */"); + var propertyName = node.kind === 142 /* PropertyAccess */ ? ts.identifierToString(node.right) : ts.getTextOfNode(node.index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; } - else { - emit(node.left); - write("."); - emit(node.right); + return false; + } + function emitPropertyAccess(node) { + if (tryEmitConstantValue(node)) { + return; } + emit(node.left); + write("."); + emit(node.right); } function emitIndexedAccess(node) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -6798,13 +6692,13 @@ var ts; } function emitCallExpression(node) { var superCall = false; - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { write("_super"); superCall = true; } else { emit(node.func); - superCall = node.func.kind === 137 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; + superCall = node.func.kind === 142 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -6830,13 +6724,19 @@ var ts; write(")"); } } + function emitTaggedTemplateExpression(node) { + ts.Debug.assert(compilerOptions.target >= 2 /* ES6 */, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } function emitParenExpression(node) { - if (node.expression.kind === 141 /* TypeAssertion */) { + if (node.expression.kind === 147 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 141 /* TypeAssertion */) { + while (operand.kind == 147 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 145 /* PrefixOperator */ && operand.kind !== 146 /* PostfixOperator */ && operand.kind !== 140 /* NewExpression */ && !(operand.kind === 139 /* CallExpression */ && node.parent.kind === 140 /* NewExpression */) && !(operand.kind === 143 /* FunctionExpression */ && node.parent.kind === 139 /* CallExpression */)) { + if (operand.kind !== 151 /* PrefixOperator */ && operand.kind !== 152 /* PostfixOperator */ && operand.kind !== 145 /* NewExpression */ && !(operand.kind === 144 /* CallExpression */ && node.parent.kind === 145 /* NewExpression */) && !(operand.kind === 149 /* FunctionExpression */ && node.parent.kind === 144 /* CallExpression */)) { emit(operand); return; } @@ -6846,29 +6746,29 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 145 /* PrefixOperator */) { + if (node.kind === 151 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } - if (node.operator >= 59 /* Identifier */) { + if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 145 /* PrefixOperator */ && node.operand.kind === 145 /* PrefixOperator */) { + else if (node.kind === 151 /* PrefixOperator */ && node.operand.kind === 151 /* PrefixOperator */) { var operand = node.operand; - if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { + if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 29 /* MinusToken */ && (operand.operator === 29 /* MinusToken */ || operand.operator === 34 /* MinusMinusToken */)) { + else if (node.operator === 33 /* MinusToken */ && (operand.operator === 33 /* MinusToken */ || operand.operator === 38 /* MinusMinusToken */)) { write(" "); } } emit(node.operand); - if (node.kind === 146 /* PostfixOperator */) { + if (node.kind === 152 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } function emitBinaryExpression(node) { emit(node.left); - if (node.operator !== 18 /* CommaToken */) + if (node.operator !== 22 /* CommaToken */) write(" "); write(ts.tokenToString(node.operator)); write(" "); @@ -6882,21 +6782,21 @@ var ts; emit(node.whenFalse); } function emitBlock(node) { - emitToken(9 /* OpenBraceToken */, node.pos); + emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 180 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 179 /* ModuleDeclaration */); + if (node.kind === 189 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 188 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.statements.end); + emitToken(14 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 150 /* Block */) { + if (node.kind === 158 /* Block */) { write(" "); emit(node); } @@ -6908,7 +6808,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 144 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 150 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -6920,16 +6820,16 @@ var ts; } function emitIfStatement(node) { emitLeadingComments(node); - var endPos = emitToken(78 /* IfKeyword */, node.pos); + var endPos = emitToken(82 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 154 /* IfStatement */) { + emitToken(74 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 162 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -6942,7 +6842,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 150 /* Block */) { + if (node.statement.kind === 158 /* Block */) { write(" "); } else { @@ -6959,11 +6859,19 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declarations) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { + emitToken(68 /* ConstKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } write(" "); emitCommaList(node.declarations, false); } @@ -6978,11 +6886,16 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declaration) { - emitToken(92 /* VarKeyword */, endPos); + if (node.declaration.flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } write(" "); emit(node.declaration); } @@ -6991,17 +6904,17 @@ var ts; } write(" in "); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 160 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { emitLeadingComments(node); - emitToken(84 /* ReturnKeyword */, node.pos); + emitToken(88 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); emitTrailingComments(node); @@ -7013,21 +6926,24 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(86 /* SwitchKeyword */, node.pos); + var endPos = emitToken(90 /* SwitchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(12 /* CloseParenToken */, node.expression.end); + endPos = emitToken(16 /* CloseParenToken */, node.expression.end); write(" "); - emitToken(9 /* OpenBraceToken */, endPos); + emitToken(13 /* OpenBraceToken */, endPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.clauses.end); + emitToken(14 /* CloseBraceToken */, node.clauses.end); + } + function isOnSameLine(node1, node2) { + return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 164 /* CaseClause */) { + if (node.kind === 172 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7035,9 +6951,15 @@ var ts; else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node) { write("throw "); @@ -7056,16 +6978,16 @@ var ts; } function emitCatchBlock(node) { writeLine(); - var endPos = emitToken(62 /* CatchKeyword */, node.pos); + var endPos = emitToken(66 /* CatchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.variable); - emitToken(12 /* CloseParenToken */, node.variable.end); + emitToken(16 /* CloseParenToken */, node.variable.end); write(" "); emitBlock(node); } function emitDebuggerStatement(node) { - emitToken(66 /* DebuggerKeyword */, node.pos); + emitToken(70 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -7076,7 +6998,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 179 /* ModuleDeclaration */); + } while (node && node.kind !== 188 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7097,8 +7019,17 @@ var ts; } function emitVariableStatement(node) { emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); + if (!(node.flags & 1 /* Export */)) { + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } + } emitCommaList(node.declarations, false); write(";"); emitTrailingComments(node); @@ -7166,7 +7097,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 122 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 127 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -7175,15 +7106,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 120 /* Method */) { + if (node.kind !== 125 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 174 /* FunctionDeclaration */ || (node.kind === 143 /* FunctionExpression */ && node.name)) { + if (node.kind === 182 /* FunctionDeclaration */ || (node.kind === 149 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 120 /* Method */) { + if (node.kind !== 125 /* Method */) { emitTrailingComments(node); } } @@ -7209,16 +7140,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 175 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 183 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 175 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 183 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7231,7 +7162,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7243,10 +7174,10 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); - emitToken(10 /* CloseBraceToken */, node.body.statements.end); + emitToken(14 /* CloseBraceToken */, node.body.statements.end); } else { decreaseIndent(); @@ -7269,11 +7200,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 153 /* ExpressionStatement */) { + if (statement && statement.kind === 161 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 139 /* CallExpression */) { + if (expr && expr.kind === 144 /* CallExpression */) { var func = expr.func; - if (func && func.kind === 85 /* SuperKeyword */) { + if (func && func.kind === 89 /* SuperKeyword */) { return statement; } } @@ -7282,7 +7213,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -7309,7 +7240,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 119 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 124 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7332,7 +7263,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Method */) { + if (member.kind === 125 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7354,7 +7285,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) { + else if (member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7432,11 +7363,11 @@ var ts; write("return "); emitNode(node.name); } - emitToken(10 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + emitToken(14 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); write(";"); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -7457,7 +7388,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && !member.body) { + if (member.kind === 126 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7508,7 +7439,7 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(10 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + emitToken(14 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { @@ -7520,6 +7451,10 @@ var ts; emitPinnedOrTripleSlashComments(node); } function emitEnumDeclaration(node) { + var isConstEnum = ts.isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & 1 /* Export */)) { emitStart(node); @@ -7537,10 +7472,10 @@ var ts; write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -7559,7 +7494,7 @@ var ts; write(";"); } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum) { ts.forEach(node.members, function (member) { writeLine(); emitLeadingComments(member); @@ -7570,7 +7505,7 @@ var ts; write("["); emitQuotedIdentifier(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { @@ -7585,13 +7520,13 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 179 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -7607,7 +7542,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 180 /* ModuleBlock */) { + if (node.body.kind === 189 /* ModuleBlock */) { emit(node.body); } else { @@ -7620,7 +7555,7 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(10 /* CloseBraceToken */, moduleBlock.statements.end); + emitToken(14 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); @@ -7638,10 +7573,10 @@ var ts; function emitImportDeclaration(node) { var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 184 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 193 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7670,7 +7605,7 @@ var ts; emitStart(node.externalModuleName); emitLiteral(node.externalModuleName); emitEnd(node.externalModuleName); - emitToken(12 /* CloseParenToken */, node.externalModuleName.end); + emitToken(16 /* CloseParenToken */, node.externalModuleName.end); } write(";"); emitEnd(node); @@ -7681,7 +7616,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 181 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 190 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7689,7 +7624,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { return node; } }); @@ -7805,117 +7740,127 @@ var ts; return emitPinnedOrTripleSlashComments(node); } switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return emitIdentifier(node); - case 118 /* Parameter */: + case 123 /* Parameter */: return emitParameter(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessor(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return emitThis(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return emitSuper(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return write("null"); - case 89 /* TrueKeyword */: + case 93 /* TrueKeyword */: return write("true"); - case 74 /* FalseKeyword */: + case 78 /* FalseKeyword */: return write("false"); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: case 8 /* RegularExpressionLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + case 12 /* TemplateTail */: return emitLiteral(node); - case 116 /* QualifiedName */: + case 155 /* TemplateExpression */: + return emitTemplateExpression(node); + case 156 /* TemplateSpan */: + return emitTemplateSpan(node); + case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return emitArrayLiteral(node); - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return emitObjectLiteral(node); - case 136 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 137 /* PropertyAccess */: + case 142 /* PropertyAccess */: return emitPropertyAccess(node); - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return emitIndexedAccess(node); - case 139 /* CallExpression */: + case 144 /* CallExpression */: return emitCallExpression(node); - case 140 /* NewExpression */: + case 145 /* NewExpression */: return emitNewExpression(node); - case 141 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return emit(node.operand); - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return emitParenExpression(node); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return emitUnaryExpression(node); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return emitBinaryExpression(node); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return emitConditionalExpression(node); - case 149 /* OmittedExpression */: + case 157 /* OmittedExpression */: return; - case 150 /* Block */: - case 169 /* TryBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return emitBlock(node); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 152 /* EmptyStatement */: + case 160 /* EmptyStatement */: return write(";"); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return emitExpressionStatement(node); - case 154 /* IfStatement */: + case 162 /* IfStatement */: return emitIfStatement(node); - case 155 /* DoStatement */: + case 163 /* DoStatement */: return emitDoStatement(node); - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return emitWhileStatement(node); - case 157 /* ForStatement */: + case 165 /* ForStatement */: return emitForStatement(node); - case 158 /* ForInStatement */: + case 166 /* ForInStatement */: return emitForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return emitReturnStatement(node); - case 162 /* WithStatement */: + case 170 /* WithStatement */: return emitWithStatement(node); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return emitSwitchStatement(node); - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return emitLabelledStatement(node); - case 167 /* ThrowStatement */: + case 175 /* ThrowStatement */: return emitThrowStatement(node); - case 168 /* TryStatement */: + case 176 /* TryStatement */: return emitTryStatement(node); - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: return emitCatchBlock(node); - case 172 /* DebuggerStatement */: + case 180 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 184 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -7933,7 +7878,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 193 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -7950,7 +7895,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 184 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 193 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8142,7 +8087,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 177 /* InterfaceDeclaration */) { + if (node.kind !== 185 /* InterfaceDeclaration */) { write("declare "); } } @@ -8198,7 +8143,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 180 /* ModuleBlock */) { + while (node.body.kind !== 189 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8215,10 +8160,34 @@ var ts; enclosingDeclaration = prevEnclosingDeclaration; } } + function emitTypeAliasDeclaration(node) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } function emitEnumDeclaration(node) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (ts.isConstEnumDeclaration(node)) { + write("const "); + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -8246,34 +8215,34 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 125 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8285,7 +8254,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 120 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 125 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8307,7 +8276,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 176 /* ClassDeclaration */) { + if (node.parent.kind === 184 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8335,7 +8304,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -8392,9 +8361,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 173 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 181 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 119 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8405,14 +8374,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 173 /* VariableDeclaration */) { + if (node.kind === 181 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 119 /* Property */) { + else if (node.kind === 124 /* Property */) { if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8431,7 +8400,15 @@ var ts; if (hasDeclarationWithEmit) { emitJsDocComments(node); emitDeclarationFlags(node); - write("var "); + if (node.flags & 2048 /* Let */) { + write("let "); + } + else if (node.flags & 4096 /* Const */) { + write("const "); + } + else { + write("var "); + } emitCommaList(node.declarations, emitVariableDeclaration); write(";"); writeLine(); @@ -8454,7 +8431,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 123 /* SetAccessor */) { + if (node.kind === 128 /* SetAccessor */) { if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } @@ -8483,14 +8460,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 174 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 182 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 174 /* FunctionDeclaration */) { + if (node.kind === 182 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 121 /* Constructor */) { + else if (node.kind === 126 /* Constructor */) { write("constructor"); } else { @@ -8508,24 +8485,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 124 /* CallSignature */ || node.kind === 126 /* IndexSignature */) { + if (node.kind === 129 /* CallSignature */ || node.kind === 131 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 126 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 121 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 126 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8535,31 +8512,31 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 126 /* IndexSignature */: + case 131 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 120 /* Method */: + case 125 /* Method */: if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("This is unknown kind for signature: " + node.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8586,31 +8563,31 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 121 /* Constructor */: + case 126 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 120 /* Method */: + case 125 /* Method */: if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 176 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8621,37 +8598,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 121 /* Constructor */: - case 174 /* FunctionDeclaration */: - case 120 /* Method */: + case 126 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: return emitFunctionDeclaration(node); - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 124 /* CallSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: return emitSignatureDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 119 /* Property */: + case 124 /* Property */: return emitPropertyDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 183 /* EnumMember */: + case 186 /* TypeAliasDeclaration */: + return emitTypeAliasDeclaration(node); + case 192 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 182 /* ExportAssignment */: + case 191 /* ExportAssignment */: return emitExportAssignment(node); - case 184 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -8713,10 +8692,13 @@ var ts; } } var hasSemanticErrors = resolver.hasSemanticErrors(); + var hasEarlyErrors = resolver.hasEarlyErrors(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (!hasSemanticErrors && compilerOptions.declaration) { - emitDeclarations(jsFilePath, sourceFile); + if (!hasEarlyErrors) { + emitJavaScript(jsFilePath, sourceFile); + if (!hasSemanticErrors && compilerOptions.declaration) { + emitDeclarations(jsFilePath, sourceFile); + } } } if (targetSourceFile === undefined) { @@ -8743,7 +8725,10 @@ var ts; diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); var returnCode; - if (hasEmitterError) { + if (hasEarlyErrors) { + returnCode = 1 /* AllOutputGenerationSkipped */; + } + else if (hasEmitterError) { returnCode = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { @@ -8826,6 +8811,7 @@ var ts; emitFiles: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getTypeOfSymbol: getTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -8848,12 +8834,13 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; } + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + hasEarlyErrors: hasEarlyErrors }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(268435456 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -8866,6 +8853,7 @@ var ts; var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); var globals = {}; @@ -8900,32 +8888,38 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; + if (flags & 2 /* BlockScopedVariable */) + result |= 107455 /* BlockScopedVariableExcludes */; + if (flags & 1 /* FunctionScopedVariable */) + result |= 107454 /* FunctionScopedVariableExcludes */; + if (flags & 4 /* Property */) + result |= 107455 /* PropertyExcludes */; + if (flags & 8 /* EnumMember */) + result |= 107455 /* EnumMemberExcludes */; + if (flags & 16 /* Function */) + result |= 106927 /* FunctionExcludes */; + if (flags & 32 /* Class */) + result |= 3258879 /* ClassExcludes */; + if (flags & 64 /* Interface */) + result |= 3152288 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 3258623 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 3259263 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 1048576 /* TypeParameter */) + result |= 2103776 /* TypeParameterExcludes */; + if (flags & 2097152 /* TypeAlias */) + result |= 3152352 /* TypeAliasExcludes */; + if (flags & 33554432 /* Import */) + result |= 33554432 /* ImportExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -8934,11 +8928,13 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) @@ -8948,6 +8944,9 @@ var ts; } function extendSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; @@ -8967,8 +8966,12 @@ var ts; recordMergedSymbol(target, source); } else { + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); + error(node.name ? node.name : node, message, symbolToString(source)); + }); + ts.forEach(target.declarations, function (node) { + error(node.name ? node.name : node, message, symbolToString(source)); }); } } @@ -8989,7 +8992,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { + if (!(symbol.flags & 134217728 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -8998,7 +9001,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) + if (symbol.flags & 268435456 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -9010,19 +9013,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 184 /* SourceFile */); + return ts.getAncestor(node, 193 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 184 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 193 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -9030,104 +9033,127 @@ var ts; } } } + function isDefinedBefore(node1, node2) { + var file1 = ts.getSourceFileOfNode(node1); + var file2 = ts.getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + if (!compilerOptions.out) { + return true; + } + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var errorLocation = location; var result; var lastLocation; - var memberWithInitializerThatReferencesIdentifierFromConstructor; - function returnResolvedSymbol(s) { - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; - } - while (location) { + var propertyWithInvalidInitializer; + var errorLocation = location; + loop: while (location) { if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); + break loop; } } switch (location.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); + case 188 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { + break loop; } break; - case 178 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { - return returnResolvedSymbol(result); + case 187 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { + break loop; } break; - case 119 /* Property */: - if (location.parent.kind === 176 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + case 124 /* Property */: + if (location.parent.kind === 184 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { - memberWithInitializerThatReferencesIdentifierFromConstructor = location; + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { + propertyWithInvalidInitializer = location; } } } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } - else { - return returnResolvedSymbol(result); - } + break loop; } break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } break; - case 143 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } var id = location.name; if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: var id = location.variable; if (name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; } lastLocation = location; location = location.parent; } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); + if (!result) { + result = getSymbol(globals, name, meaning); } - return returnResolvedSymbol(undefined); + if (!result) { + if (nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + } + return undefined; + } + if (nameNotFoundMessage) { + if (propertyWithInvalidInitializer) { + var propertyName = propertyWithInvalidInitializer.name; + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + return undefined; + } + if (result.flags & 2 /* BlockScopedVariable */) { + var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + } + } + } + return result; } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 181 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 190 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9143,33 +9169,33 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 181 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); + importDeclaration = ts.getAncestor(entityName, 190 /* ImportDeclaration */); + ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 116 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); + if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 121 /* QualifiedName */) { + return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 181 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); + ts.Debug.assert(entityName.parent.kind === 190 /* ImportDeclaration */); + return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(location, name, meaning) { - if (name.kind === 59 /* Identifier */) { - var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); + if (name.kind === 63 /* Identifier */) { + var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } } - else if (name.kind === 116 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 115 /* Missing */) + else if (name.kind === 121 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */); + if (!namespace || namespace === unknownSymbol || name.right.kind === 120 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { @@ -9180,7 +9206,7 @@ var ts; else { return; } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -9193,7 +9219,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -9220,10 +9246,10 @@ var ts; function getResolvedExportSymbol(moduleSymbol) { var symbol = getExportAssignmentSymbol(moduleSymbol); if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) { return symbol; } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return resolveImport(symbol); } } @@ -9247,8 +9273,8 @@ var ts; error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); + var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */; + var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName); } } symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; @@ -9258,9 +9284,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 184 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 193 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 182 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { result.push(node); } else { @@ -9284,17 +9310,17 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } - if (symbol.flags & ts.SymbolFlags.Value) { + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 4194304 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; + if (symbol.flags & 33554432 /* Import */) { + return (resolveImport(symbol).flags & 107455 /* Value */) !== 0; } return false; } @@ -9302,7 +9328,7 @@ var ts; var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 121 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } } @@ -9356,7 +9382,7 @@ var ts; return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 118 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -9367,17 +9393,17 @@ var ts; } } switch (location.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9387,7 +9413,7 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { @@ -9407,8 +9433,8 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 181 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (symbolFromSymbolTable.flags & 33554432 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 190 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9435,7 +9461,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9445,7 +9471,7 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { @@ -9456,7 +9482,7 @@ var ts; return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; @@ -9490,7 +9516,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 179 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 184 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 188 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 193 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9500,7 +9526,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 181 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 190 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9519,10 +9545,9 @@ var ts; } function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = ts.identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); + var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.identifierToString(firstIdentifier) }; } function releaseStringWriter(writer) { writer.clear(); @@ -9558,6 +9583,18 @@ var ts; } return result; } + function getTypeAliasForTypeLiteral(type) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { + var node = type.symbol.declarations[0].parent; + while (node.kind === 138 /* ParenType */) { + node = node.parent; + } + if (node.kind === 186 /* TypeAliasDeclaration */) { + return getSymbolOfNode(node); + } + } + return undefined; + } var _displayBuilder; function getSymbolDisplayBuilder() { function appendSymbolNameOnly(symbol, writer) { @@ -9575,14 +9612,14 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); } } - writePunctuation(writer, 15 /* DotToken */); + writePunctuation(writer, 19 /* DotToken */); } parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); @@ -9603,14 +9640,14 @@ var ts; if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { return; } - if (symbol.flags & 512 /* TypeLiteral */ || symbol.flags & 1024 /* ObjectLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - if (enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { + if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { walkSymbol(symbol, meaning); return; } @@ -9620,14 +9657,14 @@ var ts; var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; return writeType(type, globalFlags); function writeType(type, flags) { - if (type.flags & ts.TypeFlags.Intrinsic) { + if (type.flags & 127 /* Intrinsic */) { writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); } else if (type.flags & 4096 /* Reference */) { writeTypeReference(type, flags); } else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */); } else if (type.flags & 8192 /* Tuple */) { writeTupleType(type); @@ -9642,11 +9679,11 @@ var ts; writer.writeStringLiteral(type.text); } else { - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function writeTypeList(types, union) { @@ -9655,7 +9692,7 @@ var ts; if (union) { writeSpace(writer); } - writePunctuation(writer, union ? 39 /* BarToken */ : 18 /* CommaToken */); + writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */); writeSpace(writer); } writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); @@ -9664,39 +9701,45 @@ var ts; function writeTypeReference(type, flags) { if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { writeType(type.typeArguments[0], 64 /* InElementType */); - writePunctuation(writer, 13 /* OpenBracketToken */); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } else { - buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - writePunctuation(writer, 19 /* LessThanToken */); + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + writePunctuation(writer, 23 /* LessThanToken */); writeTypeList(type.typeArguments, false); - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function writeTupleType(type) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writeTypeList(type.elementTypes, false); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } function writeUnionType(type, flags) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } writeTypeList(type.types, true); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { writeTypeofSymbol(type); } else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type); } else if (typeStack && ts.contains(typeStack, type)) { - writeKeyword(writer, 105 /* AnyKeyword */); + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */); + } + else { + writeKeyword(writer, 109 /* AnyKeyword */); + } } else { if (!typeStack) { @@ -9708,8 +9751,8 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 184 /* SourceFile */ || declaration.parent.kind === 180 /* ModuleBlock */; })); + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 193 /* SourceFile */ || declaration.parent.kind === 189 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -9717,116 +9760,116 @@ var ts; } } function writeTypeofSymbol(type) { - writeKeyword(writer, 91 /* TypeOfKeyword */); + writeKeyword(writer, 95 /* TypeOfKeyword */); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Value); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */); } function writeLiteralType(type, flags) { var resolved = resolveObjectOrUnionTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 9 /* OpenBraceToken */); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } } - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); for (var i = 0; i < resolved.callSignatures.length; i++) { buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.constructSignatures.length; i++) { - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.stringIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 114 /* StringKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 118 /* StringKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.stringIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.numberIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 112 /* NumberKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 116 /* NumberKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.numberIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } else { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(t, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } writer.decreaseIndent(); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 16 /* Class */ || targetSymbol.flags & 32 /* Interface */) { + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } } @@ -9835,67 +9878,67 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 73 /* ExtendsKeyword */); + writeKeyword(writer, 77 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); } appendSymbolNameOnly(p, writer); if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); for (var i = 0; i < parameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 27 /* EqualsGreaterThanToken */); + writePunctuation(writer, 31 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); } writeSpace(writer); buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); @@ -9928,12 +9971,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 179 /* ModuleDeclaration */) { + if (node.kind === 188 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 184 /* SourceFile */) { + else if (node.kind === 193 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9949,7 +9992,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 4194304 /* Import */) { + if (symbolOfNode.flags & 33554432 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -9957,7 +10000,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -9975,34 +10018,35 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 173 /* VariableDeclaration */: - case 179 /* ModuleDeclaration */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 174 /* FunctionDeclaration */: - case 178 /* EnumDeclaration */: - case 181 /* ImportDeclaration */: - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 181 /* ImportDeclaration */ && parent.kind !== 184 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 181 /* VariableDeclaration */: + case 188 /* ModuleDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 182 /* FunctionDeclaration */: + case 187 /* EnumDeclaration */: + case 190 /* ImportDeclaration */: + var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 190 /* ImportDeclaration */ && parent.kind !== 193 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 119 /* Property */: - case 120 /* Method */: + case 124 /* Property */: + case 125 /* Method */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 121 /* Constructor */: - case 125 /* ConstructSignature */: - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - case 118 /* Parameter */: - case 180 /* ModuleBlock */: + case 126 /* Constructor */: + case 130 /* ConstructSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: + case 123 /* Parameter */: + case 189 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 184 /* SourceFile */: + case 193 /* SourceFile */: return true; default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } if (node) { @@ -10018,16 +10062,16 @@ var ts; return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 158 /* ForInStatement */) { + if (declaration.parent.kind === 166 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { var func = declaration.parent; - if (func.kind === 123 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 122 /* GetAccessor */); + if (func.kind === 128 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10039,7 +10083,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 136 /* PropertyAssignment */) { + if (declaration.kind !== 141 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10058,14 +10102,14 @@ var ts; if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 118 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 119 /* Property */: + case 124 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 118 /* Parameter */: + case 123 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: @@ -10077,11 +10121,11 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { + if (symbol.flags & 536870912 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 170 /* CatchBlock */) { + if (declaration.kind === 178 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; @@ -10104,7 +10148,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 122 /* GetAccessor */) { + if (accessor.kind === 127 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10123,8 +10167,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 123 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10154,7 +10198,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10188,22 +10232,22 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 4 /* EnumMember */) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & ts.SymbolFlags.Accessor) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getTypeOfImport(symbol); } return unknownType; @@ -10221,7 +10265,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 177 /* InterfaceDeclaration */ || node.kind === 176 /* ClassDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */ || node.kind === 184 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10252,7 +10296,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 176 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 184 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10292,7 +10336,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 177 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 185 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10319,6 +10363,23 @@ var ts; } return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -10333,7 +10394,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 117 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10348,20 +10409,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); - if (symbol.flags & 16 /* Class */) { + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 32 /* Interface */) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 64 /* Enum */) { + if (symbol.flags & 2097152 /* TypeAlias */) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144 /* TypeParameter */) { + if (symbol.flags & 1048576 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 4194304 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getDeclaredTypeOfImport(symbol); } return unknownType; @@ -10463,7 +10527,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "" + i); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -10480,7 +10544,7 @@ var ts; return false; } for (var i = 0; i < s.length; i++) { - if (!compareSignatures(s[i], t[i], false, isTypeIdenticalTo)) { + if (!compareSignatures(s[i], t[i], false, compareTypes)) { return false; } } @@ -10527,7 +10591,7 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - if (symbol.flags & 512 /* TypeLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; var callSignatures = getSignaturesOfSymbol(members["__call"]); var constructSignatures = getSignaturesOfSymbol(members["__new"]); @@ -10538,13 +10602,13 @@ var ts; var members = emptySymbols; var callSignatures = emptyArray; var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { + if (symbol.flags & 1952 /* HasExports */) { members = symbol.exports; } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } - if (symbol.flags & 16 /* Class */) { + if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClass(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { @@ -10556,7 +10620,7 @@ var ts; } } var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10581,13 +10645,13 @@ var ts; return type; } function getPropertiesOfObjectType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } function getPropertyOfObjectType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (ts.hasProperty(resolved.members, name)) { var symbol = resolved.members[name]; @@ -10622,10 +10686,10 @@ var ts; type = emptyObjectType; } } - if (type.flags & ts.TypeFlags.StringLike) { + if (type.flags & 258 /* StringLike */) { type = globalStringType; } - else if (type.flags & ts.TypeFlags.NumberLike) { + else if (type.flags & 132 /* NumberLike */) { type = globalNumberType; } else if (type.flags & 8 /* Boolean */) { @@ -10660,7 +10724,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(2 /* Property */ | 33554432 /* Transient */ | 134217728 /* UnionProperty */, name); + var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -10681,9 +10745,9 @@ var ts; if (type.flags & 16384 /* Union */) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { type = getApparentType(type); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { return undefined; } } @@ -10702,7 +10766,7 @@ var ts; return getPropertyOfObjectType(globalObjectType, name); } function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } @@ -10712,7 +10776,7 @@ var ts; return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } @@ -10733,7 +10797,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 121 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -10761,8 +10825,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 122 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 123 /* SetAccessor */); + if (declaration.kind === 127 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -10780,16 +10844,16 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 120 /* Method */: - case 121 /* Constructor */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10858,7 +10922,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 121 /* Constructor */ || signature.declaration.kind === 125 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -10872,7 +10936,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 112 /* NumberKeyword */ : 114 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -10899,7 +10963,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 117 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -10939,17 +11003,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 117 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 127 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { + if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -10967,10 +11031,10 @@ var ts; function getTypeFromTypeReferenceNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */); if (symbol) { var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -11010,9 +11074,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return declaration; } } @@ -11021,7 +11085,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -11032,7 +11096,7 @@ var ts; return type; } function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name); } function getGlobalType(name) { return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); @@ -11175,34 +11239,34 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 105 /* AnyKeyword */: + case 109 /* AnyKeyword */: return anyType; - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: return stringType; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: return numberType; - case 106 /* BooleanKeyword */: + case 110 /* BooleanKeyword */: return booleanType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return voidType; case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 127 /* TypeReference */: + case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 130 /* ArrayType */: + case 135 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 131 /* TupleType */: + case 136 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 132 /* UnionType */: + case 137 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 133 /* ParenType */: + case 138 /* ParenType */: return getTypeFromTypeNode(node.type); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return getTypeFromTypeLiteralNode(node); - case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11227,10 +11291,8 @@ var ts; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11248,10 +11310,8 @@ var ts; } function createTypeEraser(sources) { switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11300,12 +11360,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -11335,7 +11395,7 @@ var ts; return mapper(type); } if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11351,22 +11411,22 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 135 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 136 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 134 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 141 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 139 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 147 /* BinaryExpression */: - return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + case 153 /* BinaryExpression */: + return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; } function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { var result = createObjectType(32768 /* Anonymous */, type.symbol); @@ -11383,81 +11443,29 @@ var ts; var assignableRelation = {}; var identityRelation = {}; function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(source, target, identityRelation, undefined); + } + function compareTypes(source, target) { + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + return checkTypeSubtypeOf(source, target, undefined); } function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined, undefined, undefined); + return checkTypeAssignableTo(source, target, undefined); } - function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); + function checkTypeAssignableTo(source, target, errorNode, headMessage) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isSignatureAssignableTo(source, target) { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { + function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var sourceStack; var targetStack; @@ -11465,118 +11473,124 @@ var ts; var depth = 0; var overflow = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + if (containingMessageChain) { + errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + } addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; + return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (relation === identityRelation) { if (source === target) - return true; + return -1 /* True */; } else { if (source === target) - return true; + return -1 /* True */; if (target.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === undefinedType) - return true; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return true; + return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) - return true; + return -1 /* True */; if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; + return -1 /* True */; if (relation === assignableRelation) { if (source.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === numberType && target.flags & 128 /* Enum */) - return true; + return -1 /* True */; } } if (source.flags & 16384 /* Union */) { - if (unionTypeRelatedToType(source, target, reportErrors)) { - return true; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else if (target.flags & 16384 /* Union */) { - if (typeRelatedToUnionType(source, target, reportErrors)) { - return true; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { - chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - ts.Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; + reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; for (var i = 0, len = targetTypes.length; i < len; i++) { - if (isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1)) { - return true; + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; } } - return false; + return 0 /* False */; } function unionTypeRelatedToType(source, target, reportErrors) { + var result = -1 /* True */; var sourceTypes = source.types; for (var i = 0, len = sourceTypes.length; i < len; i++) { - if (!isRelatedTo(sourceTypes[i], target, reportErrors)) { - return false; + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function typesRelatedTo(sources, targets, reportErrors) { + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return 0 /* False */; } if (source.constraint === target.constraint) { - return true; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -11584,29 +11598,32 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return true; + return -1 /* True */; if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return false; + return 0 /* False */; } } function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; + if (overflow) { + return 0 /* False */; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; + var related = relation[id]; + if (related !== undefined) { + return related; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; + if (source === sourceStack[i] && target === targetStack[i]) { + return 1 /* Maybe */; + } } if (depth === 100) { overflow = true; - return false; + return 0 /* False */; } } else { @@ -11622,10 +11639,27 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = -1 /* True */; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { + if (result !== 1 /* Maybe */) { relation[id] = result; } return result; @@ -11647,8 +11681,9 @@ var ts; } function propertiesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return propertiesIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } + var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; @@ -11659,10 +11694,10 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return false; + return 0 /* False */; } } - else if (!(targetProp.flags & 67108864 /* Prototype */)) { + else if (!(targetProp.flags & 536870912 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { @@ -11675,66 +11710,76 @@ var ts; reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); } } - return false; + return 0 /* False */; } } else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 16 /* Class */; + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return false; + return 0 /* False */; } } else if (sourceFlags & 64 /* Protected */) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return false; + return 0 /* False */; } + result &= related; if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } } } } - return true; + return result; } - function propertiesIdenticalTo(source, target, reportErrors) { + function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceProperties.length; i < len; ++i) { var sourceProp = sourceProperties[i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; + if (!targetProp) { + return 0 /* False */; } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { - return signaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); + } + if (target === anyFunctionType || source === anyFunctionType) { + return -1 /* True */; } - if (target === anyFunctionType || source === anyFunctionType) - return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; @@ -11743,24 +11788,26 @@ var ts; for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { - if (signatureRelatedTo(s, t, localErrors)) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } localErrors = false; } } - return false; + return 0 /* False */; } } - return true; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -11783,42 +11830,49 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); + reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return 0 /* False */; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return true; + return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } - function signaturesIdenticalTo(source, target, kind, reportErrors) { + function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo)) { - return false; + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(0 /* String */, source, target, reportErrors); + return indexTypesIdenticalTo(0 /* String */, source, target); } var targetType = getIndexTypeOfType(target, 0 /* String */); if (targetType) { @@ -11827,20 +11881,22 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); + return indexTypesIdenticalTo(1 /* Number */, source, target); } var targetType = getIndexTypeOfType(target, 1 /* Number */); if (targetType) { @@ -11850,59 +11906,98 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } - if (!compatible) { + if (!related) { if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } - function indexTypesIdenticalTo(indexKind, source, target, reportErrors) { + function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return -1 /* True */; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return 0 /* False */; } } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1 /* True */; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0 /* False */; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0 /* False */; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return 0 /* False */; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } function compareSignatures(source, target, compareReturnTypes, compareTypes) { if (source === target) { - return true; + return -1 /* True */; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return false; + return 0 /* False */; } + var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return false; + return 0 /* False */; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!compareTypes(source.typeParameters[i], target.typeParameters[i])) { - return false; + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return 0 /* False */; } + result &= related; } } else if (source.typeParameters || source.typeParameters) { - return false; + return 0 /* False */; } source = getErasedSignature(source); target = getErasedSignature(target); for (var i = 0, len = source.parameters.length; i < len; i++) { var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!compareTypes(s, t)) { - return false; + var related = compareTypes(s, t); + if (!related) { + return 0 /* False */; } + result &= related; } - return !compareReturnTypes || compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; } function isSupertypeOfEach(candidate, types) { for (var i = 0, len = types.length; i < len; i++) { @@ -11914,8 +12009,34 @@ var ts; function getCommonSupertype(types) { return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } + function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { + var bestSupertype; + var bestSupertypeDownfallType; + var bestSupertypeScore = 0; + for (var i = 0; i < types.length; i++) { + var score = 0; + var downfallType = undefined; + for (var j = 0; j < types.length; j++) { + if (isTypeSubtypeOf(types[j], types[i])) { + score++; + } + else if (!downfallType) { + downfallType = types[j]; + } + } + if (score > bestSupertypeScore) { + bestSupertype = types[i]; + bestSupertypeDownfallType = downfallType; + bestSupertypeScore = score; + } + if (bestSupertypeScore === types.length - 1) { + break; + } + } + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); + } function isTypeOfObjectLiteral(type) { - return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -11963,7 +12084,7 @@ var ts; var members = {}; var index = 0; ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */ | p.flags, p.name); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedTypes[index++]; @@ -12098,7 +12219,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { + else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12152,27 +12273,28 @@ var ts; } } function getInferredType(context, index) { - var result = context.inferredTypes[index]; - if (!result) { + var inferredType = context.inferredTypes[index]; + if (!inferredType) { var inferences = context.inferences[index]; if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - var inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : undefinedType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; } else { inferredType = emptyObjectType; } - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; - context.inferredTypes[index] = result; + if (inferredType !== inferenceFailureType) { + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + } + context.inferredTypes[index] = inferredType; } - return result; + return inferredType; } function getInferredTypes(context) { for (var i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - context.inferences = undefined; return context.inferredTypes; } function hasAncestor(node, kind) { @@ -12181,17 +12303,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return true; - case 59 /* Identifier */: - case 116 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: node = node.parent; continue; default: @@ -12222,12 +12344,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operator >= ts.SyntaxKind.FirstAssignment && node.operator <= ts.SyntaxKind.LastAssignment) { + if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { var n = node.left; - while (n.kind === 142 /* ParenExpression */) { + while (n.kind === 148 /* ParenExpression */) { n = n.expression; } - if (n.kind === 59 /* Identifier */ && getResolvedSymbol(n) === symbol) { + if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } } @@ -12241,40 +12363,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: + case 139 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 147 /* TypeAssertion */: + case 148 /* ParenExpression */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: + case 154 /* ConditionalExpression */: + case 158 /* Block */: + case 159 /* VariableStatement */: + case 161 /* ExpressionStatement */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 169 /* ReturnStatement */: + case 170 /* WithStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + case 174 /* LabeledStatement */: + case 175 /* ThrowStatement */: + case 176 /* TryStatement */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12282,31 +12404,31 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & 1 /* Variable */ && type.flags & ts.TypeFlags.Structured) { + if (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */) { while (true) { var child = node; node = node.parent; - if (!node || node.kind === 175 /* FunctionBlock */ || node.kind === 180 /* ModuleBlock */) { + if (!node || node.kind === 183 /* FunctionBlock */ || node.kind === 189 /* ModuleBlock */) { break; } var narrowedType = type; switch (node.kind) { - case 154 /* IfStatement */: + case 162 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: if (child === node.right) { - if (node.operator === 43 /* AmpersandAmpersandToken */) { + if (node.operator === 47 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); } - else if (node.operator === 44 /* BarBarToken */) { + else if (node.operator === 48 /* BarBarToken */) { narrowedType = narrowType(type, node.left, false); } } @@ -12324,12 +12446,12 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 145 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 151 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; var checkType = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; - if (expr.operator === 26 /* ExclamationEqualsEqualsToken */) { + if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue) { @@ -12362,7 +12484,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (!assumeTrue || expr.left.kind !== 59 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12378,25 +12500,25 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: var operator = expr.operator; - if (operator === 25 /* EqualsEqualsEqualsToken */ || operator === 26 /* ExclamationEqualsEqualsToken */) { + if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); } - else if (operator === 43 /* AmpersandAmpersandToken */) { + else if (operator === 47 /* AmpersandAmpersandToken */) { return narrowTypeByAnd(type, expr, assumeTrue); } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 81 /* InstanceOfKeyword */) { + else if (operator === 85 /* InstanceOfKeyword */) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 145 /* PrefixOperator */: - if (expr.operator === 41 /* ExclamationToken */) { + case 151 /* PrefixOperator */: + if (expr.operator === 45 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -12406,8 +12528,8 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + if (symbol.flags & 33554432 /* Import */) { + getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); @@ -12415,9 +12537,9 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */) { + if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -12427,23 +12549,23 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 144 /* ArrowFunction */) { + if (container.kind === 150 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 121 /* Constructor */: + case 126 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 119 /* Property */: + case 124 /* Property */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } @@ -12452,7 +12574,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 176 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12465,29 +12587,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 118 /* Parameter */) { + if (n.kind === 123 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 139 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12501,20 +12623,20 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 126 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 144 /* ArrowFunction */) { + while (container && container.kind === 150 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 176 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 184 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */ || container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */; } } } @@ -12528,7 +12650,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 121 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12548,7 +12670,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 143 /* FunctionExpression */ || func.kind === 144 /* ArrowFunction */) { + if (func.kind === 149 /* FunctionExpression */ || func.kind === 150 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -12572,7 +12694,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 118 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } @@ -12581,7 +12703,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 121 /* Constructor */ || func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))) { + if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -12603,12 +12725,12 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -12687,25 +12809,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 144 /* ArrowFunction */: - case 161 /* ReturnStatement */: + case 150 /* ArrowFunction */: + case 169 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return getContextualTypeForArgument(node); - case 141 /* TypeAssertion */: + case 147 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 136 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -12735,7 +12857,7 @@ var ts; if (!result) { result = signature; } - else if (!compareSignatures(result, signature, true, isTypeIdenticalTo)) { + else if (!compareSignatures(result, signature, true, compareTypes)) { return undefined; } } @@ -12767,9 +12889,9 @@ var ts; for (var id in members) { if (ts.hasProperty(members, id)) { var member = members[id]; - if (member.flags & 2 /* Property */) { + if (member.flags & 4 /* Property */) { var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) @@ -12779,11 +12901,11 @@ var ts; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 122 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 123 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -12813,17 +12935,17 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 119 /* Property */; + return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 184 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -12832,7 +12954,7 @@ var ts; } return; } - if (node.left.kind === 85 /* SuperKeyword */) { + if (node.left.kind === 89 /* SuperKeyword */) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -12863,8 +12985,8 @@ var ts; return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -12879,8 +13001,8 @@ var ts; var type = checkExpression(node.left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { return false; } else { @@ -12897,15 +13019,19 @@ var ts; var indexType = checkExpression(node.index); if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== 7 /* StringLiteral */) { + error(node.index, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { var name = node.index.text; var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { + if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) { + if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) { var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; @@ -12949,7 +13075,7 @@ var ts; return callIsIncomplete || hasEnoughArguments; } function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; @@ -12969,7 +13095,7 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { @@ -12979,7 +13105,7 @@ var ts; } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 149 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -12989,32 +13115,40 @@ var ts; } } var inferredTypes = getInferredTypes(context); - return ts.contains(inferredTypes, undefinedType) ? undefined : inferredTypes; + context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); + for (var i = 0; i < inferredTypes.length; i++) { + if (inferredTypes[i] === inferenceFailureType) { + inferredTypes[i] = unknownType; + } + } + return context; } - function checkTypeArguments(signature, typeArguments) { + function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { var typeParameters = signature.typeParameters; - var result = []; + var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + typeArgumentResultTypes[i] = typeArgument; + if (typeArgumentsAreAssignable) { + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } } - result.push(typeArgument); } - return result; + return typeArgumentsAreAssignable; } function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; - if (arg.kind === 149 /* OmittedExpression */) { + if (arg.kind === 157 /* OmittedExpression */) { continue; } var paramType = getTypeAtPosition(signature, i); var argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); if (!isValidArgument) { return false; } @@ -13039,40 +13173,36 @@ var ts; excludeArgument[i] = true; } } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - var lastCandidate; - while (true) { - for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { - continue; - } - while (true) { - var candidate = candidates[i]; - if (candidate.typeParameters) { - var typeArguments = node.typeArguments ? checkTypeArguments(candidate, node.typeArguments) : inferTypeArguments(candidate, args, excludeArgument); - if (!typeArguments) { - break; - } - candidate = getSignatureInstantiation(candidate, typeArguments); - } - lastCandidate = candidate; - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; + var candidateForArgumentError; + var candidateForTypeArgumentError; + var resultOfFailedInference; + var result; + if (candidates.length > 1) { + result = chooseOverload(candidates, subtypeRelation, excludeArgument); } - if (lastCandidate) { - checkApplicableSignature(node, lastCandidate, relation, undefined, true); + if (!result) { + candidateForArgumentError = undefined; + candidateForTypeArgumentError = undefined; + resultOfFailedInference = undefined; + result = chooseOverload(candidates, assignableRelation, excludeArgument); + } + if (result) { + return result; + } + if (candidateForArgumentError) { + checkApplicableSignature(node, candidateForArgumentError, assignableRelation, undefined, true); + } + else if (candidateForTypeArgumentError) { + if (node.typeArguments) { + checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true); + } + else { + ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); + var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex]; + var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); + reportNoCommonSupertypeError(inferenceCandidates, node.func, diagnosticChainHead); + } } else { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); @@ -13085,6 +13215,60 @@ var ts; } } return resolveErrorCall(node); + function chooseOverload(candidates, relation, excludeArgument) { + for (var i = 0; i < candidates.length; i++) { + if (!signatureHasCorrectArity(node, candidates[i])) { + continue; + } + var originalCandidate = candidates[i]; + var inferenceResult; + while (true) { + var candidate = originalCandidate; + if (candidate.typeParameters) { + var typeArgumentTypes; + var typeArgumentsAreValid; + if (node.typeArguments) { + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, node.typeArguments, typeArgumentTypes, false); + } + else { + inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; + typeArgumentTypes = inferenceResult.inferredTypes; + } + if (!typeArgumentsAreValid) { + break; + } + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + } + if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { + break; + } + var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; + if (index < 0) { + return candidate; + } + excludeArgument[index] = false; + } + if (originalCandidate.typeParameters) { + var instantiatedCandidate = candidate; + if (typeArgumentsAreValid) { + candidateForArgumentError = instantiatedCandidate; + } + else { + candidateForTypeArgumentError = originalCandidate; + if (!node.typeArguments) { + resultOfFailedInference = inferenceResult; + } + } + } + else { + ts.Debug.assert(originalCandidate === candidate); + candidateForArgumentError = originalCandidate; + } + } + return undefined; + } function collectCandidates() { var result = candidates; var lastParent; @@ -13094,33 +13278,31 @@ var ts; ts.Debug.assert(!result.length); for (var i = 0; i < signatures.length; i++) { var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } + var symbol = signature.declaration && getSymbolOfNode(signature.declaration); + var parent = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent === lastParent) { + pos++; } else { - pos = cutoffPos = result.length; lastParent = parent; + pos = cutoffPos; } - lastSymbol = symbol; - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; } + else { + pos = cutoffPos = result.length; + lastParent = parent; + } + lastSymbol = symbol; + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; } } } function resolveCallExpression(node, candidatesOutArray) { - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); @@ -13182,18 +13364,18 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 139 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + links.resolvedSignature = node.kind === 144 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); } return links.resolvedSignature; } function checkCallExpression(node) { var signature = getResolvedSignature(node); - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 140 /* NewExpression */) { + if (node.kind === 145 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 121 /* Constructor */ && declaration.kind !== 125 /* ConstructSignature */)) { + if (declaration && (declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */)) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13202,13 +13384,18 @@ var ts; } return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node) { + checkExpression(node.tag); + checkExpression(node.template); + return anyType; + } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); if (fullTypeCheck && targetType !== unknownType) { var widenedType = getWidenedType(exprType, true); if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -13231,7 +13418,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 175 /* FunctionBlock */) { + if (func.body.kind !== 183 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13279,7 +13466,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 167 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 175 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13288,7 +13475,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 175 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 183 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13332,47 +13519,72 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 175 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) { error(operand, diagnostic); return false; } return true; } - function checkReferenceExpression(n, message) { + function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; return symbol && getExportSymbolOfValueSymbolIfExported(symbol); } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 137 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; + case 142 /* PropertyAccess */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 138 /* IndexedAccess */: + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; + case 143 /* IndexedAccess */: return true; - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; } } + function isConstVariableReference(n) { + switch (n.kind) { + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + var symbol = findSymbol(n); + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 143 /* IndexedAccess */: + var index = n.index; + var symbol = findSymbol(n.object); + if (symbol && index.kind === 7 /* StringLiteral */) { + var name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + } + return false; + case 148 /* ParenExpression */: + return isConstVariableReference(n.expression); + default: + return false; + } + } if (!isReferenceOrErrorExpression(n)) { - error(n, message); + error(n, invalidReferenceMessage); + return false; + } + if (isConstVariableReference(n)) { + error(n, constantVarianleMessage); return false; } return true; @@ -13380,22 +13592,22 @@ var ts; function checkPrefixExpression(node) { var operandType = checkExpression(node.operand); switch (node.operator) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: return numberType; - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: return booleanType; - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return stringType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return undefinedType; - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13405,7 +13617,7 @@ var ts; var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); + checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } @@ -13413,7 +13625,13 @@ var ts; if (type.flags & 16384 /* Union */) { return !ts.forEach(type.types, function (t) { return !isStructuredType(t); }); } - return (type.flags & ts.TypeFlags.Structured) !== 0; + return (type.flags & 65025 /* Structured */) !== 0; + } + function isConstEnumObjectType(type) { + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { if (leftType !== unknownType && !isStructuredType(leftType)) { @@ -13438,26 +13656,26 @@ var ts; var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { - case 30 /* AsteriskToken */: - case 50 /* AsteriskEqualsToken */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 32 /* PercentToken */: - case 52 /* PercentEqualsToken */: - case 29 /* MinusToken */: - case 49 /* MinusEqualsToken */: - case 35 /* LessThanLessThanToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: + case 34 /* AsteriskToken */: + case 54 /* AsteriskEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 36 /* PercentToken */: + case 56 /* PercentEqualsToken */: + case 33 /* MinusToken */: + case 53 /* MinusEqualsToken */: + case 39 /* LessThanLessThanToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) @@ -13474,17 +13692,17 @@ var ts; } } return numberType; - case 28 /* PlusToken */: - case 48 /* PlusEqualsToken */: + case 32 /* PlusToken */: + case 52 /* PlusEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) { resultType = numberType; } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) { resultType = stringType; } else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { @@ -13494,56 +13712,56 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 48 /* PlusEqualsToken */) { + if (operator === 52 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 81 /* InstanceOfKeyword */: + case 85 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 80 /* InKeyword */: + case 84 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return rightType; - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return getUnionType([leftType, rightType]); - case 47 /* EqualsToken */: + case 51 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 18 /* CommaToken */: + case 22 /* CommaToken */: return rightType; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - return 44 /* BarBarToken */; - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - return 26 /* ExclamationEqualsEqualsToken */; - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - return 43 /* AmpersandAmpersandToken */; + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + return 48 /* BarBarToken */; + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + return 30 /* ExclamationEqualsEqualsToken */; + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: + return 47 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); + if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { + var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { - checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); + checkTypeAssignableTo(valueType, leftType, node.left, undefined); } } } @@ -13557,6 +13775,12 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkTemplateExpression(node) { + ts.forEach(node.templateSpans, function (templateSpan) { + checkExpression(templateSpan.expression); + }); + return stringType; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; node.contextualType = contextualType; @@ -13583,56 +13807,67 @@ var ts; } } } + if (isConstEnumObjectType(type)) { + var ok = (node.parent.kind === 142 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 143 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + if (!ok) { + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + } + } return type; } function checkExpressionNode(node, contextualMapper) { switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return checkIdentifier(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return checkThisExpression(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return checkSuperExpression(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return nullType; - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return booleanType; case 6 /* NumericLiteral */: return numberType; + case 155 /* TemplateExpression */: + return checkTemplateExpression(node); case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return stringType; case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 116 /* QualifiedName */: + case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 137 /* PropertyAccess */: + case 142 /* PropertyAccess */: return checkPropertyAccess(node); - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return checkIndexedAccess(node); - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return checkCallExpression(node); - case 141 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return checkTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return checkTypeAssertion(node); - case 142 /* ParenExpression */: + case 148 /* ParenExpression */: return checkExpression(node.expression); - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 145 /* PrefixOperator */: + case 151 /* PrefixOperator */: return checkPrefixExpression(node); - case 146 /* PostfixOperator */: + case 152 /* PostfixOperator */: return checkPostfixExpression(node); - case 147 /* BinaryExpression */: + case 153 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 148 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 149 /* OmittedExpression */: + case 157 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -13648,7 +13883,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 121 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -13663,10 +13898,10 @@ var ts; } } function checkReferencesInInitializer(n) { - if (n.kind === 59 /* Identifier */) { + if (n.kind === 63 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 118 /* Parameter */) { + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); return; @@ -13700,10 +13935,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 124 /* CallSignature */: + case 129 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -13712,7 +13947,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 177 /* InterfaceDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -13726,7 +13961,7 @@ var ts; var declaration = indexSymbol.declarations[i]; if (declaration.parameters.length == 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -13734,7 +13969,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -13768,39 +14003,37 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 139 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; + return n.kind === 144 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: - case 144 /* ArrowFunction */: - case 135 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 140 /* ObjectLiteral */: return false; + default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 87 /* ThisKeyword */) { + if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 143 /* FunctionExpression */ && n.kind !== 174 /* FunctionDeclaration */) { + else if (n.kind !== 149 /* FunctionExpression */ && n.kind !== 182 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 119 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; + return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 153 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 161 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -13815,15 +14048,15 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 122 /* GetAccessor */) { + if (node.kind === 127 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 122 /* GetAccessor */ ? 123 /* SetAccessor */ : 122 /* GetAccessor */; + var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var thisType = getAnnotatedAccessorType(node); @@ -13847,7 +14080,7 @@ var ts; var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -13889,9 +14122,9 @@ var ts; } var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 177 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 124 /* CallSignature */ || signatureDeclarationNode.kind === 125 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 124 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 185 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -13909,7 +14142,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 177 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 185 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -13951,9 +14184,9 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 115 /* Missing */) { + if (node.name && node.name.kind === 120 /* Missing */) { return; } var seen = false; @@ -13969,7 +14202,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 120 /* Method */); + ts.Debug.assert(node.kind === 125 /* Method */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); @@ -13989,17 +14222,17 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 177 /* InterfaceDeclaration */ || node.parent.kind === 129 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 185 /* InterfaceDeclaration */ || node.parent.kind === 134 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 174 /* FunctionDeclaration */ || node.kind === 120 /* Method */ || node.kind === 121 /* Constructor */) { + if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14065,7 +14298,7 @@ var ts; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { + if (!(symbol.flags & 29360128 /* Export */)) { return; } } @@ -14093,14 +14326,14 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 177 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 179 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 181 /* ImportDeclaration */: + case 185 /* InterfaceDeclaration */: + return 8388608 /* ExportType */; + case 188 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + return 8388608 /* ExportType */ | 4194304 /* ExportValue */; + case 190 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14108,7 +14341,7 @@ var ts; }); return result; default: - return 524288 /* ExportValue */; + return 4194304 /* ExportValue */; } } } @@ -14158,7 +14391,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 118 /* Parameter */) { + if (node.kind === 123 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -14175,11 +14408,11 @@ var ts; return; } switch (current.kind) { - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 120 /* Method */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 125 /* Method */: + case 150 /* ArrowFunction */: + case 126 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; @@ -14193,13 +14426,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 119 /* Property */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */) { + if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 118 /* Parameter */ && !node.parent.body) { + if (node.kind === 123 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -14214,7 +14447,7 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -14230,12 +14463,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 176 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -14248,14 +14481,27 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 179 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { + if (node.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } - var parent = node.kind === 173 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 184 /* SourceFile */ && ts.isExternalModule(parent)) { + var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 193 /* SourceFile */ && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); } } + function checkCollisionWithConstDeclarations(node) { + if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) { + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { + error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); + } + } + } + } + } function checkVariableDeclaration(node) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -14272,8 +14518,9 @@ var ts; } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined); } + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); @@ -14328,7 +14575,7 @@ var ts; error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); + checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); } } var exprType = checkExpression(node.expression); @@ -14343,18 +14590,18 @@ var ts; if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 123 /* SetAccessor */) { + if (func.kind === 128 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined); } - else if (func.kind == 121 /* Constructor */) { + else if (func.kind == 126 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -14373,7 +14620,7 @@ var ts; if (fullTypeCheck && clause.expression) { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { - checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined); } } checkBlock(clause); @@ -14480,10 +14727,10 @@ var ts; if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, 107455 /* Value */)) { error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -14498,7 +14745,7 @@ var ts; if (t !== unknownType) { var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -14514,13 +14761,13 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { + if (base.flags & 536870912 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -14533,26 +14780,26 @@ var ts; if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { continue; } var errorMessage; - if (base.flags & 2048 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 2 /* Property */); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -14560,7 +14807,7 @@ var ts; } } function isAccessor(kind) { - return kind === 122 /* GetAccessor */ || kind === 123 /* SetAccessor */; + return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -14587,13 +14834,46 @@ var ts; } return true; } + function checkInheritedPropertiesAreIdentical(type, typeNode) { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + var seen = {}; + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { prop: p, containingType: type }; + }); + var ok = true; + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!ts.hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + return ok; + } function checkInterfaceDeclaration(node) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 177 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 185 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -14603,7 +14883,7 @@ var ts; var type = getDeclaredTypeOfSymbol(symbol); if (checkInheritedPropertiesAreIdentical(type, node.name)) { ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -14615,20 +14895,9 @@ var ts; checkTypeForDuplicateIndexSignatures(node); } } - function getConstantValueForExpression(node) { - var isNegative = false; - if (node.kind === 145 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 29 /* MinusToken */; - } - } - if (node.kind === 6 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; + function checkTypeAliasDeclaration(node) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); + checkSourceElement(node.type); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -14637,18 +14906,32 @@ var ts; var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); + var enumIsConst = ts.isConstEnumDeclaration(node); ts.forEach(node.members, function (member) { if (isNumericName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } } } - else if (ambient) { + else if (ambient && !enumIsConst) { autoValue = undefined; } if (autoValue !== undefined) { @@ -14657,6 +14940,99 @@ var ts; }); nodeLinks.flags |= 128 /* EnumValuesComputed */; } + function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + return evalConstant(initializer); + function evalConstant(e) { + switch (e.kind) { + case 151 /* PrefixOperator */: + var value = evalConstant(e.operand); + if (value === undefined) { + return undefined; + } + switch (e.operator) { + case 32 /* PlusToken */: return value; + case 33 /* MinusToken */: return -value; + case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; + } + return undefined; + case 153 /* BinaryExpression */: + if (!enumIsConst) { + return undefined; + } + var left = evalConstant(e.left); + if (left === undefined) { + return undefined; + } + var right = evalConstant(e.right); + if (right === undefined) { + return undefined; + } + switch (e.operator) { + case 43 /* BarToken */: return left | right; + case 42 /* AmpersandToken */: return left & right; + case 40 /* GreaterThanGreaterThanToken */: return left >> right; + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 39 /* LessThanLessThanToken */: return left << right; + case 44 /* CaretToken */: return left ^ right; + case 34 /* AsteriskToken */: return left * right; + case 35 /* SlashToken */: return left / right; + case 32 /* PlusToken */: return left + right; + case 33 /* MinusToken */: return left - right; + case 36 /* PercentToken */: return left % right; + } + return undefined; + case 6 /* NumericLiteral */: + return +e.text; + case 148 /* ParenExpression */: + return enumIsConst ? evalConstant(e.expression) : undefined; + case 63 /* Identifier */: + case 143 /* IndexedAccess */: + case 142 /* PropertyAccess */: + if (!enumIsConst) { + return undefined; + } + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType; + var propertyName; + if (e.kind === 63 /* Identifier */) { + enumType = currentType; + propertyName = e.text; + } + else { + if (e.kind === 143 /* IndexedAccess */) { + if (e.index.kind !== 7 /* StringLiteral */) { + return undefined; + } + var enumType = getTypeOfNode(e.object); + propertyName = e.index.text; + } + else { + var enumType = getTypeOfNode(e.left); + propertyName = e.right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & 8 /* EnumMember */)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + if (member === propertyDecl) { + return undefined; + } + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node) { if (!fullTypeCheck) { @@ -14670,9 +15046,17 @@ var ts; var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(enumSymbol.declarations, function (decl) { + if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 178 /* EnumDeclaration */) { + if (declaration.kind !== 187 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -14695,7 +15079,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 176 /* ClassDeclaration */ || (declaration.kind === 174 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 184 /* ClassDeclaration */ || (declaration.kind === 182 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -14707,7 +15091,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -14730,7 +15114,7 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 116 /* QualifiedName */) { + while (node.kind === 121 /* QualifiedName */) { node = node.left; } return node; @@ -14743,25 +15127,25 @@ var ts; if (node.entityName) { target = resolveImport(symbol); if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { + if (target.flags & 107455 /* Value */) { var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { + if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) { checkExpression(node.entityName); } else { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); } } - if (target.flags & ts.SymbolFlags.Type) { + if (target.flags & 3152352 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (node.parent.kind === 184 /* SourceFile */) { + if (node.parent.kind === 193 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 180 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 189 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -14775,7 +15159,7 @@ var ts; } } if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); } @@ -14783,7 +15167,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 184 /* SourceFile */) { + if (container.kind !== 193 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -14792,148 +15176,151 @@ var ts; if (!node) return; switch (node.kind) { - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: return checkTypeParameter(node); - case 118 /* Parameter */: + case 123 /* Parameter */: return checkParameter(node); - case 119 /* Property */: + case 124 /* Property */: return checkPropertyDeclaration(node); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return checkSignatureDeclaration(node); - case 120 /* Method */: + case 125 /* Method */: return checkMethodDeclaration(node); - case 121 /* Constructor */: + case 126 /* Constructor */: return checkConstructorDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return checkAccessorDeclaration(node); - case 127 /* TypeReference */: + case 132 /* TypeReference */: return checkTypeReference(node); - case 128 /* TypeQuery */: + case 133 /* TypeQuery */: return checkTypeQuery(node); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return checkTypeLiteral(node); - case 130 /* ArrayType */: + case 135 /* ArrayType */: return checkArrayType(node); - case 131 /* TupleType */: + case 136 /* TupleType */: return checkTupleType(node); - case 132 /* UnionType */: + case 137 /* UnionType */: return checkUnionType(node); - case 133 /* ParenType */: + case 138 /* ParenType */: return checkSourceElement(node.type); - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 150 /* Block */: + case 158 /* Block */: return checkBlock(node); - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return checkBody(node); - case 151 /* VariableStatement */: + case 159 /* VariableStatement */: return checkVariableStatement(node); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return checkExpressionStatement(node); - case 154 /* IfStatement */: + case 162 /* IfStatement */: return checkIfStatement(node); - case 155 /* DoStatement */: + case 163 /* DoStatement */: return checkDoStatement(node); - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return checkWhileStatement(node); - case 157 /* ForStatement */: + case 165 /* ForStatement */: return checkForStatement(node); - case 158 /* ForInStatement */: + case 166 /* ForInStatement */: return checkForInStatement(node); - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 161 /* ReturnStatement */: + case 169 /* ReturnStatement */: return checkReturnStatement(node); - case 162 /* WithStatement */: + case 170 /* WithStatement */: return checkWithStatement(node); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return checkSwitchStatement(node); - case 166 /* LabeledStatement */: + case 174 /* LabeledStatement */: return checkLabeledStatement(node); - case 167 /* ThrowStatement */: + case 175 /* ThrowStatement */: return checkThrowStatement(node); - case 168 /* TryStatement */: + case 176 /* TryStatement */: return checkTryStatement(node); - case 173 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return checkClassDeclaration(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 178 /* EnumDeclaration */: + case 186 /* TypeAliasDeclaration */: + return checkTypeAliasDeclaration(node); + case 187 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return checkImportDeclaration(node); - case 182 /* ExportAssignment */: + case 191 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 162 /* WithStatement */: + case 170 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 118 /* Parameter */: - case 119 /* Property */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 136 /* PropertyAssignment */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 151 /* VariableStatement */: - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 159 /* ContinueStatement */: - case 160 /* BreakStatement */: - case 161 /* ReturnStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 165 /* DefaultClause */: - case 166 /* LabeledStatement */: - case 167 /* ThrowStatement */: - case 168 /* TryStatement */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 173 /* VariableDeclaration */: - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 183 /* EnumMember */: - case 184 /* SourceFile */: + case 123 /* Parameter */: + case 124 /* Property */: + case 139 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + case 141 /* PropertyAssignment */: + case 142 /* PropertyAccess */: + case 143 /* IndexedAccess */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 146 /* TaggedTemplateExpression */: + case 147 /* TypeAssertion */: + case 148 /* ParenExpression */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: + case 153 /* BinaryExpression */: + case 154 /* ConditionalExpression */: + case 158 /* Block */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 159 /* VariableStatement */: + case 161 /* ExpressionStatement */: + case 162 /* IfStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: + case 169 /* ReturnStatement */: + case 171 /* SwitchStatement */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + case 174 /* LabeledStatement */: + case 175 /* ThrowStatement */: + case 176 /* TryStatement */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 181 /* VariableDeclaration */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: + case 193 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -14950,7 +15337,7 @@ var ts; checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -15004,7 +15391,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 162 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 170 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15040,27 +15427,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 179 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + case 188 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 178 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); + case 187 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 143 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 170 /* CatchBlock */: + case 178 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15073,166 +15460,102 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 59 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; + return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 117 /* TypeParameter */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 122 /* TypeParameter */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 116 /* QualifiedName */) + while (node.parent && node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 127 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 134 /* ArrayLiteral */: - case 135 /* ObjectLiteral */: - case 137 /* PropertyAccess */: - case 138 /* IndexedAccess */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 141 /* TypeAssertion */: - case 142 /* ParenExpression */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 145 /* PrefixOperator */: - case 146 /* PostfixOperator */: - case 147 /* BinaryExpression */: - case 148 /* ConditionalExpression */: - case 149 /* OmittedExpression */: - return true; - case 116 /* QualifiedName */: - while (node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 128 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 128 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 173 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - case 183 /* EnumMember */: - case 136 /* PropertyAssignment */: - return parent.initializer === node; - case 153 /* ExpressionStatement */: - case 154 /* IfStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 161 /* ReturnStatement */: - case 162 /* WithStatement */: - case 163 /* SwitchStatement */: - case 164 /* CaseClause */: - case 167 /* ThrowStatement */: - case 163 /* SwitchStatement */: - return parent.expression === node; - case 157 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 158 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 141 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 138 /* LastTypeNode */) { return true; } switch (node.kind) { - case 105 /* AnyKeyword */: - case 112 /* NumberKeyword */: - case 114 /* StringKeyword */: - case 106 /* BooleanKeyword */: + case 109 /* AnyKeyword */: + case 116 /* NumberKeyword */: + case 118 /* StringKeyword */: + case 110 /* BooleanKeyword */: return true; - case 93 /* VoidKeyword */: - return node.parent.kind !== 145 /* PrefixOperator */; + case 97 /* VoidKeyword */: + return node.parent.kind !== 151 /* PrefixOperator */; case 7 /* StringLiteral */: - return node.parent.kind === 118 /* Parameter */; - case 59 /* Identifier */: - if (node.parent.kind === 116 /* QualifiedName */) { + return node.parent.kind === 123 /* Parameter */; + case 63 /* Identifier */: + if (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - case 116 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 116 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + case 121 /* QualifiedName */: + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 128 /* TypeQuery */) { + if (parent.kind === 133 /* TypeQuery */) { return false; } - if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 138 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: return node === parent.constraint; - case 119 /* Property */: - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: + case 124 /* Property */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: return node === parent.type; - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 121 /* Constructor */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 126 /* Constructor */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node === parent.type; - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return node === parent.type; - case 141 /* TypeAssertion */: + case 147 /* TypeAssertion */: return node === parent.type; - case 139 /* CallExpression */: - case 140 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; + case 146 /* TaggedTemplateExpression */: + return false; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 116 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 181 /* ImportDeclaration */) { + if (node.parent.kind === 190 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 182 /* ExportAssignment */) { + if (node.parent.kind === 191 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 116 /* QualifiedName */ || node.parent.kind === 137 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 142 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 182 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); + if (entityName.parent.kind === 191 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -15240,12 +15563,12 @@ var ts; if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (isExpression(entityName)) { - if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; + if (ts.isExpression(entityName)) { + if (entityName.kind === 63 /* Identifier */) { + var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 116 /* QualifiedName */ || entityName.kind === 137 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 142 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15257,8 +15580,8 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 127 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; + var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */; + meaning |= 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; @@ -15270,32 +15593,32 @@ var ts; if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 182 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 191 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { - case 59 /* Identifier */: - case 137 /* PropertyAccess */: - case 116 /* QualifiedName */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: return getSymbolOfEntityName(node); - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 107 /* ConstructorKeyword */: + case 111 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 121 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 181 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 190 /* ImportDeclaration */ && node.parent.externalModuleName === node) { var importSymbol = getSymbolOfNode(node.parent); var moduleType = getTypeOfSymbol(importSymbol); return moduleType ? moduleType.symbol : undefined; } case 6 /* NumericLiteral */: - if (node.parent.kind == 138 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 143 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15312,7 +15635,7 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } - if (isExpression(node)) { + if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeNode(node)) { @@ -15360,7 +15683,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 134217728 /* UnionProperty */) { + if (symbol.flags & 1073741824 /* UnionProperty */) { var symbols = []; var name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -15368,7 +15691,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 33554432 /* Transient */) { + else if (symbol.flags & 268435456 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -15377,7 +15700,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 184 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 193 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15389,7 +15712,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) { return false; } } @@ -15410,7 +15733,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 179 /* ModuleDeclaration */ || node.kind === 178 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 188 /* ModuleDeclaration */ || node.kind === 187 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15421,7 +15744,7 @@ var ts; var symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { symbol = exportSymbol; } if (symbol.parent) { @@ -15431,29 +15754,35 @@ var ts; } function getExportAssignmentName(node) { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 184 /* SourceFile */ || !node.entityName) { + function isTopLevelValueImportWithEntityName(node) { + if (node.parent.kind !== 193 /* SourceFile */ || !node.entityName) { return false; } var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; } + function hasEarlyErrors(sourceFile) { + return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); + } + function isImportResolvedToValue(symbol) { + var target = resolveImport(symbol); + return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); + } + function isConstEnumOrConstEnumOnlyModule(s) { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; + } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } @@ -15474,10 +15803,10 @@ var ts; } function getConstantValue(node) { var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { + if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 183 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 192 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -15485,7 +15814,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & 2048 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -15501,8 +15830,9 @@ var ts; isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, + hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, @@ -15557,7 +15887,6 @@ var TypeScript; Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", Trailing_comma_not_allowed: "Trailing comma not allowed.", - AsteriskSlash_expected: "'*/' expected.", public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", Unexpected_token: "Unexpected token.", Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", @@ -15639,6 +15968,7 @@ var TypeScript; return_statement_must_be_contained_within_a_function_body: "'return' statement must be contained within a function body.", Expression_expected: "Expression expected.", Type_expected: "Type expected.", + Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.", Duplicate_identifier_0: "Duplicate identifier '{0}'.", The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", @@ -16094,6 +16424,7 @@ var TypeScript; "'return' statement must be contained within a function body.": { "code": 1108, "category": 1 /* Error */ }, "Expression expected.": { "code": 1109, "category": 1 /* Error */ }, "Type expected.": { "code": 1110, "category": 1 /* Error */ }, + "Template literal cannot be used as an element name.": { "code": 1111, "category": 1 /* Error */ }, "Duplicate identifier '{0}'.": { "code": 2000, "category": 1 /* Error */ }, "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": 1 /* Error */ }, "The name '{0}' does not refer to a value.": { "code": 2002, "category": 1 /* Error */ }, @@ -16451,7 +16782,7 @@ var TypeScript; if (array1 === array2) { return true; } - if (array1 === null || array2 === null) { + if (!array1 || !array2) { return false; } if (array1.length !== array2.length) { @@ -16500,7 +16831,7 @@ var TypeScript; return v; } } - return null; + return undefined; }; ArrayUtilities.firstOrDefault = function (array, func) { for (var i = 0, n = array.length; i < n; i++) { @@ -16509,7 +16840,7 @@ var TypeScript; return value; } } - return null; + return undefined; }; ArrayUtilities.first = function (array, func) { for (var i = 0, n = array.length; i < n; i++) { @@ -16623,13 +16954,12 @@ var TypeScript; return this.currentAssertionLevel >= level; }; Debug.assert = function (expression, message, verboseDebugInfo) { - if (message === void 0) { message = ""; } - if (verboseDebugInfo === void 0) { verboseDebugInfo = null; } if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); } + message = message || ""; throw new Error("Debug Failure. False expression: " + message + verboseDebugString); } }; @@ -16683,12 +17013,10 @@ var TypeScript; var Diagnostic = (function (_super) { __extends(Diagnostic, _super); function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - if (_arguments === void 0) { _arguments = null; } - if (additionalLocations === void 0) { additionalLocations = null; } _super.call(this, fileName, lineMap, start, length); this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; + this._arguments = (_arguments && _arguments.length > 0) ? _arguments : undefined; + this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : undefined; } Diagnostic.prototype.toJSON = function (key) { var result = {}; @@ -16840,7 +17168,7 @@ var TypeScript; function LineMap(_computeLineStarts, length) { this._computeLineStarts = _computeLineStarts; this.length = length; - this._lineStarts = null; + this._lineStarts = undefined; } LineMap.prototype.toJSON = function (key) { return { lineStarts: this.lineStarts(), length: this.length }; @@ -16849,7 +17177,7 @@ var TypeScript; return this.length === other.length && TypeScript.ArrayUtilities.sequenceEquals(this.lineStarts(), other.lineStarts(), function (v1, v2) { return v1 === v2; }); }; LineMap.prototype.lineStarts = function () { - if (this._lineStarts === null) { + if (!this._lineStarts) { this._lineStarts = this._computeLineStarts(); } return this._lineStarts; @@ -17036,6 +17364,7 @@ var TypeScript; CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; CharacterCodes[CharacterCodes["at"] = 64] = "at"; CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; + CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; @@ -17075,7 +17404,7 @@ var TypeScript; var StringScriptSnapshot = (function () { function StringScriptSnapshot(text) { this.text = text; - this._lineStartPositions = null; + this._lineStartPositions = undefined; } StringScriptSnapshot.prototype.getText = function (start, end) { return this.text.substring(start, end); @@ -17125,13 +17454,14 @@ var TypeScript; var SimpleStringText = (function () { function SimpleStringText(value) { this.value = value; - this._lineMap = null; + this._lineMap = undefined; } SimpleStringText.prototype.length = function () { return this.value.length; }; SimpleStringText.prototype.substr = function (start, length) { - return this.value.substr(start, length); + var val = this.value; + return start === 0 && length == val.length ? val : val.substr(start, length); }; SimpleStringText.prototype.charCodeAt = function (index) { return this.value.charCodeAt(index); @@ -17147,7 +17477,7 @@ var TypeScript; var SimpleScriptSnapshotText = (function () { function SimpleScriptSnapshotText(scriptSnapshot) { this.scriptSnapshot = scriptSnapshot; - this._lineMap = null; + this._lineMap = undefined; } SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); @@ -17160,7 +17490,7 @@ var TypeScript; }; SimpleScriptSnapshotText.prototype.lineMap = function () { var _this = this; - if (this._lineMap === null) { + if (!this._lineMap) { this._lineMap = new TypeScript.LineMap(function () { return _this.scriptSnapshot.getLineStartPositions(); }, this.length()); } return this._lineMap; @@ -17294,7 +17624,7 @@ var TypeScript; if (overlapStart < overlapEnd) { return TextSpan.fromBounds(overlapStart, overlapEnd); } - return null; + return undefined; }; TextSpan.prototype.intersectsWithTextSpan = function (span) { return span._start <= this.end() && span.end() >= this._start; @@ -17312,7 +17642,7 @@ var TypeScript; if (intersectStart <= intersectEnd) { return TextSpan.fromBounds(intersectStart, intersectEnd); } - return null; + return undefined; }; TextSpan.fromBounds = function (start, end) { TypeScript.Debug.assert(start >= 0); @@ -17465,252 +17795,217 @@ var TypeScript; (function (SyntaxKind) { SyntaxKind[SyntaxKind["None"] = 0] = "None"; SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["SeparatedList"] = 2] = "SeparatedList"; - SyntaxKind[SyntaxKind["TriviaList"] = 3] = "TriviaList"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 5] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 7] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 8] = "SkippedTokenTrivia"; - SyntaxKind[SyntaxKind["ErrorToken"] = 9] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 10] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["IdentifierName"] = 11] = "IdentifierName"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 13] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 14] = "StringLiteral"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 15] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 16] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 17] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 18] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 19] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 20] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 21] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 22] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 23] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 24] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 25] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 26] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 27] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 28] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 29] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 30] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 31] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 32] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 33] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 34] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 35] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 36] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 37] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 38] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 39] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 40] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 41] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 42] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 43] = "WithKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 44] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 45] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 46] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 47] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 48] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 49] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 50] = "SuperKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 51] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 52] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 53] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 54] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 55] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 56] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 57] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 58] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 59] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 60] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 61] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 62] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 63] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 64] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 65] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 66] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 67] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 68] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 69] = "StringKeyword"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 70] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 71] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 72] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 73] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 74] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 75] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 76] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 77] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 78] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 79] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 80] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 81] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 82] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 83] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 84] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 85] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 86] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 87] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 88] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 89] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 90] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 91] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 92] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 93] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 94] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 95] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 96] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 97] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 98] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 99] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 100] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 101] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 102] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 103] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 104] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 105] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 106] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 107] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 108] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 109] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 110] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 111] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 112] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 113] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 114] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 115] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 116] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 117] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 118] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 119] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["SourceUnit"] = 120] = "SourceUnit"; - SyntaxKind[SyntaxKind["QualifiedName"] = 121] = "QualifiedName"; - SyntaxKind[SyntaxKind["ObjectType"] = 122] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 123] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 124] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 125] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 126] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 127] = "TypeQuery"; - SyntaxKind[SyntaxKind["TupleType"] = 128] = "TupleType"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 129] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 130] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 131] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 132] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 133] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 134] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 135] = "ExportAssignment"; - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 136] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 137] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 138] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 139] = "IndexMemberDeclaration"; - SyntaxKind[SyntaxKind["GetAccessor"] = 140] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 141] = "SetAccessor"; - SyntaxKind[SyntaxKind["PropertySignature"] = 142] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 143] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 144] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 145] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 146] = "MethodSignature"; - SyntaxKind[SyntaxKind["Block"] = 147] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 148] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 149] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 150] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 151] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 152] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 154] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 155] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 156] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 157] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 158] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 159] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 160] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 161] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 162] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 163] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 164] = "WithStatement"; - SyntaxKind[SyntaxKind["PlusExpression"] = 165] = "PlusExpression"; - SyntaxKind[SyntaxKind["NegateExpression"] = 166] = "NegateExpression"; - SyntaxKind[SyntaxKind["BitwiseNotExpression"] = 167] = "BitwiseNotExpression"; - SyntaxKind[SyntaxKind["LogicalNotExpression"] = 168] = "LogicalNotExpression"; - SyntaxKind[SyntaxKind["PreIncrementExpression"] = 169] = "PreIncrementExpression"; - SyntaxKind[SyntaxKind["PreDecrementExpression"] = 170] = "PreDecrementExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 171] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 172] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 173] = "VoidExpression"; - SyntaxKind[SyntaxKind["CommaExpression"] = 174] = "CommaExpression"; - SyntaxKind[SyntaxKind["AssignmentExpression"] = 175] = "AssignmentExpression"; - SyntaxKind[SyntaxKind["AddAssignmentExpression"] = 176] = "AddAssignmentExpression"; - SyntaxKind[SyntaxKind["SubtractAssignmentExpression"] = 177] = "SubtractAssignmentExpression"; - SyntaxKind[SyntaxKind["MultiplyAssignmentExpression"] = 178] = "MultiplyAssignmentExpression"; - SyntaxKind[SyntaxKind["DivideAssignmentExpression"] = 179] = "DivideAssignmentExpression"; - SyntaxKind[SyntaxKind["ModuloAssignmentExpression"] = 180] = "ModuloAssignmentExpression"; - SyntaxKind[SyntaxKind["AndAssignmentExpression"] = 181] = "AndAssignmentExpression"; - SyntaxKind[SyntaxKind["ExclusiveOrAssignmentExpression"] = 182] = "ExclusiveOrAssignmentExpression"; - SyntaxKind[SyntaxKind["OrAssignmentExpression"] = 183] = "OrAssignmentExpression"; - SyntaxKind[SyntaxKind["LeftShiftAssignmentExpression"] = 184] = "LeftShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftAssignmentExpression"] = 185] = "SignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftAssignmentExpression"] = 186] = "UnsignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 187] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["LogicalOrExpression"] = 188] = "LogicalOrExpression"; - SyntaxKind[SyntaxKind["LogicalAndExpression"] = 189] = "LogicalAndExpression"; - SyntaxKind[SyntaxKind["BitwiseOrExpression"] = 190] = "BitwiseOrExpression"; - SyntaxKind[SyntaxKind["BitwiseExclusiveOrExpression"] = 191] = "BitwiseExclusiveOrExpression"; - SyntaxKind[SyntaxKind["BitwiseAndExpression"] = 192] = "BitwiseAndExpression"; - SyntaxKind[SyntaxKind["EqualsWithTypeConversionExpression"] = 193] = "EqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["NotEqualsWithTypeConversionExpression"] = 194] = "NotEqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["EqualsExpression"] = 195] = "EqualsExpression"; - SyntaxKind[SyntaxKind["NotEqualsExpression"] = 196] = "NotEqualsExpression"; - SyntaxKind[SyntaxKind["LessThanExpression"] = 197] = "LessThanExpression"; - SyntaxKind[SyntaxKind["GreaterThanExpression"] = 198] = "GreaterThanExpression"; - SyntaxKind[SyntaxKind["LessThanOrEqualExpression"] = 199] = "LessThanOrEqualExpression"; - SyntaxKind[SyntaxKind["GreaterThanOrEqualExpression"] = 200] = "GreaterThanOrEqualExpression"; - SyntaxKind[SyntaxKind["InstanceOfExpression"] = 201] = "InstanceOfExpression"; - SyntaxKind[SyntaxKind["InExpression"] = 202] = "InExpression"; - SyntaxKind[SyntaxKind["LeftShiftExpression"] = 203] = "LeftShiftExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftExpression"] = 204] = "SignedRightShiftExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftExpression"] = 205] = "UnsignedRightShiftExpression"; - SyntaxKind[SyntaxKind["MultiplyExpression"] = 206] = "MultiplyExpression"; - SyntaxKind[SyntaxKind["DivideExpression"] = 207] = "DivideExpression"; - SyntaxKind[SyntaxKind["ModuloExpression"] = 208] = "ModuloExpression"; - SyntaxKind[SyntaxKind["AddExpression"] = 209] = "AddExpression"; - SyntaxKind[SyntaxKind["SubtractExpression"] = 210] = "SubtractExpression"; - SyntaxKind[SyntaxKind["PostIncrementExpression"] = 211] = "PostIncrementExpression"; - SyntaxKind[SyntaxKind["PostDecrementExpression"] = 212] = "PostDecrementExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 213] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 214] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 215] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 216] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 217] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 218] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 219] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 220] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 221] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 222] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 223] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 224] = "OmittedExpression"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 226] = "VariableDeclarator"; - SyntaxKind[SyntaxKind["ArgumentList"] = 227] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 228] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 229] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 230] = "TypeParameterList"; - SyntaxKind[SyntaxKind["ExtendsHeritageClause"] = 231] = "ExtendsHeritageClause"; - SyntaxKind[SyntaxKind["ImplementsHeritageClause"] = 232] = "ImplementsHeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 233] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 234] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 235] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 236] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 237] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 238] = "FinallyClause"; - SyntaxKind[SyntaxKind["TypeParameter"] = 239] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 240] = "Constraint"; - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 241] = "SimplePropertyAssignment"; - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 242] = "FunctionPropertyAssignment"; - SyntaxKind[SyntaxKind["Parameter"] = 243] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 244] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 245] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 246] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 247] = "ModuleNameModuleReference"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 2] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 3] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 4] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 5] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 6] = "SkippedTokenTrivia"; + SyntaxKind[SyntaxKind["ErrorToken"] = 7] = "ErrorToken"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 8] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["IdentifierName"] = 9] = "IdentifierName"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 10] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 11] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 12] = "StringLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateToken"] = 13] = "NoSubstitutionTemplateToken"; + SyntaxKind[SyntaxKind["TemplateStartToken"] = 14] = "TemplateStartToken"; + SyntaxKind[SyntaxKind["TemplateMiddleToken"] = 15] = "TemplateMiddleToken"; + SyntaxKind[SyntaxKind["TemplateEndToken"] = 16] = "TemplateEndToken"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 17] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 18] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 19] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 20] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 21] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 22] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 23] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 24] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 25] = "ElseKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 26] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 27] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 28] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 29] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 30] = "IfKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 31] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 32] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 33] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 34] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 35] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 36] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 37] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 38] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 39] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 40] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 41] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 42] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 43] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 44] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 45] = "WithKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 46] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 47] = "ConstKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 48] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 49] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 50] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 51] = "ImportKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 52] = "SuperKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 53] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 54] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 55] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 56] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 57] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 58] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 59] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 60] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 61] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 62] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 63] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 64] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 65] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 66] = "GetKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 67] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 68] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 69] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 70] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 71] = "StringKeyword"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 72] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 73] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 74] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 75] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 76] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 77] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 78] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 79] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 80] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 81] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 82] = "LessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 83] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 84] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 85] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 86] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 87] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 88] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 89] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 90] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 91] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 92] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 93] = "AsteriskToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 94] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 95] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 96] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 97] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 98] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 99] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 100] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 101] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 102] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 103] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 104] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 105] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 106] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 107] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 108] = "ColonToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 109] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 110] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 111] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 112] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 113] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 114] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 115] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 116] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 117] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 118] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 119] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 120] = "SlashToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 121] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["SourceUnit"] = 122] = "SourceUnit"; + SyntaxKind[SyntaxKind["QualifiedName"] = 123] = "QualifiedName"; + SyntaxKind[SyntaxKind["ObjectType"] = 124] = "ObjectType"; + SyntaxKind[SyntaxKind["FunctionType"] = 125] = "FunctionType"; + SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 127] = "ConstructorType"; + SyntaxKind[SyntaxKind["GenericType"] = 128] = "GenericType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; + SyntaxKind[SyntaxKind["TupleType"] = 130] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 131] = "UnionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 132] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 133] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 134] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 135] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 136] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 137] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 138] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 139] = "ExportAssignment"; + SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 140] = "MemberFunctionDeclaration"; + SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 141] = "MemberVariableDeclaration"; + SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 142] = "ConstructorDeclaration"; + SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 143] = "IndexMemberDeclaration"; + SyntaxKind[SyntaxKind["GetAccessor"] = 144] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 145] = "SetAccessor"; + SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; + SyntaxKind[SyntaxKind["CallSignature"] = 147] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 148] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 149] = "IndexSignature"; + SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; + SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; + SyntaxKind[SyntaxKind["IfStatement"] = 152] = "IfStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 153] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 155] = "ReturnStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 157] = "BreakStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 158] = "ContinueStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 159] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 160] = "ForInStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 161] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 162] = "ThrowStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 163] = "WhileStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 164] = "TryStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 165] = "LabeledStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 166] = "DoStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 167] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 168] = "WithStatement"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 169] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 173] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 174] = "BinaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 175] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["MemberAccessExpression"] = 176] = "MemberAccessExpression"; + SyntaxKind[SyntaxKind["InvocationExpression"] = 177] = "InvocationExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 180] = "ObjectCreationExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 181] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 182] = "ParenthesizedArrowFunctionExpression"; + SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 183] = "SimpleArrowFunctionExpression"; + SyntaxKind[SyntaxKind["CastExpression"] = 184] = "CastExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 185] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 187] = "OmittedExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 188] = "TemplateExpression"; + SyntaxKind[SyntaxKind["TemplateAccessExpression"] = 189] = "TemplateAccessExpression"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 190] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarator"] = 191] = "VariableDeclarator"; + SyntaxKind[SyntaxKind["ArgumentList"] = 192] = "ArgumentList"; + SyntaxKind[SyntaxKind["ParameterList"] = 193] = "ParameterList"; + SyntaxKind[SyntaxKind["TypeArgumentList"] = 194] = "TypeArgumentList"; + SyntaxKind[SyntaxKind["TypeParameterList"] = 195] = "TypeParameterList"; + SyntaxKind[SyntaxKind["HeritageClause"] = 196] = "HeritageClause"; + SyntaxKind[SyntaxKind["EqualsValueClause"] = 197] = "EqualsValueClause"; + SyntaxKind[SyntaxKind["CaseSwitchClause"] = 198] = "CaseSwitchClause"; + SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 199] = "DefaultSwitchClause"; + SyntaxKind[SyntaxKind["ElseClause"] = 200] = "ElseClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 201] = "CatchClause"; + SyntaxKind[SyntaxKind["FinallyClause"] = 202] = "FinallyClause"; + SyntaxKind[SyntaxKind["TemplateClause"] = 203] = "TemplateClause"; + SyntaxKind[SyntaxKind["TypeParameter"] = 204] = "TypeParameter"; + SyntaxKind[SyntaxKind["Constraint"] = 205] = "Constraint"; + SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 206] = "SimplePropertyAssignment"; + SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 207] = "FunctionPropertyAssignment"; + SyntaxKind[SyntaxKind["Parameter"] = 208] = "Parameter"; + SyntaxKind[SyntaxKind["EnumElement"] = 209] = "EnumElement"; + SyntaxKind[SyntaxKind["TypeAnnotation"] = 210] = "TypeAnnotation"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 211] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 212] = "ModuleNameModuleReference"; SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; @@ -17739,111 +18034,111 @@ var TypeScript; var SyntaxFacts; (function (SyntaxFacts) { var textToKeywordKind = { - "any": 60 /* AnyKeyword */, - "boolean": 61 /* BooleanKeyword */, - "break": 15 /* BreakKeyword */, - "case": 16 /* CaseKeyword */, - "catch": 17 /* CatchKeyword */, - "class": 44 /* ClassKeyword */, - "continue": 18 /* ContinueKeyword */, - "const": 45 /* ConstKeyword */, - "constructor": 62 /* ConstructorKeyword */, - "debugger": 19 /* DebuggerKeyword */, - "declare": 63 /* DeclareKeyword */, - "default": 20 /* DefaultKeyword */, - "delete": 21 /* DeleteKeyword */, - "do": 22 /* DoKeyword */, - "else": 23 /* ElseKeyword */, - "enum": 46 /* EnumKeyword */, - "export": 47 /* ExportKeyword */, - "extends": 48 /* ExtendsKeyword */, - "false": 24 /* FalseKeyword */, - "finally": 25 /* FinallyKeyword */, - "for": 26 /* ForKeyword */, - "function": 27 /* FunctionKeyword */, - "get": 64 /* GetKeyword */, - "if": 28 /* IfKeyword */, - "implements": 51 /* ImplementsKeyword */, - "import": 49 /* ImportKeyword */, - "in": 29 /* InKeyword */, - "instanceof": 30 /* InstanceOfKeyword */, - "interface": 52 /* InterfaceKeyword */, - "let": 53 /* LetKeyword */, - "module": 65 /* ModuleKeyword */, - "new": 31 /* NewKeyword */, - "null": 32 /* NullKeyword */, - "number": 67 /* NumberKeyword */, - "package": 54 /* PackageKeyword */, - "private": 55 /* PrivateKeyword */, - "protected": 56 /* ProtectedKeyword */, - "public": 57 /* PublicKeyword */, - "require": 66 /* RequireKeyword */, - "return": 33 /* ReturnKeyword */, - "set": 68 /* SetKeyword */, - "static": 58 /* StaticKeyword */, - "string": 69 /* StringKeyword */, - "super": 50 /* SuperKeyword */, - "switch": 34 /* SwitchKeyword */, - "this": 35 /* ThisKeyword */, - "throw": 36 /* ThrowKeyword */, - "true": 37 /* TrueKeyword */, - "try": 38 /* TryKeyword */, - "typeof": 39 /* TypeOfKeyword */, - "var": 40 /* VarKeyword */, - "void": 41 /* VoidKeyword */, - "while": 42 /* WhileKeyword */, - "with": 43 /* WithKeyword */, - "yield": 59 /* YieldKeyword */, - "{": 70 /* OpenBraceToken */, - "}": 71 /* CloseBraceToken */, - "(": 72 /* OpenParenToken */, - ")": 73 /* CloseParenToken */, - "[": 74 /* OpenBracketToken */, - "]": 75 /* CloseBracketToken */, - ".": 76 /* DotToken */, - "...": 77 /* DotDotDotToken */, - ";": 78 /* SemicolonToken */, - ",": 79 /* CommaToken */, - "<": 80 /* LessThanToken */, - ">": 81 /* GreaterThanToken */, - "<=": 82 /* LessThanEqualsToken */, - ">=": 83 /* GreaterThanEqualsToken */, - "==": 84 /* EqualsEqualsToken */, - "=>": 85 /* EqualsGreaterThanToken */, - "!=": 86 /* ExclamationEqualsToken */, - "===": 87 /* EqualsEqualsEqualsToken */, - "!==": 88 /* ExclamationEqualsEqualsToken */, - "+": 89 /* PlusToken */, - "-": 90 /* MinusToken */, - "*": 91 /* AsteriskToken */, - "%": 92 /* PercentToken */, - "++": 93 /* PlusPlusToken */, - "--": 94 /* MinusMinusToken */, - "<<": 95 /* LessThanLessThanToken */, - ">>": 96 /* GreaterThanGreaterThanToken */, - ">>>": 97 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 98 /* AmpersandToken */, - "|": 99 /* BarToken */, - "^": 100 /* CaretToken */, - "!": 101 /* ExclamationToken */, - "~": 102 /* TildeToken */, - "&&": 103 /* AmpersandAmpersandToken */, - "||": 104 /* BarBarToken */, - "?": 105 /* QuestionToken */, - ":": 106 /* ColonToken */, - "=": 107 /* EqualsToken */, - "+=": 108 /* PlusEqualsToken */, - "-=": 109 /* MinusEqualsToken */, - "*=": 110 /* AsteriskEqualsToken */, - "%=": 111 /* PercentEqualsToken */, - "<<=": 112 /* LessThanLessThanEqualsToken */, - ">>=": 113 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 115 /* AmpersandEqualsToken */, - "|=": 116 /* BarEqualsToken */, - "^=": 117 /* CaretEqualsToken */, - "/": 118 /* SlashToken */, - "/=": 119 /* SlashEqualsToken */ + "any": 62 /* AnyKeyword */, + "boolean": 63 /* BooleanKeyword */, + "break": 17 /* BreakKeyword */, + "case": 18 /* CaseKeyword */, + "catch": 19 /* CatchKeyword */, + "class": 46 /* ClassKeyword */, + "continue": 20 /* ContinueKeyword */, + "const": 47 /* ConstKeyword */, + "constructor": 64 /* ConstructorKeyword */, + "debugger": 21 /* DebuggerKeyword */, + "declare": 65 /* DeclareKeyword */, + "default": 22 /* DefaultKeyword */, + "delete": 23 /* DeleteKeyword */, + "do": 24 /* DoKeyword */, + "else": 25 /* ElseKeyword */, + "enum": 48 /* EnumKeyword */, + "export": 49 /* ExportKeyword */, + "extends": 50 /* ExtendsKeyword */, + "false": 26 /* FalseKeyword */, + "finally": 27 /* FinallyKeyword */, + "for": 28 /* ForKeyword */, + "function": 29 /* FunctionKeyword */, + "get": 66 /* GetKeyword */, + "if": 30 /* IfKeyword */, + "implements": 53 /* ImplementsKeyword */, + "import": 51 /* ImportKeyword */, + "in": 31 /* InKeyword */, + "instanceof": 32 /* InstanceOfKeyword */, + "interface": 54 /* InterfaceKeyword */, + "let": 55 /* LetKeyword */, + "module": 67 /* ModuleKeyword */, + "new": 33 /* NewKeyword */, + "null": 34 /* NullKeyword */, + "number": 69 /* NumberKeyword */, + "package": 56 /* PackageKeyword */, + "private": 57 /* PrivateKeyword */, + "protected": 58 /* ProtectedKeyword */, + "public": 59 /* PublicKeyword */, + "require": 68 /* RequireKeyword */, + "return": 35 /* ReturnKeyword */, + "set": 70 /* SetKeyword */, + "static": 60 /* StaticKeyword */, + "string": 71 /* StringKeyword */, + "super": 52 /* SuperKeyword */, + "switch": 36 /* SwitchKeyword */, + "this": 37 /* ThisKeyword */, + "throw": 38 /* ThrowKeyword */, + "true": 39 /* TrueKeyword */, + "try": 40 /* TryKeyword */, + "typeof": 41 /* TypeOfKeyword */, + "var": 42 /* VarKeyword */, + "void": 43 /* VoidKeyword */, + "while": 44 /* WhileKeyword */, + "with": 45 /* WithKeyword */, + "yield": 61 /* YieldKeyword */, + "{": 72 /* OpenBraceToken */, + "}": 73 /* CloseBraceToken */, + "(": 74 /* OpenParenToken */, + ")": 75 /* CloseParenToken */, + "[": 76 /* OpenBracketToken */, + "]": 77 /* CloseBracketToken */, + ".": 78 /* DotToken */, + "...": 79 /* DotDotDotToken */, + ";": 80 /* SemicolonToken */, + ",": 81 /* CommaToken */, + "<": 82 /* LessThanToken */, + ">": 83 /* GreaterThanToken */, + "<=": 84 /* LessThanEqualsToken */, + ">=": 85 /* GreaterThanEqualsToken */, + "==": 86 /* EqualsEqualsToken */, + "=>": 87 /* EqualsGreaterThanToken */, + "!=": 88 /* ExclamationEqualsToken */, + "===": 89 /* EqualsEqualsEqualsToken */, + "!==": 90 /* ExclamationEqualsEqualsToken */, + "+": 91 /* PlusToken */, + "-": 92 /* MinusToken */, + "*": 93 /* AsteriskToken */, + "%": 94 /* PercentToken */, + "++": 95 /* PlusPlusToken */, + "--": 96 /* MinusMinusToken */, + "<<": 97 /* LessThanLessThanToken */, + ">>": 98 /* GreaterThanGreaterThanToken */, + ">>>": 99 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 100 /* AmpersandToken */, + "|": 101 /* BarToken */, + "^": 102 /* CaretToken */, + "!": 103 /* ExclamationToken */, + "~": 104 /* TildeToken */, + "&&": 105 /* AmpersandAmpersandToken */, + "||": 106 /* BarBarToken */, + "?": 107 /* QuestionToken */, + ":": 108 /* ColonToken */, + "=": 109 /* EqualsToken */, + "+=": 110 /* PlusEqualsToken */, + "-=": 111 /* MinusEqualsToken */, + "*=": 112 /* AsteriskEqualsToken */, + "%=": 113 /* PercentEqualsToken */, + "<<=": 114 /* LessThanLessThanEqualsToken */, + ">>=": 115 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 117 /* AmpersandEqualsToken */, + "|=": 118 /* BarEqualsToken */, + "^=": 119 /* CaretEqualsToken */, + "/": 120 /* SlashToken */, + "/=": 121 /* SlashEqualsToken */ }; var kindToText = new Array(); for (var name in textToKeywordKind) { @@ -17851,7 +18146,7 @@ var TypeScript; kindToText[textToKeywordKind[name]] = name; } } - kindToText[62 /* ConstructorKeyword */] = "constructor"; + kindToText[64 /* ConstructorKeyword */] = "constructor"; function getTokenKind(text) { if (textToKeywordKind.hasOwnProperty(text)) { return textToKeywordKind[text]; @@ -17861,7 +18156,7 @@ var TypeScript; SyntaxFacts.getTokenKind = getTokenKind; function getText(kind) { var result = kindToText[kind]; - return result !== undefined ? result : null; + return result; } SyntaxFacts.getText = getText; function isAnyKeyword(kind) { @@ -17873,215 +18168,77 @@ var TypeScript; } SyntaxFacts.isAnyPunctuation = isAnyPunctuation; function isPrefixUnaryExpressionOperatorToken(tokenKind) { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; + switch (tokenKind) { + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 104 /* TildeToken */: + case 103 /* ExclamationToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: + return true; + default: + return false; + } } SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; function isBinaryExpressionOperatorToken(tokenKind) { - return getBinaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; + switch (tokenKind) { + case 93 /* AsteriskToken */: + case 120 /* SlashToken */: + case 94 /* PercentToken */: + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 97 /* LessThanLessThanToken */: + case 98 /* GreaterThanGreaterThanToken */: + case 99 /* GreaterThanGreaterThanGreaterThanToken */: + case 82 /* LessThanToken */: + case 83 /* GreaterThanToken */: + case 84 /* LessThanEqualsToken */: + case 85 /* GreaterThanEqualsToken */: + case 32 /* InstanceOfKeyword */: + case 31 /* InKeyword */: + case 86 /* EqualsEqualsToken */: + case 88 /* ExclamationEqualsToken */: + case 89 /* EqualsEqualsEqualsToken */: + case 90 /* ExclamationEqualsEqualsToken */: + case 100 /* AmpersandToken */: + case 102 /* CaretToken */: + case 101 /* BarToken */: + case 105 /* AmpersandAmpersandToken */: + case 106 /* BarBarToken */: + case 118 /* BarEqualsToken */: + case 117 /* AmpersandEqualsToken */: + case 119 /* CaretEqualsToken */: + case 114 /* LessThanLessThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 110 /* PlusEqualsToken */: + case 111 /* MinusEqualsToken */: + case 112 /* AsteriskEqualsToken */: + case 121 /* SlashEqualsToken */: + case 113 /* PercentEqualsToken */: + case 109 /* EqualsToken */: + case 81 /* CommaToken */: + return true; + default: + return false; + } } SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; - function getPrefixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 89 /* PlusToken */: - return 165 /* PlusExpression */; - case 90 /* MinusToken */: - return 166 /* NegateExpression */; - case 102 /* TildeToken */: - return 167 /* BitwiseNotExpression */; - case 101 /* ExclamationToken */: - return 168 /* LogicalNotExpression */; - case 93 /* PlusPlusToken */: - return 169 /* PreIncrementExpression */; - case 94 /* MinusMinusToken */: - return 170 /* PreDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken = getPrefixUnaryExpressionFromOperatorToken; - function getPostfixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* PlusPlusToken */: - return 211 /* PostIncrementExpression */; - case 94 /* MinusMinusToken */: - return 212 /* PostDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken = getPostfixUnaryExpressionFromOperatorToken; - function getBinaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* AsteriskToken */: - return 206 /* MultiplyExpression */; - case 118 /* SlashToken */: - return 207 /* DivideExpression */; - case 92 /* PercentToken */: - return 208 /* ModuloExpression */; - case 89 /* PlusToken */: - return 209 /* AddExpression */; - case 90 /* MinusToken */: - return 210 /* SubtractExpression */; - case 95 /* LessThanLessThanToken */: - return 203 /* LeftShiftExpression */; - case 96 /* GreaterThanGreaterThanToken */: - return 204 /* SignedRightShiftExpression */; - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 205 /* UnsignedRightShiftExpression */; - case 80 /* LessThanToken */: - return 197 /* LessThanExpression */; - case 81 /* GreaterThanToken */: - return 198 /* GreaterThanExpression */; - case 82 /* LessThanEqualsToken */: - return 199 /* LessThanOrEqualExpression */; - case 83 /* GreaterThanEqualsToken */: - return 200 /* GreaterThanOrEqualExpression */; - case 30 /* InstanceOfKeyword */: - return 201 /* InstanceOfExpression */; - case 29 /* InKeyword */: - return 202 /* InExpression */; - case 84 /* EqualsEqualsToken */: - return 193 /* EqualsWithTypeConversionExpression */; - case 86 /* ExclamationEqualsToken */: - return 194 /* NotEqualsWithTypeConversionExpression */; - case 87 /* EqualsEqualsEqualsToken */: - return 195 /* EqualsExpression */; - case 88 /* ExclamationEqualsEqualsToken */: - return 196 /* NotEqualsExpression */; - case 98 /* AmpersandToken */: - return 192 /* BitwiseAndExpression */; - case 100 /* CaretToken */: - return 191 /* BitwiseExclusiveOrExpression */; - case 99 /* BarToken */: - return 190 /* BitwiseOrExpression */; - case 103 /* AmpersandAmpersandToken */: - return 189 /* LogicalAndExpression */; - case 104 /* BarBarToken */: - return 188 /* LogicalOrExpression */; - case 116 /* BarEqualsToken */: - return 183 /* OrAssignmentExpression */; - case 115 /* AmpersandEqualsToken */: - return 181 /* AndAssignmentExpression */; - case 117 /* CaretEqualsToken */: - return 182 /* ExclusiveOrAssignmentExpression */; - case 112 /* LessThanLessThanEqualsToken */: - return 184 /* LeftShiftAssignmentExpression */; - case 113 /* GreaterThanGreaterThanEqualsToken */: - return 185 /* SignedRightShiftAssignmentExpression */; - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 186 /* UnsignedRightShiftAssignmentExpression */; - case 108 /* PlusEqualsToken */: - return 176 /* AddAssignmentExpression */; - case 109 /* MinusEqualsToken */: - return 177 /* SubtractAssignmentExpression */; - case 110 /* AsteriskEqualsToken */: - return 178 /* MultiplyAssignmentExpression */; - case 119 /* SlashEqualsToken */: - return 179 /* DivideAssignmentExpression */; - case 111 /* PercentEqualsToken */: - return 180 /* ModuloAssignmentExpression */; - case 107 /* EqualsToken */: - return 175 /* AssignmentExpression */; - case 79 /* CommaToken */: - return 174 /* CommaExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getBinaryExpressionFromOperatorToken = getBinaryExpressionFromOperatorToken; - function getOperatorTokenFromBinaryExpression(tokenKind) { - switch (tokenKind) { - case 206 /* MultiplyExpression */: - return 91 /* AsteriskToken */; - case 207 /* DivideExpression */: - return 118 /* SlashToken */; - case 208 /* ModuloExpression */: - return 92 /* PercentToken */; - case 209 /* AddExpression */: - return 89 /* PlusToken */; - case 210 /* SubtractExpression */: - return 90 /* MinusToken */; - case 203 /* LeftShiftExpression */: - return 95 /* LessThanLessThanToken */; - case 204 /* SignedRightShiftExpression */: - return 96 /* GreaterThanGreaterThanToken */; - case 205 /* UnsignedRightShiftExpression */: - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - case 197 /* LessThanExpression */: - return 80 /* LessThanToken */; - case 198 /* GreaterThanExpression */: - return 81 /* GreaterThanToken */; - case 199 /* LessThanOrEqualExpression */: - return 82 /* LessThanEqualsToken */; - case 200 /* GreaterThanOrEqualExpression */: - return 83 /* GreaterThanEqualsToken */; - case 201 /* InstanceOfExpression */: - return 30 /* InstanceOfKeyword */; - case 202 /* InExpression */: - return 29 /* InKeyword */; - case 193 /* EqualsWithTypeConversionExpression */: - return 84 /* EqualsEqualsToken */; - case 194 /* NotEqualsWithTypeConversionExpression */: - return 86 /* ExclamationEqualsToken */; - case 195 /* EqualsExpression */: - return 87 /* EqualsEqualsEqualsToken */; - case 196 /* NotEqualsExpression */: - return 88 /* ExclamationEqualsEqualsToken */; - case 192 /* BitwiseAndExpression */: - return 98 /* AmpersandToken */; - case 191 /* BitwiseExclusiveOrExpression */: - return 100 /* CaretToken */; - case 190 /* BitwiseOrExpression */: - return 99 /* BarToken */; - case 189 /* LogicalAndExpression */: - return 103 /* AmpersandAmpersandToken */; - case 188 /* LogicalOrExpression */: - return 104 /* BarBarToken */; - case 183 /* OrAssignmentExpression */: - return 116 /* BarEqualsToken */; - case 181 /* AndAssignmentExpression */: - return 115 /* AmpersandEqualsToken */; - case 182 /* ExclusiveOrAssignmentExpression */: - return 117 /* CaretEqualsToken */; - case 184 /* LeftShiftAssignmentExpression */: - return 112 /* LessThanLessThanEqualsToken */; - case 185 /* SignedRightShiftAssignmentExpression */: - return 113 /* GreaterThanGreaterThanEqualsToken */; - case 186 /* UnsignedRightShiftAssignmentExpression */: - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - case 176 /* AddAssignmentExpression */: - return 108 /* PlusEqualsToken */; - case 177 /* SubtractAssignmentExpression */: - return 109 /* MinusEqualsToken */; - case 178 /* MultiplyAssignmentExpression */: - return 110 /* AsteriskEqualsToken */; - case 179 /* DivideAssignmentExpression */: - return 119 /* SlashEqualsToken */; - case 180 /* ModuloAssignmentExpression */: - return 111 /* PercentEqualsToken */; - case 175 /* AssignmentExpression */: - return 107 /* EqualsToken */; - case 174 /* CommaExpression */: - return 79 /* CommaToken */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getOperatorTokenFromBinaryExpression = getOperatorTokenFromBinaryExpression; function isAssignmentOperatorToken(tokenKind) { switch (tokenKind) { - case 116 /* BarEqualsToken */: - case 115 /* AmpersandEqualsToken */: - case 117 /* CaretEqualsToken */: - case 112 /* LessThanLessThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 108 /* PlusEqualsToken */: - case 109 /* MinusEqualsToken */: - case 110 /* AsteriskEqualsToken */: - case 119 /* SlashEqualsToken */: - case 111 /* PercentEqualsToken */: - case 107 /* EqualsToken */: + case 118 /* BarEqualsToken */: + case 117 /* AmpersandEqualsToken */: + case 119 /* CaretEqualsToken */: + case 114 /* LessThanLessThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 110 /* PlusEqualsToken */: + case 111 /* MinusEqualsToken */: + case 112 /* AsteriskEqualsToken */: + case 121 /* SlashEqualsToken */: + case 113 /* PercentEqualsToken */: + case 109 /* EqualsToken */: return true; default: return false; @@ -18090,19 +18247,19 @@ var TypeScript; SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; function isType(kind) { switch (kind) { - case 124 /* ArrayType */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 123 /* FunctionType */: - case 122 /* ObjectType */: - case 125 /* ConstructorType */: - case 127 /* TypeQuery */: - case 126 /* GenericType */: - case 121 /* QualifiedName */: - case 11 /* IdentifierName */: + case 126 /* ArrayType */: + case 62 /* AnyKeyword */: + case 69 /* NumberKeyword */: + case 63 /* BooleanKeyword */: + case 71 /* StringKeyword */: + case 43 /* VoidKeyword */: + case 125 /* FunctionType */: + case 124 /* ObjectType */: + case 127 /* ConstructorType */: + case 129 /* TypeQuery */: + case 128 /* GenericType */: + case 123 /* QualifiedName */: + case 9 /* IdentifierName */: return true; } return false; @@ -18194,12 +18351,15 @@ var TypeScript; } function isContextualToken(token) { switch (token.kind()) { - case 12 /* RegularExpressionLiteral */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - case 83 /* GreaterThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 10 /* RegularExpressionLiteral */: + case 98 /* GreaterThanGreaterThanToken */: + case 99 /* GreaterThanGreaterThanGreaterThanToken */: + case 85 /* GreaterThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + return true; + case 15 /* TemplateMiddleToken */: + case 16 /* TemplateEndToken */: return true; default: return token.isKeywordConvertedToIdentifier(); @@ -18208,7 +18368,7 @@ var TypeScript; Scanner.isContextualToken = isContextualToken; var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; var lastTokenInfoTokenID = -1; - var triviaScanner = createScannerInternal(1 /* ES5 */, TypeScript.SimpleText.fromString(""), function () { + var triviaScanner = createScannerInternal(2 /* Latest */, TypeScript.SimpleText.fromString(""), function () { }); function fillSizeInfo(token, text) { if (lastTokenInfoTokenID !== TypeScript.syntaxID(token)) { @@ -18255,6 +18415,15 @@ var TypeScript; FixedWidthTokenWithNoTrivia.prototype.setFullStart = function (fullStart) { this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); }; + FixedWidthTokenWithNoTrivia.prototype.childCount = function () { + return 0; + }; + FixedWidthTokenWithNoTrivia.prototype.childAt = function (index) { + throw TypeScript.Errors.invalidOperation(); + }; + FixedWidthTokenWithNoTrivia.prototype.accept = function (visitor) { + return visitor.visitToken(this); + }; FixedWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { return false; }; @@ -18286,7 +18455,7 @@ var TypeScript; return this._packedData & 127 /* KindMask */; }; FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; + return fixedWidthTokenLength(this._packedData & 127 /* KindMask */); }; FixedWidthTokenWithNoTrivia.prototype.fullStart = function () { return fixedWidthTokenUnpackFullStart(this._packedData); @@ -18319,6 +18488,15 @@ var TypeScript; LargeScannerToken.prototype.setFullStart = function (fullStart) { this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); }; + LargeScannerToken.prototype.childCount = function () { + return 0; + }; + LargeScannerToken.prototype.childAt = function (index) { + throw TypeScript.Errors.invalidOperation(); + }; + LargeScannerToken.prototype.accept = function (visitor) { + return visitor.visitToken(this); + }; LargeScannerToken.prototype.syntaxTreeText = function (text) { var result = text || TypeScript.syntaxTree(this).text; TypeScript.Debug.assert(result); @@ -18606,7 +18784,7 @@ var TypeScript; } break; } - return createTrivia(4 /* WhitespaceTrivia */, absoluteStartIndex); + return createTrivia(2 /* WhitespaceTrivia */, absoluteStartIndex); } function createTrivia(kind, absoluteStartIndex) { var fullWidth = index - absoluteStartIndex; @@ -18615,7 +18793,7 @@ var TypeScript; function scanSingleLineCommentTrivia() { var absoluteStartIndex = index; skipSingleLineCommentTrivia(); - return createTrivia(7 /* SingleLineCommentTrivia */, absoluteStartIndex); + return createTrivia(5 /* SingleLineCommentTrivia */, absoluteStartIndex); } function skipSingleLineCommentTrivia() { index += 2; @@ -18629,13 +18807,13 @@ var TypeScript; function scanMultiLineCommentTrivia() { var absoluteStartIndex = index; skipMultiLineCommentTrivia(); - return createTrivia(6 /* MultiLineCommentTrivia */, absoluteStartIndex); + return createTrivia(4 /* MultiLineCommentTrivia */, absoluteStartIndex); } function skipMultiLineCommentTrivia() { index += 2; while (true) { if (index === end) { - reportDiagnostic(end, 0, TypeScript.DiagnosticCode.AsteriskSlash_expected, null); + reportDiagnostic(end, 0, TypeScript.DiagnosticCode._0_expected, ["*/"]); return; } if ((index + 1) < end && str.charCodeAt(index) === 42 /* asterisk */ && str.charCodeAt(index + 1) === 47 /* slash */) { @@ -18648,7 +18826,7 @@ var TypeScript; function scanLineTerminatorSequenceTrivia(ch) { var absoluteStartIndex = index; skipLineTerminatorSequence(ch); - return createTrivia(5 /* NewLineTrivia */, absoluteStartIndex); + return createTrivia(3 /* NewLineTrivia */, absoluteStartIndex); } function skipLineTerminatorSequence(ch) { index++; @@ -18658,37 +18836,24 @@ var TypeScript; } function scanSyntaxKind(allowContextualToken) { if (index >= end) { - return 10 /* EndOfFileToken */; + return 8 /* EndOfFileToken */; } var character = str.charCodeAt(index); index++; switch (character) { - case 33 /* exclamation */: - return scanExclamationToken(); - case 34 /* doubleQuote */: - return scanStringLiteral(character); - case 37 /* percent */: - return scanPercentToken(); - case 38 /* ampersand */: - return scanAmpersandToken(); - case 39 /* singleQuote */: - return scanStringLiteral(character); - case 40 /* openParen */: - return 72 /* OpenParenToken */; - case 41 /* closeParen */: - return 73 /* CloseParenToken */; - case 42 /* asterisk */: - return scanAsteriskToken(); - case 43 /* plus */: - return scanPlusToken(); - case 44 /* comma */: - return 79 /* CommaToken */; - case 45 /* minus */: - return scanMinusToken(); - case 46 /* dot */: - return scanDotToken(); - case 47 /* slash */: - return scanSlashToken(allowContextualToken); + case 33 /* exclamation */: return scanExclamationToken(); + case 34 /* doubleQuote */: return scanStringLiteral(character); + case 37 /* percent */: return scanPercentToken(); + case 38 /* ampersand */: return scanAmpersandToken(); + case 39 /* singleQuote */: return scanStringLiteral(character); + case 40 /* openParen */: return 74 /* OpenParenToken */; + case 41 /* closeParen */: return 75 /* CloseParenToken */; + case 42 /* asterisk */: return scanAsteriskToken(); + case 43 /* plus */: return scanPlusToken(); + case 44 /* comma */: return 81 /* CommaToken */; + case 45 /* minus */: return scanMinusToken(); + case 46 /* dot */: return scanDotToken(); + case 47 /* slash */: return scanSlashToken(allowContextualToken); case 48 /* _0 */: case 49 /* _1 */: case 50 /* _2 */: @@ -18700,32 +18865,20 @@ var TypeScript; case 56 /* _8 */: case 57 /* _9 */: return scanNumericLiteral(character); - case 58 /* colon */: - return 106 /* ColonToken */; - case 59 /* semicolon */: - return 78 /* SemicolonToken */; - case 60 /* lessThan */: - return scanLessThanToken(); - case 61 /* equals */: - return scanEqualsToken(); - case 62 /* greaterThan */: - return scanGreaterThanToken(allowContextualToken); - case 63 /* question */: - return 105 /* QuestionToken */; - case 91 /* openBracket */: - return 74 /* OpenBracketToken */; - case 93 /* closeBracket */: - return 75 /* CloseBracketToken */; - case 94 /* caret */: - return scanCaretToken(); - case 123 /* openBrace */: - return 70 /* OpenBraceToken */; - case 124 /* bar */: - return scanBarToken(); - case 125 /* closeBrace */: - return 71 /* CloseBraceToken */; - case 126 /* tilde */: - return 102 /* TildeToken */; + case 58 /* colon */: return 108 /* ColonToken */; + case 59 /* semicolon */: return 80 /* SemicolonToken */; + case 60 /* lessThan */: return scanLessThanToken(); + case 61 /* equals */: return scanEqualsToken(); + case 62 /* greaterThan */: return scanGreaterThanToken(allowContextualToken); + case 63 /* question */: return 107 /* QuestionToken */; + case 91 /* openBracket */: return 76 /* OpenBracketToken */; + case 93 /* closeBracket */: return 77 /* CloseBracketToken */; + case 94 /* caret */: return scanCaretToken(); + case 96 /* backtick */: return scanTemplateToken(character); + case 123 /* openBrace */: return 72 /* OpenBraceToken */; + case 124 /* bar */: return scanBarToken(); + case 125 /* closeBrace */: return scanCloseBraceToken(allowContextualToken, character); + case 126 /* tilde */: return 104 /* TildeToken */; } if (isIdentifierStartCharacter[character]) { var result = tryFastScanIdentifierOrKeyword(character); @@ -18741,7 +18894,7 @@ var TypeScript; var messageText = getErrorMessageText(text); reportDiagnostic(index, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText]); index++; - return 9 /* ErrorToken */; + return 7 /* ErrorToken */; } function isIdentifierStart(interpretedChar) { if (isIdentifierStartCharacter[interpretedChar]) { @@ -18774,7 +18927,7 @@ var TypeScript; return TypeScript.ScannerUtilities.identifierKind(str, startIndex - 1, index - startIndex + 1); } else { - return 11 /* IdentifierName */; + return 9 /* IdentifierName */; } } } @@ -18790,7 +18943,7 @@ var TypeScript; if (keywordKind >= TypeScript.SyntaxKind.FirstKeyword && keywordKind <= TypeScript.SyntaxKind.LastKeyword) { return keywordKind | 128 /* IsVariableWidthMask */; } - return 11 /* IdentifierName */; + return 9 /* IdentifierName */; } function scanNumericLiteral(ch) { if (isHexNumericLiteral(ch)) { @@ -18802,7 +18955,7 @@ var TypeScript; else { scanDecimalNumericLiteral(); } - return 13 /* NumericLiteral */; + return 11 /* NumericLiteral */; } function isOctalNumericLiteral(ch) { return ch === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index)); @@ -18813,7 +18966,7 @@ var TypeScript; index++; } if (languageVersion >= 1 /* ES5 */) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null); + reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, undefined); } } function scanDecimalDigits() { @@ -18865,20 +19018,20 @@ var TypeScript; var ch0 = str.charCodeAt(index); if (ch0 === 61 /* equals */) { index++; - return 82 /* LessThanEqualsToken */; + return 84 /* LessThanEqualsToken */; } else if (ch0 === 60 /* lessThan */) { index++; if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 112 /* LessThanLessThanEqualsToken */; + return 114 /* LessThanLessThanEqualsToken */; } else { - return 95 /* LessThanLessThanToken */; + return 97 /* LessThanLessThanToken */; } } else { - return 80 /* LessThanToken */; + return 82 /* LessThanToken */; } } function scanGreaterThanToken(allowContextualToken) { @@ -18892,108 +19045,130 @@ var TypeScript; var ch2 = str.charCodeAt(index); if (ch2 === 61 /* equals */) { index++; - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } else { - return 97 /* GreaterThanGreaterThanGreaterThanToken */; + return 99 /* GreaterThanGreaterThanGreaterThanToken */; } } else if (ch1 === 61 /* equals */) { index++; - return 113 /* GreaterThanGreaterThanEqualsToken */; + return 115 /* GreaterThanGreaterThanEqualsToken */; } else { - return 96 /* GreaterThanGreaterThanToken */; + return 98 /* GreaterThanGreaterThanToken */; } } else if (ch0 === 61 /* equals */) { index++; - return 83 /* GreaterThanEqualsToken */; + return 85 /* GreaterThanEqualsToken */; } } - return 81 /* GreaterThanToken */; + return 83 /* GreaterThanToken */; } function scanBarToken() { var ch = str.charCodeAt(index); if (ch === 61 /* equals */) { index++; - return 116 /* BarEqualsToken */; + return 118 /* BarEqualsToken */; } else if (ch === 124 /* bar */) { index++; - return 104 /* BarBarToken */; + return 106 /* BarBarToken */; } else { - return 99 /* BarToken */; + return 101 /* BarToken */; } } function scanCaretToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 117 /* CaretEqualsToken */; + return 119 /* CaretEqualsToken */; } else { - return 100 /* CaretToken */; + return 102 /* CaretToken */; } } + function scanCloseBraceToken(allowContextualToken, startChar) { + return allowContextualToken ? scanTemplateToken(startChar) : 73 /* CloseBraceToken */; + } + function scanTemplateToken(startChar) { + var startedWithBacktick = startChar === 96 /* backtick */; + while (true) { + if (index === end) { + reportDiagnostic(end, 0, TypeScript.DiagnosticCode._0_expected, ["`"]); + break; + } + var ch = str.charCodeAt(index); + index++; + if (ch === 96 /* backtick */) { + break; + } + if (ch === 36 /* $ */ && index < end && str.charCodeAt(index) === 123 /* openBrace */) { + index++; + return startedWithBacktick ? 14 /* TemplateStartToken */ : 15 /* TemplateMiddleToken */; + } + } + return startedWithBacktick ? 13 /* NoSubstitutionTemplateToken */ : 16 /* TemplateEndToken */; + } function scanAmpersandToken() { var character = str.charCodeAt(index); if (character === 61 /* equals */) { index++; - return 115 /* AmpersandEqualsToken */; + return 117 /* AmpersandEqualsToken */; } else if (character === 38 /* ampersand */) { index++; - return 103 /* AmpersandAmpersandToken */; + return 105 /* AmpersandAmpersandToken */; } else { - return 98 /* AmpersandToken */; + return 100 /* AmpersandToken */; } } function scanPercentToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 111 /* PercentEqualsToken */; + return 113 /* PercentEqualsToken */; } else { - return 92 /* PercentToken */; + return 94 /* PercentToken */; } } function scanMinusToken() { var character = str.charCodeAt(index); if (character === 61 /* equals */) { index++; - return 109 /* MinusEqualsToken */; + return 111 /* MinusEqualsToken */; } else if (character === 45 /* minus */) { index++; - return 94 /* MinusMinusToken */; + return 96 /* MinusMinusToken */; } else { - return 90 /* MinusToken */; + return 92 /* MinusToken */; } } function scanPlusToken() { var character = str.charCodeAt(index); if (character === 61 /* equals */) { index++; - return 108 /* PlusEqualsToken */; + return 110 /* PlusEqualsToken */; } else if (character === 43 /* plus */) { index++; - return 93 /* PlusPlusToken */; + return 95 /* PlusPlusToken */; } else { - return 89 /* PlusToken */; + return 91 /* PlusToken */; } } function scanAsteriskToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 110 /* AsteriskEqualsToken */; + return 112 /* AsteriskEqualsToken */; } else { - return 91 /* AsteriskToken */; + return 93 /* AsteriskToken */; } } function scanEqualsToken() { @@ -19002,32 +19177,32 @@ var TypeScript; index++; if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 87 /* EqualsEqualsEqualsToken */; + return 89 /* EqualsEqualsEqualsToken */; } else { - return 84 /* EqualsEqualsToken */; + return 86 /* EqualsEqualsToken */; } } else if (character === 62 /* greaterThan */) { index++; - return 85 /* EqualsGreaterThanToken */; + return 87 /* EqualsGreaterThanToken */; } else { - return 107 /* EqualsToken */; + return 109 /* EqualsToken */; } } function scanDotToken() { var nextChar = str.charCodeAt(index); if (TypeScript.CharacterInfo.isDecimalDigit(nextChar)) { scanDecimalNumericLiteralAfterDot(); - return 13 /* NumericLiteral */; + return 11 /* NumericLiteral */; } if (nextChar === 46 /* dot */ && str.charCodeAt(index + 1) === 46 /* dot */) { index += 2; - return 77 /* DotDotDotToken */; + return 79 /* DotDotDotToken */; } else { - return 76 /* DotToken */; + return 78 /* DotToken */; } } function scanSlashToken(allowContextualToken) { @@ -19039,10 +19214,10 @@ var TypeScript; } if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 119 /* SlashEqualsToken */; + return 121 /* SlashEqualsToken */; } else { - return 118 /* SlashToken */; + return 120 /* SlashToken */; } } function tryScanRegularExpressionToken() { @@ -19083,21 +19258,21 @@ var TypeScript; while (isIdentifierPartCharacter[str.charCodeAt(index)]) { index++; } - return 12 /* RegularExpressionLiteral */; + return 10 /* RegularExpressionLiteral */; } function scanExclamationToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 88 /* ExclamationEqualsEqualsToken */; + return 90 /* ExclamationEqualsEqualsToken */; } else { - return 86 /* ExclamationEqualsToken */; + return 88 /* ExclamationEqualsToken */; } } else { - return 101 /* ExclamationToken */; + return 103 /* ExclamationToken */; } } function getErrorMessageText(text) { @@ -19140,14 +19315,14 @@ var TypeScript; break; } else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, null); + reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, undefined); break; } else { index++; } } - return 14 /* StringLiteral */; + return 12 /* StringLiteral */; } function isUnicodeEscape(character) { return character === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */; @@ -19187,7 +19362,7 @@ var TypeScript; var ch2 = str.charCodeAt(index); if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { if (report) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, null); + reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, undefined); } break; } @@ -19227,22 +19402,22 @@ var TypeScript; var _tokenDiagnostics = []; var rewindPointPool = []; var rewindPointPoolCount = 0; - var lastDiagnostic = null; + var lastDiagnostic = undefined; var reportDiagnostic = function (position, fullWidth, diagnosticKey, args) { lastDiagnostic = new TypeScript.Diagnostic(fileName, text.lineMap(), position, fullWidth, diagnosticKey, args); }; - var slidingWindow = new TypeScript.SlidingWindow(fetchNextItem, TypeScript.ArrayUtilities.createArray(1024, null), null); + var slidingWindow = new TypeScript.SlidingWindow(fetchNextItem, TypeScript.ArrayUtilities.createArray(1024, undefined), undefined); var scanner = createScanner(languageVersion, text, reportDiagnostic); function release() { - slidingWindow = null; - scanner = null; + slidingWindow = undefined; + scanner = undefined; _tokenDiagnostics = []; rewindPointPool = []; - lastDiagnostic = null; - reportDiagnostic = null; + lastDiagnostic = undefined; + reportDiagnostic = undefined; } function currentNode() { - return null; + return undefined; } function consumeNode(node) { throw TypeScript.Errors.invalidOperation(); @@ -19259,7 +19434,7 @@ var TypeScript; } rewindPointPoolCount--; var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = null; + rewindPointPool[rewindPointPoolCount] = undefined; return result; } function getRewindPoint() { @@ -19280,11 +19455,11 @@ var TypeScript; } function fetchNextItem(allowContextualToken) { var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === null) { + if (lastDiagnostic === undefined) { return token; } _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = null; + lastDiagnostic = undefined; return TypeScript.Syntax.realizeToken(token, text); } function peekToken(n) { @@ -19303,12 +19478,12 @@ var TypeScript; var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; if (diagnostic.start() >= position) { tokenDiagnosticsLength--; + _tokenDiagnostics.pop(); } else { break; } } - _tokenDiagnostics.length = tokenDiagnosticsLength; } function resetToPosition(absolutePosition) { TypeScript.Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); @@ -19342,227 +19517,371 @@ var TypeScript; }; } Scanner.createParserSource = createParserSource; + function fixedWidthTokenLength(kind) { + switch (kind) { + case 17 /* BreakKeyword */: return 5; + case 18 /* CaseKeyword */: return 4; + case 19 /* CatchKeyword */: return 5; + case 20 /* ContinueKeyword */: return 8; + case 21 /* DebuggerKeyword */: return 8; + case 22 /* DefaultKeyword */: return 7; + case 23 /* DeleteKeyword */: return 6; + case 24 /* DoKeyword */: return 2; + case 25 /* ElseKeyword */: return 4; + case 26 /* FalseKeyword */: return 5; + case 27 /* FinallyKeyword */: return 7; + case 28 /* ForKeyword */: return 3; + case 29 /* FunctionKeyword */: return 8; + case 30 /* IfKeyword */: return 2; + case 31 /* InKeyword */: return 2; + case 32 /* InstanceOfKeyword */: return 10; + case 33 /* NewKeyword */: return 3; + case 34 /* NullKeyword */: return 4; + case 35 /* ReturnKeyword */: return 6; + case 36 /* SwitchKeyword */: return 6; + case 37 /* ThisKeyword */: return 4; + case 38 /* ThrowKeyword */: return 5; + case 39 /* TrueKeyword */: return 4; + case 40 /* TryKeyword */: return 3; + case 41 /* TypeOfKeyword */: return 6; + case 42 /* VarKeyword */: return 3; + case 43 /* VoidKeyword */: return 4; + case 44 /* WhileKeyword */: return 5; + case 45 /* WithKeyword */: return 4; + case 46 /* ClassKeyword */: return 5; + case 47 /* ConstKeyword */: return 5; + case 48 /* EnumKeyword */: return 4; + case 49 /* ExportKeyword */: return 6; + case 50 /* ExtendsKeyword */: return 7; + case 51 /* ImportKeyword */: return 6; + case 52 /* SuperKeyword */: return 5; + case 53 /* ImplementsKeyword */: return 10; + case 54 /* InterfaceKeyword */: return 9; + case 55 /* LetKeyword */: return 3; + case 56 /* PackageKeyword */: return 7; + case 57 /* PrivateKeyword */: return 7; + case 58 /* ProtectedKeyword */: return 9; + case 59 /* PublicKeyword */: return 6; + case 60 /* StaticKeyword */: return 6; + case 61 /* YieldKeyword */: return 5; + case 62 /* AnyKeyword */: return 3; + case 63 /* BooleanKeyword */: return 7; + case 64 /* ConstructorKeyword */: return 11; + case 65 /* DeclareKeyword */: return 7; + case 66 /* GetKeyword */: return 3; + case 67 /* ModuleKeyword */: return 6; + case 68 /* RequireKeyword */: return 7; + case 69 /* NumberKeyword */: return 6; + case 70 /* SetKeyword */: return 3; + case 71 /* StringKeyword */: return 6; + case 72 /* OpenBraceToken */: return 1; + case 73 /* CloseBraceToken */: return 1; + case 74 /* OpenParenToken */: return 1; + case 75 /* CloseParenToken */: return 1; + case 76 /* OpenBracketToken */: return 1; + case 77 /* CloseBracketToken */: return 1; + case 78 /* DotToken */: return 1; + case 79 /* DotDotDotToken */: return 3; + case 80 /* SemicolonToken */: return 1; + case 81 /* CommaToken */: return 1; + case 82 /* LessThanToken */: return 1; + case 83 /* GreaterThanToken */: return 1; + case 84 /* LessThanEqualsToken */: return 2; + case 85 /* GreaterThanEqualsToken */: return 2; + case 86 /* EqualsEqualsToken */: return 2; + case 87 /* EqualsGreaterThanToken */: return 2; + case 88 /* ExclamationEqualsToken */: return 2; + case 89 /* EqualsEqualsEqualsToken */: return 3; + case 90 /* ExclamationEqualsEqualsToken */: return 3; + case 91 /* PlusToken */: return 1; + case 92 /* MinusToken */: return 1; + case 93 /* AsteriskToken */: return 1; + case 94 /* PercentToken */: return 1; + case 95 /* PlusPlusToken */: return 2; + case 96 /* MinusMinusToken */: return 2; + case 97 /* LessThanLessThanToken */: return 2; + case 98 /* GreaterThanGreaterThanToken */: return 2; + case 99 /* GreaterThanGreaterThanGreaterThanToken */: return 3; + case 100 /* AmpersandToken */: return 1; + case 101 /* BarToken */: return 1; + case 102 /* CaretToken */: return 1; + case 103 /* ExclamationToken */: return 1; + case 104 /* TildeToken */: return 1; + case 105 /* AmpersandAmpersandToken */: return 2; + case 106 /* BarBarToken */: return 2; + case 107 /* QuestionToken */: return 1; + case 108 /* ColonToken */: return 1; + case 109 /* EqualsToken */: return 1; + case 110 /* PlusEqualsToken */: return 2; + case 111 /* MinusEqualsToken */: return 2; + case 112 /* AsteriskEqualsToken */: return 2; + case 113 /* PercentEqualsToken */: return 2; + case 114 /* LessThanLessThanEqualsToken */: return 3; + case 115 /* GreaterThanGreaterThanEqualsToken */: return 3; + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 4; + case 117 /* AmpersandEqualsToken */: return 2; + case 118 /* BarEqualsToken */: return 2; + case 119 /* CaretEqualsToken */: return 2; + case 120 /* SlashToken */: return 1; + case 121 /* SlashEqualsToken */: return 2; + default: throw new Error(); + } + } })(Scanner = TypeScript.Scanner || (TypeScript.Scanner = {})); })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - var ScannerUtilities = (function () { - function ScannerUtilities() { + var ScannerUtilities; + (function (ScannerUtilities) { + function fixedWidthTokenLength(kind) { + switch (kind) { + case 17 /* BreakKeyword */: return 5; + case 18 /* CaseKeyword */: return 4; + case 19 /* CatchKeyword */: return 5; + case 20 /* ContinueKeyword */: return 8; + case 21 /* DebuggerKeyword */: return 8; + case 22 /* DefaultKeyword */: return 7; + case 23 /* DeleteKeyword */: return 6; + case 24 /* DoKeyword */: return 2; + case 25 /* ElseKeyword */: return 4; + case 26 /* FalseKeyword */: return 5; + case 27 /* FinallyKeyword */: return 7; + case 28 /* ForKeyword */: return 3; + case 29 /* FunctionKeyword */: return 8; + case 30 /* IfKeyword */: return 2; + case 31 /* InKeyword */: return 2; + case 32 /* InstanceOfKeyword */: return 10; + case 33 /* NewKeyword */: return 3; + case 34 /* NullKeyword */: return 4; + case 35 /* ReturnKeyword */: return 6; + case 36 /* SwitchKeyword */: return 6; + case 37 /* ThisKeyword */: return 4; + case 38 /* ThrowKeyword */: return 5; + case 39 /* TrueKeyword */: return 4; + case 40 /* TryKeyword */: return 3; + case 41 /* TypeOfKeyword */: return 6; + case 42 /* VarKeyword */: return 3; + case 43 /* VoidKeyword */: return 4; + case 44 /* WhileKeyword */: return 5; + case 45 /* WithKeyword */: return 4; + case 46 /* ClassKeyword */: return 5; + case 47 /* ConstKeyword */: return 5; + case 48 /* EnumKeyword */: return 4; + case 49 /* ExportKeyword */: return 6; + case 50 /* ExtendsKeyword */: return 7; + case 51 /* ImportKeyword */: return 6; + case 52 /* SuperKeyword */: return 5; + case 53 /* ImplementsKeyword */: return 10; + case 54 /* InterfaceKeyword */: return 9; + case 55 /* LetKeyword */: return 3; + case 56 /* PackageKeyword */: return 7; + case 57 /* PrivateKeyword */: return 7; + case 58 /* ProtectedKeyword */: return 9; + case 59 /* PublicKeyword */: return 6; + case 60 /* StaticKeyword */: return 6; + case 61 /* YieldKeyword */: return 5; + case 62 /* AnyKeyword */: return 3; + case 63 /* BooleanKeyword */: return 7; + case 64 /* ConstructorKeyword */: return 11; + case 65 /* DeclareKeyword */: return 7; + case 66 /* GetKeyword */: return 3; + case 67 /* ModuleKeyword */: return 6; + case 68 /* RequireKeyword */: return 7; + case 69 /* NumberKeyword */: return 6; + case 70 /* SetKeyword */: return 3; + case 71 /* StringKeyword */: return 6; + case 72 /* OpenBraceToken */: return 1; + case 73 /* CloseBraceToken */: return 1; + case 74 /* OpenParenToken */: return 1; + case 75 /* CloseParenToken */: return 1; + case 76 /* OpenBracketToken */: return 1; + case 77 /* CloseBracketToken */: return 1; + case 78 /* DotToken */: return 1; + case 79 /* DotDotDotToken */: return 3; + case 80 /* SemicolonToken */: return 1; + case 81 /* CommaToken */: return 1; + case 82 /* LessThanToken */: return 1; + case 83 /* GreaterThanToken */: return 1; + case 84 /* LessThanEqualsToken */: return 2; + case 85 /* GreaterThanEqualsToken */: return 2; + case 86 /* EqualsEqualsToken */: return 2; + case 87 /* EqualsGreaterThanToken */: return 2; + case 88 /* ExclamationEqualsToken */: return 2; + case 89 /* EqualsEqualsEqualsToken */: return 3; + case 90 /* ExclamationEqualsEqualsToken */: return 3; + case 91 /* PlusToken */: return 1; + case 92 /* MinusToken */: return 1; + case 93 /* AsteriskToken */: return 1; + case 94 /* PercentToken */: return 1; + case 95 /* PlusPlusToken */: return 2; + case 96 /* MinusMinusToken */: return 2; + case 97 /* LessThanLessThanToken */: return 2; + case 98 /* GreaterThanGreaterThanToken */: return 2; + case 99 /* GreaterThanGreaterThanGreaterThanToken */: return 3; + case 100 /* AmpersandToken */: return 1; + case 101 /* BarToken */: return 1; + case 102 /* CaretToken */: return 1; + case 103 /* ExclamationToken */: return 1; + case 104 /* TildeToken */: return 1; + case 105 /* AmpersandAmpersandToken */: return 2; + case 106 /* BarBarToken */: return 2; + case 107 /* QuestionToken */: return 1; + case 108 /* ColonToken */: return 1; + case 109 /* EqualsToken */: return 1; + case 110 /* PlusEqualsToken */: return 2; + case 111 /* MinusEqualsToken */: return 2; + case 112 /* AsteriskEqualsToken */: return 2; + case 113 /* PercentEqualsToken */: return 2; + case 114 /* LessThanLessThanEqualsToken */: return 3; + case 115 /* GreaterThanGreaterThanEqualsToken */: return 3; + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 4; + case 117 /* AmpersandEqualsToken */: return 2; + case 118 /* BarEqualsToken */: return 2; + case 119 /* CaretEqualsToken */: return 2; + case 120 /* SlashToken */: return 1; + case 121 /* SlashEqualsToken */: return 2; + default: throw new Error(); + } } - ScannerUtilities.identifierKind = function (str, start, length) { + ScannerUtilities.fixedWidthTokenLength = fixedWidthTokenLength; + function identifierKind(str, start, length) { switch (length) { case 2: switch (str.charCodeAt(start)) { - case 100 /* d */: - return (str.charCodeAt(start + 1) === 111 /* o */) ? 22 /* DoKeyword */ : 11 /* IdentifierName */; + case 100 /* d */: return (str.charCodeAt(start + 1) === 111 /* o */) ? 24 /* DoKeyword */ : 9 /* IdentifierName */; case 105 /* i */: switch (str.charCodeAt(start + 1)) { - case 102 /* f */: - return 28 /* IfKeyword */; - case 110 /* n */: - return 29 /* InKeyword */; - default: - return 11 /* IdentifierName */; + case 102 /* f */: return 30 /* IfKeyword */; + case 110 /* n */: return 31 /* InKeyword */; + default: return 9 /* IdentifierName */; } - default: - return 11 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 3: switch (str.charCodeAt(start)) { - case 97 /* a */: - return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 121 /* y */) ? 60 /* AnyKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 114 /* r */) ? 26 /* ForKeyword */ : 11 /* IdentifierName */; - case 103 /* g */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 64 /* GetKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 53 /* LetKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 119 /* w */) ? 31 /* NewKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 68 /* SetKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 121 /* y */) ? 38 /* TryKeyword */ : 11 /* IdentifierName */; - case 118 /* v */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 114 /* r */) ? 40 /* VarKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 97 /* a */: return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 121 /* y */) ? 62 /* AnyKeyword */ : 9 /* IdentifierName */; + case 102 /* f */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 114 /* r */) ? 28 /* ForKeyword */ : 9 /* IdentifierName */; + case 103 /* g */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 66 /* GetKeyword */ : 9 /* IdentifierName */; + case 108 /* l */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 55 /* LetKeyword */ : 9 /* IdentifierName */; + case 110 /* n */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 119 /* w */) ? 33 /* NewKeyword */ : 9 /* IdentifierName */; + case 115 /* s */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 70 /* SetKeyword */ : 9 /* IdentifierName */; + case 116 /* t */: return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 121 /* y */) ? 40 /* TryKeyword */ : 9 /* IdentifierName */; + case 118 /* v */: return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 114 /* r */) ? 42 /* VarKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 4: switch (str.charCodeAt(start)) { - case 99 /* c */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 16 /* CaseKeyword */ : 11 /* IdentifierName */; + case 99 /* c */: return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 18 /* CaseKeyword */ : 9 /* IdentifierName */; case 101 /* e */: switch (str.charCodeAt(start + 1)) { - case 108 /* l */: - return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 23 /* ElseKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 109 /* m */) ? 46 /* EnumKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 108 /* l */: return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 25 /* ElseKeyword */ : 9 /* IdentifierName */; + case 110 /* n */: return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 109 /* m */) ? 48 /* EnumKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 110 /* n */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 108 /* l */) ? 32 /* NullKeyword */ : 11 /* IdentifierName */; + case 110 /* n */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 108 /* l */) ? 34 /* NullKeyword */ : 9 /* IdentifierName */; case 116 /* t */: switch (str.charCodeAt(start + 1)) { - case 104 /* h */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 115 /* s */) ? 35 /* ThisKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 101 /* e */) ? 37 /* TrueKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 104 /* h */: return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 115 /* s */) ? 37 /* ThisKeyword */ : 9 /* IdentifierName */; + case 114 /* r */: return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 101 /* e */) ? 39 /* TrueKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 118 /* v */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 100 /* d */) ? 41 /* VoidKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 104 /* h */) ? 43 /* WithKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 118 /* v */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 100 /* d */) ? 43 /* VoidKeyword */ : 9 /* IdentifierName */; + case 119 /* w */: return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 104 /* h */) ? 45 /* WithKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 5: switch (str.charCodeAt(start)) { - case 98 /* b */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 107 /* k */) ? 15 /* BreakKeyword */ : 11 /* IdentifierName */; + case 98 /* b */: return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 107 /* k */) ? 17 /* BreakKeyword */ : 9 /* IdentifierName */; case 99 /* c */: switch (str.charCodeAt(start + 1)) { - case 97 /* a */: - return (str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 104 /* h */) ? 17 /* CatchKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 2) === 97 /* a */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 115 /* s */) ? 44 /* ClassKeyword */ : 11 /* IdentifierName */; - case 111 /* o */: - return (str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */) ? 45 /* ConstKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 97 /* a */: return (str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 104 /* h */) ? 19 /* CatchKeyword */ : 9 /* IdentifierName */; + case 108 /* l */: return (str.charCodeAt(start + 2) === 97 /* a */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 115 /* s */) ? 46 /* ClassKeyword */ : 9 /* IdentifierName */; + case 111 /* o */: return (str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */) ? 47 /* ConstKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 102 /* f */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 101 /* e */) ? 24 /* FalseKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */) ? 50 /* SuperKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 114 /* r */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 119 /* w */) ? 36 /* ThrowKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */) ? 42 /* WhileKeyword */ : 11 /* IdentifierName */; - case 121 /* y */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 100 /* d */) ? 59 /* YieldKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 102 /* f */: return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 101 /* e */) ? 26 /* FalseKeyword */ : 9 /* IdentifierName */; + case 115 /* s */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */) ? 52 /* SuperKeyword */ : 9 /* IdentifierName */; + case 116 /* t */: return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 114 /* r */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 119 /* w */) ? 38 /* ThrowKeyword */ : 9 /* IdentifierName */; + case 119 /* w */: return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */) ? 44 /* WhileKeyword */ : 9 /* IdentifierName */; + case 121 /* y */: return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 100 /* d */) ? 61 /* YieldKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 6: switch (str.charCodeAt(start)) { - case 100 /* d */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 101 /* e */) ? 21 /* DeleteKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 47 /* ExportKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - return (str.charCodeAt(start + 1) === 109 /* m */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 49 /* ImportKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 100 /* d */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 101 /* e */) ? 65 /* ModuleKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 109 /* m */ && str.charCodeAt(start + 3) === 98 /* b */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 114 /* r */) ? 67 /* NumberKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 57 /* PublicKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 110 /* n */) ? 33 /* ReturnKeyword */ : 11 /* IdentifierName */; + case 100 /* d */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 101 /* e */) ? 23 /* DeleteKeyword */ : 9 /* IdentifierName */; + case 101 /* e */: return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 49 /* ExportKeyword */ : 9 /* IdentifierName */; + case 105 /* i */: return (str.charCodeAt(start + 1) === 109 /* m */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 51 /* ImportKeyword */ : 9 /* IdentifierName */; + case 109 /* m */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 100 /* d */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 101 /* e */) ? 67 /* ModuleKeyword */ : 9 /* IdentifierName */; + case 110 /* n */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 109 /* m */ && str.charCodeAt(start + 3) === 98 /* b */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 114 /* r */) ? 69 /* NumberKeyword */ : 9 /* IdentifierName */; + case 112 /* p */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 59 /* PublicKeyword */ : 9 /* IdentifierName */; + case 114 /* r */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 110 /* n */) ? 35 /* ReturnKeyword */ : 9 /* IdentifierName */; case 115 /* s */: switch (str.charCodeAt(start + 1)) { case 116 /* t */: switch (str.charCodeAt(start + 2)) { - case 97 /* a */: - return (str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 58 /* StaticKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 3) === 105 /* i */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 103 /* g */) ? 69 /* StringKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 97 /* a */: return (str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 60 /* StaticKeyword */ : 9 /* IdentifierName */; + case 114 /* r */: return (str.charCodeAt(start + 3) === 105 /* i */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 103 /* g */) ? 71 /* StringKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 119 /* w */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 99 /* c */ && str.charCodeAt(start + 5) === 104 /* h */) ? 34 /* SwitchKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 119 /* w */: return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 99 /* c */ && str.charCodeAt(start + 5) === 104 /* h */) ? 36 /* SwitchKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 116 /* t */: - return (str.charCodeAt(start + 1) === 121 /* y */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 111 /* o */ && str.charCodeAt(start + 5) === 102 /* f */) ? 39 /* TypeOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 116 /* t */: return (str.charCodeAt(start + 1) === 121 /* y */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 111 /* o */ && str.charCodeAt(start + 5) === 102 /* f */) ? 41 /* TypeOfKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 7: switch (str.charCodeAt(start)) { - case 98 /* b */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 97 /* a */ && str.charCodeAt(start + 6) === 110 /* n */) ? 61 /* BooleanKeyword */ : 11 /* IdentifierName */; + case 98 /* b */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 97 /* a */ && str.charCodeAt(start + 6) === 110 /* n */) ? 63 /* BooleanKeyword */ : 9 /* IdentifierName */; case 100 /* d */: switch (str.charCodeAt(start + 1)) { case 101 /* e */: switch (str.charCodeAt(start + 2)) { - case 99 /* c */: - return (str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 63 /* DeclareKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 117 /* u */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 116 /* t */) ? 20 /* DefaultKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 99 /* c */: return (str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 65 /* DeclareKeyword */ : 9 /* IdentifierName */; + case 102 /* f */: return (str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 117 /* u */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 116 /* t */) ? 22 /* DefaultKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - default: - return 11 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 101 /* e */: - return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 100 /* d */ && str.charCodeAt(start + 6) === 115 /* s */) ? 48 /* ExtendsKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 121 /* y */) ? 25 /* FinallyKeyword */ : 11 /* IdentifierName */; + case 101 /* e */: return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 100 /* d */ && str.charCodeAt(start + 6) === 115 /* s */) ? 50 /* ExtendsKeyword */ : 9 /* IdentifierName */; + case 102 /* f */: return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 121 /* y */) ? 27 /* FinallyKeyword */ : 9 /* IdentifierName */; case 112 /* p */: switch (str.charCodeAt(start + 1)) { - case 97 /* a */: - return (str.charCodeAt(start + 2) === 99 /* c */ && str.charCodeAt(start + 3) === 107 /* k */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */) ? 54 /* PackageKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 118 /* v */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 116 /* t */ && str.charCodeAt(start + 6) === 101 /* e */) ? 55 /* PrivateKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 97 /* a */: return (str.charCodeAt(start + 2) === 99 /* c */ && str.charCodeAt(start + 3) === 107 /* k */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */) ? 56 /* PackageKeyword */ : 9 /* IdentifierName */; + case 114 /* r */: return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 118 /* v */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 116 /* t */ && str.charCodeAt(start + 6) === 101 /* e */) ? 57 /* PrivateKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 114 /* r */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 113 /* q */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 66 /* RequireKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 114 /* r */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 113 /* q */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 68 /* RequireKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 8: switch (str.charCodeAt(start)) { - case 99 /* c */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 101 /* e */) ? 18 /* ContinueKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 103 /* g */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 114 /* r */) ? 19 /* DebuggerKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 105 /* i */ && str.charCodeAt(start + 6) === 111 /* o */ && str.charCodeAt(start + 7) === 110 /* n */) ? 27 /* FunctionKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 99 /* c */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 101 /* e */) ? 20 /* ContinueKeyword */ : 9 /* IdentifierName */; + case 100 /* d */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 103 /* g */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 114 /* r */) ? 21 /* DebuggerKeyword */ : 9 /* IdentifierName */; + case 102 /* f */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 105 /* i */ && str.charCodeAt(start + 6) === 111 /* o */ && str.charCodeAt(start + 7) === 110 /* n */) ? 29 /* FunctionKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 9: switch (str.charCodeAt(start)) { - case 105 /* i */: - return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 102 /* f */ && str.charCodeAt(start + 6) === 97 /* a */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 101 /* e */) ? 52 /* InterfaceKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 99 /* c */ && str.charCodeAt(start + 6) === 116 /* t */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 100 /* d */) ? 56 /* ProtectedKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 105 /* i */: return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 102 /* f */ && str.charCodeAt(start + 6) === 97 /* a */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 101 /* e */) ? 54 /* InterfaceKeyword */ : 9 /* IdentifierName */; + case 112 /* p */: return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 99 /* c */ && str.charCodeAt(start + 6) === 116 /* t */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 100 /* d */) ? 58 /* ProtectedKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } case 10: switch (str.charCodeAt(start)) { case 105 /* i */: switch (str.charCodeAt(start + 1)) { - case 109 /* m */: - return (str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 109 /* m */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 110 /* n */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 115 /* s */) ? 51 /* ImplementsKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 99 /* c */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 111 /* o */ && str.charCodeAt(start + 9) === 102 /* f */) ? 30 /* InstanceOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 109 /* m */: return (str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 109 /* m */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 110 /* n */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 115 /* s */) ? 53 /* ImplementsKeyword */ : 9 /* IdentifierName */; + case 110 /* n */: return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 99 /* c */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 111 /* o */ && str.charCodeAt(start + 9) === 102 /* f */) ? 32 /* InstanceOfKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - default: - return 11 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - case 11: - return (str.charCodeAt(start) === 99 /* c */ && str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 111 /* o */ && str.charCodeAt(start + 10) === 114 /* r */) ? 62 /* ConstructorKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + case 11: return (str.charCodeAt(start) === 99 /* c */ && str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 111 /* o */ && str.charCodeAt(start + 10) === 114 /* r */) ? 64 /* ConstructorKeyword */ : 9 /* IdentifierName */; + default: return 9 /* IdentifierName */; } - }; - return ScannerUtilities; - })(); - TypeScript.ScannerUtilities = ScannerUtilities; + } + ScannerUtilities.identifierKind = identifierKind; + })(ScannerUtilities = TypeScript.ScannerUtilities || (TypeScript.ScannerUtilities = {})); })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { @@ -19643,7 +19962,7 @@ var TypeScript; }; SlidingWindow.prototype.peekItemN = function (n) { while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(null)) { + if (!this.addMoreItemsToWindow(undefined)) { return this.defaultValue; } } @@ -19664,22 +19983,12 @@ var TypeScript; var Syntax; (function (Syntax) { Syntax._nextSyntaxID = 1; - function childIndex(parent, child) { - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - var current = TypeScript.childAt(parent, i); - if (current === child) { - return i; - } - } - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childIndex = childIndex; function nodeHasSkippedOrMissingTokens(node) { for (var i = 0; i < TypeScript.childCount(node); i++) { var child = TypeScript.childAt(node, i); if (TypeScript.isToken(child)) { var token = child; - if (token.hasSkippedToken() || (TypeScript.width(token) === 0 && token.kind() !== 10 /* EndOfFileToken */)) { + if (token.hasSkippedToken() || (TypeScript.width(token) === 0 && token.kind() !== 8 /* EndOfFileToken */)) { return true; } } @@ -19688,7 +19997,7 @@ var TypeScript; } Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 14 /* StringLiteral */) { + if (token && token.kind() === 12 /* StringLiteral */) { var text = token.text(); return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); } @@ -19696,7 +20005,7 @@ var TypeScript; } Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 6 /* MultiLineCommentTrivia */) { + if (trivia && trivia.kind() === 4 /* MultiLineCommentTrivia */) { var text = trivia.fullText(); return text.length < 4 || text.substring(text.length - 2) !== "*/"; } @@ -19710,7 +20019,7 @@ var TypeScript; return true; } else if (position === end) { - return trivia.kind() === 7 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); + return trivia.kind() === 5 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); } } return false; @@ -19719,9 +20028,9 @@ var TypeScript; function isEntirelyInsideComment(sourceUnit, position) { var positionedToken = TypeScript.findToken(sourceUnit, position); var fullStart = positionedToken.fullStart(); - var triviaList = null; - var lastTriviaBeforeToken = null; - if (positionedToken.kind() === 10 /* EndOfFileToken */) { + var triviaList = undefined; + var lastTriviaBeforeToken = undefined; + if (positionedToken.kind() === 8 /* EndOfFileToken */) { if (positionedToken.hasLeadingTrivia()) { triviaList = positionedToken.leadingTrivia(); } @@ -19763,45 +20072,17 @@ var TypeScript; function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { var positionedToken = TypeScript.findToken(sourceUnit, position); if (positionedToken) { - if (positionedToken.kind() === 10 /* EndOfFileToken */) { + if (positionedToken.kind() === 8 /* EndOfFileToken */) { positionedToken = TypeScript.previousToken(positionedToken); return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); } else if (position > TypeScript.start(positionedToken)) { - return (position < TypeScript.end(positionedToken) && (positionedToken.kind() === 14 /* StringLiteral */ || positionedToken.kind() === 12 /* RegularExpressionLiteral */)) || (position <= TypeScript.end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); + return (position < TypeScript.end(positionedToken) && (positionedToken.kind() === 12 /* StringLiteral */ || positionedToken.kind() === 10 /* RegularExpressionLiteral */)) || (position <= TypeScript.end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); } } return false; } Syntax.isEntirelyInStringOrRegularExpressionLiteral = isEntirelyInStringOrRegularExpressionLiteral; - function findSkippedTokenOnLeftInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullEnd; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullEnd = TypeScript.fullEnd(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullEnd) { - return trivia.skippedToken(); - } - fullEnd -= triviaWidth; - } - } - return null; - } - function findSkippedTokenOnLeft(positionedToken, position) { - var positionInLeadingTriviaList = (position < TypeScript.start(positionedToken)); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenOnLeft = findSkippedTokenOnLeft; function getAncestorOfKind(positionedToken, kind) { while (positionedToken && positionedToken.parent) { if (positionedToken.parent.kind() === kind) { @@ -19809,21 +20090,24 @@ var TypeScript; } positionedToken = positionedToken.parent; } - return null; + return undefined; } Syntax.getAncestorOfKind = getAncestorOfKind; function hasAncestorOfKind(positionedToken, kind) { - return getAncestorOfKind(positionedToken, kind) !== null; + return !!getAncestorOfKind(positionedToken, kind); } Syntax.hasAncestorOfKind = hasAncestorOfKind; function isIntegerLiteral(expression) { if (expression) { switch (expression.kind()) { - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - expression = expression.operand; - return TypeScript.isToken(expression) && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: + case 169 /* PrefixUnaryExpression */: + var prefixExpr = expression; + if (prefixExpr.operatorToken.kind() == 91 /* PlusToken */ || prefixExpr.operatorToken.kind() === 92 /* MinusToken */) { + expression = prefixExpr.operand; + return TypeScript.isToken(expression) && TypeScript.IntegerUtilities.isInteger(expression.text()); + } + return false; + case 11 /* NumericLiteral */: var text = expression.text(); return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); } @@ -19833,38 +20117,30 @@ var TypeScript; Syntax.isIntegerLiteral = isIntegerLiteral; function containingNode(element) { var current = element.parent; - while (current !== null && !TypeScript.isNode(current)) { + while (current && !TypeScript.isNode(current)) { current = current.parent; } return current; } Syntax.containingNode = containingNode; - function findTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); + function findTokenOnLeft(sourceUnit, position) { + var positionedToken = TypeScript.findToken(sourceUnit, position); var _start = TypeScript.start(positionedToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } if (position > _start) { return positionedToken; } if (positionedToken.fullStart() === 0) { - return null; + return undefined; } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); + return TypeScript.previousToken(positionedToken); } Syntax.findTokenOnLeft = findTokenOnLeft; - function findCompleteTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } + function findCompleteTokenOnLeft(sourceUnit, position) { + var positionedToken = TypeScript.findToken(sourceUnit, position); if (TypeScript.width(positionedToken) > 0 && position >= TypeScript.end(positionedToken)) { return positionedToken; } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); + return TypeScript.previousToken(positionedToken); } Syntax.findCompleteTokenOnLeft = findCompleteTokenOnLeft; function firstTokenInLineContainingPosition(syntaxTree, position) { @@ -19880,7 +20156,7 @@ var TypeScript; Syntax.firstTokenInLineContainingPosition = firstTokenInLineContainingPosition; function isFirstTokenInLine(token, lineMap) { var _previousToken = TypeScript.previousToken(token); - if (_previousToken === null) { + if (_previousToken === undefined) { return true; } return lineMap.getLineNumberFromPosition(TypeScript.end(_previousToken)) !== lineMap.getLineNumberFromPosition(TypeScript.start(token)); @@ -19889,97 +20165,50 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - function isShared(element) { - var kind = element.kind(); - return (kind === 1 /* List */ || kind === 2 /* SeparatedList */) && element.length === 0; - } - TypeScript.isShared = isShared; - function childCount(element) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element.length; - } - else if (kind === 2 /* SeparatedList */) { - return element.length + element.separators.length; - } - else if (kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken) { - return 0; - } - else { - return TypeScript.nodeMetadata[kind].length; - } - } - TypeScript.childCount = childCount; - function childAt(element, index) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element[index]; - } - else if (kind === 2 /* SeparatedList */) { - return (index % 2 === 0) ? element[index / 2] : element.separators[(index - 1) / 2]; - } - else { - return element[TypeScript.nodeMetadata[element.kind()][index]]; - } - } - TypeScript.childAt = childAt; function syntaxTree(element) { if (element) { - TypeScript.Debug.assert(!isShared(element)); while (element) { - if (element.kind() === 120 /* SourceUnit */) { + if (element.kind() === 122 /* SourceUnit */) { return element.syntaxTree; } element = element.parent; } } - return null; + return undefined; } TypeScript.syntaxTree = syntaxTree; function parsedInStrictMode(node) { - var info = node.data; + var info = node.__data; if (info === undefined) { return false; } return (info & 4 /* NodeParsedInStrictModeMask */) !== 0; } TypeScript.parsedInStrictMode = parsedInStrictMode; - function previousToken(token, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (includeSkippedTokens) { - var triviaList = token.leadingTrivia(); - if (triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = TypeScript.start(token); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - } + function previousToken(token) { var start = token.fullStart(); if (start === 0) { - return null; + return undefined; } - return findToken(syntaxTree(token).sourceUnit(), start - 1, includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), start - 1); } TypeScript.previousToken = previousToken; - function findToken(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var endOfFileToken = tryGetEndOfFileAt(element, position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - if (position < 0 || position >= fullWidth(element)) { + function findToken(sourceUnit, position) { + if (position < 0) { throw TypeScript.Errors.argumentOutOfRange("position"); } - var positionedToken = findTokenWorker(element, position); - if (includeSkippedTokens) { - return findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; + var token = findTokenWorker(sourceUnit, 0, position); + if (token) { + TypeScript.Debug.assert(token.fullWidth() > 0); + return token; } - return positionedToken; + if (position === fullWidth(sourceUnit)) { + return sourceUnit.endOfFileToken; + } + if (position > fullWidth(sourceUnit)) { + throw TypeScript.Errors.argumentOutOfRange("position"); + } + throw TypeScript.Errors.invalidOperation(); } TypeScript.findToken = findToken; function findSkippedTokenInPositionedToken(positionedToken, position) { @@ -19996,7 +20225,7 @@ var TypeScript; } TypeScript.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; + var triviaList = undefined; var fullStart; if (lookInLeadingTriviaList) { triviaList = positionedToken.leadingTrivia(); @@ -20016,61 +20245,41 @@ var TypeScript; fullStart += triviaWidth; } } - return null; + return undefined; } - function findTokenWorker(element, position) { + function findTokenWorker(element, elementPosition, position) { if (isToken(element)) { - TypeScript.Debug.assert(fullWidth(element) > 0); return element; } - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation(); - } - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); - if (child !== null) { + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + var child = TypeScript.childAt(element, i); + if (child) { var childFullWidth = fullWidth(child); - if (childFullWidth > 0) { - var childFullStart = fullStart(child); - if (position >= childFullStart) { - var childFullEnd = childFullStart + childFullWidth; - if (position < childFullEnd) { - return findTokenWorker(child, position); - } - } + var elementEndPosition = elementPosition + childFullWidth; + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); } + elementPosition = elementEndPosition; } } - throw TypeScript.Errors.invalidOperation(); + return undefined; } function tryGetEndOfFileAt(element, position) { - if (element.kind() === 120 /* SourceUnit */ && position === fullWidth(element)) { + if (element.kind() === 122 /* SourceUnit */ && position === fullWidth(element)) { var sourceUnit = element; return sourceUnit.endOfFileToken; } - return null; + return undefined; } - function nextToken(token, text, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (token.kind() === 10 /* EndOfFileToken */) { - return null; + function nextToken(token, text) { + if (token.kind() === 8 /* EndOfFileToken */) { + return undefined; } - if (includeSkippedTokens) { - var triviaList = token.trailingTrivia(text); - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - } - } - } - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token), includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), fullEnd(token)); } TypeScript.nextToken = nextToken; function isNode(element) { - if (element !== null) { + if (element) { var kind = element.kind(); return kind >= TypeScript.SyntaxKind.FirstNode && kind <= TypeScript.SyntaxKind.LastNode; } @@ -20081,24 +20290,17 @@ var TypeScript; return kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken; } function isToken(element) { - if (element !== null) { + if (element) { return isTokenKind(element.kind()); } return false; } TypeScript.isToken = isToken; function isList(element) { - return element !== null && element.kind() === 1 /* List */; + return element instanceof Array; } TypeScript.isList = isList; - function isSeparatedList(element) { - return element !== null && element.kind() === 2 /* SeparatedList */; - } - TypeScript.isSeparatedList = isSeparatedList; function syntaxID(element) { - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation("Should not use shared syntax element as a key."); - } var obj = element; if (obj._syntaxID === undefined) { obj._syntaxID = TypeScript.Syntax._nextSyntaxID++; @@ -20112,8 +20314,8 @@ var TypeScript; elements.push(element.fullText(text)); } else { - for (var i = 0, n = childCount(element); i < n; i++) { - collectTextElements(childAt(element, i), elements, text); + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + collectTextElements(TypeScript.childAt(element, i), elements, text); } } } @@ -20141,65 +20343,38 @@ var TypeScript; if (element) { var kind = element.kind(); if (isTokenKind(kind)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; + return element.fullWidth() > 0 || kind === 8 /* EndOfFileToken */ ? element : undefined; } - if (kind === 1 /* List */) { - var array = element; - for (var i = 0, n = array.length; i < n; i++) { - var token = firstToken(array[i]); - if (token) { - return token; - } - } - } - else if (kind === 2 /* SeparatedList */) { - var array = element; - var separators = array.separators; - for (var i = 0, n = array.length + separators.length; i < n; i++) { - var token = firstToken(i % 2 === 0 ? array[i / 2] : separators[(i - 1) / 2]); - if (token) { - return token; - } - } - } - else { - var metadata = TypeScript.nodeMetadata[kind]; - for (var i = 0, n = metadata.length; i < n; i++) { - var child = element[metadata[i]]; - var token = firstToken(child); - if (token) { - return token; - } - } - if (element.kind() === 120 /* SourceUnit */) { - return element.endOfFileToken; + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + var token = firstToken(TypeScript.childAt(element, i)); + if (token) { + return token; } } } - return null; + return undefined; } TypeScript.firstToken = firstToken; function lastToken(element) { if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; + return fullWidth(element) > 0 || element.kind() === 8 /* EndOfFileToken */ ? element : undefined; } - if (element.kind() === 120 /* SourceUnit */) { + if (element.kind() === 122 /* SourceUnit */) { return element.endOfFileToken; } - for (var i = childCount(element) - 1; i >= 0; i--) { - var child = childAt(element, i); - if (child !== null) { + for (var i = TypeScript.childCount(element) - 1; i >= 0; i--) { + var child = TypeScript.childAt(element, i); + if (child) { var token = lastToken(child); if (token) { return token; } } } - return null; + return undefined; } TypeScript.lastToken = lastToken; function fullStart(element) { - TypeScript.Debug.assert(!isShared(element)); var token = isToken(element) ? element : firstToken(element); return token ? token.fullStart() : -1; } @@ -20208,9 +20383,6 @@ var TypeScript; if (isToken(element)) { return element.fullWidth(); } - if (isShared(element)) { - return 0; - } var info = data(element); return info >>> 3 /* NodeFullWidthShift */; } @@ -20219,31 +20391,27 @@ var TypeScript; if (isToken(element)) { return element.isIncrementallyUnusable(); } - if (isShared(element)) { - return false; - } return (data(element) & 2 /* NodeIncrementallyUnusableMask */) !== 0; } TypeScript.isIncrementallyUnusable = isIncrementallyUnusable; function data(element) { - TypeScript.Debug.assert(isNode(element) || isList(element) || isSeparatedList(element)); var dataElement = element; - var info = dataElement.data; + var info = dataElement.__data; if (info === undefined) { info = 0; } if ((info & 1 /* NodeDataComputed */) === 0) { info |= computeData(element); - dataElement.data = info; + dataElement.__data = info; } return info; } function computeData(element) { - var slotCount = childCount(element); + var slotCount = TypeScript.childCount(element); var fullWidth = 0; - var isIncrementallyUnusable = slotCount === 0; + var isIncrementallyUnusable = slotCount === 0 && !isList(element); for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); + var child = TypeScript.childAt(element, i); if (child) { fullWidth += TypeScript.fullWidth(child); isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); @@ -20276,7 +20444,7 @@ var TypeScript; if (token1 === token2) { return false; } - if (token1 === null || token2 === null) { + if (!token1 || !token2) { return true; } var lineMap = text.lineMap(); @@ -20289,10 +20457,10 @@ var TypeScript; var SyntaxFacts; (function (SyntaxFacts) { function isDirectivePrologueElement(node) { - if (node.kind() === 150 /* ExpressionStatement */) { + if (node.kind() === 154 /* ExpressionStatement */) { var expressionStatement = node; var expression = expressionStatement.expression; - if (expression.kind() === 14 /* StringLiteral */) { + if (expression.kind() === 12 /* StringLiteral */) { return true; } } @@ -20308,14 +20476,14 @@ var TypeScript; SyntaxFacts.isUseStrictDirective = isUseStrictDirective; function isIdentifierNameOrAnyKeyword(token) { var tokenKind = token.kind(); - return tokenKind === 11 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); + return tokenKind === 9 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); } SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; function isAccessibilityModifier(kind) { switch (kind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: return true; } return false; @@ -20324,126 +20492,94 @@ var TypeScript; })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); })(TypeScript || (TypeScript = {})); var TypeScript; +(function (TypeScript) { + function separatorCount(list) { + return list.length >> 1; + } + TypeScript.separatorCount = separatorCount; + function nonSeparatorCount(list) { + return (list.length + 1) >> 1; + } + TypeScript.nonSeparatorCount = nonSeparatorCount; + function separatorAt(list, index) { + return list[(index << 1) + 1]; + } + TypeScript.separatorAt = separatorAt; + function nonSeparatorAt(list, index) { + return list[index << 1]; + } + TypeScript.nonSeparatorAt = nonSeparatorAt; +})(TypeScript || (TypeScript = {})); +var TypeScript; (function (TypeScript) { var Syntax; (function (Syntax) { - var _emptyList = []; - var _emptySeparatedList = []; - var _emptySeparators = []; - _emptySeparatedList.separators = _emptySeparators; - function assertEmptyLists() { - } - Array.prototype.kind = function () { - return this.separators === undefined ? 1 /* List */ : 2 /* SeparatedList */; - }; - Array.prototype.separatorCount = function () { - assertEmptyLists(); - return this.separators.length; - }; - Array.prototype.separatorAt = function (index) { - assertEmptyLists(); - return this.separators[index]; - }; - function emptyList() { - return _emptyList; - } - Syntax.emptyList = emptyList; - function emptySeparatedList() { - return _emptySeparatedList; - } - Syntax.emptySeparatedList = emptySeparatedList; - function list(nodes) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptyList(); + function addArrayFunction(name, func) { + if (Object.defineProperty) { + Object.defineProperty(Array.prototype, name, { value: func, writable: true }); } + else { + Array.prototype[name] = func; + } + } + addArrayFunction("kind", function () { + return 1 /* List */; + }); + function list(nodes) { for (var i = 0, n = nodes.length; i < n; i++) { nodes[i].parent = nodes; } return nodes; } Syntax.list = list; - function separatedList(nodes, separators) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptySeparatedList(); + function separatedList(nodesAndTokens) { + for (var i = 0, n = nodesAndTokens.length; i < n; i++) { + nodesAndTokens[i].parent = nodesAndTokens; } - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - for (var i = 0, n = separators.length; i < n; i++) { - separators[i].parent = nodes; - } - nodes.separators = separators.length === 0 ? _emptySeparators : separators; - return nodes; + return nodesAndTokens; } Syntax.separatedList = separatedList; - function nonSeparatorIndexOf(list, ast) { - for (var i = 0, n = list.length; i < n; i++) { - if (list[i] === ast) { - return i; - } - } - return -1; - } - Syntax.nonSeparatorIndexOf = nonSeparatorIndexOf; })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); })(TypeScript || (TypeScript = {})); var TypeScript; -(function (TypeScript) { - var SyntaxNode = (function () { - function SyntaxNode(data) { - if (data) { - this.data = data; - } - } - SyntaxNode.prototype.kind = function () { - return this.__kind; - }; - return SyntaxNode; - })(); - TypeScript.SyntaxNode = SyntaxNode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.nodeMetadata = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], ["moduleElements", "endOfFileToken"], ["left", "dotToken", "right"], ["openBraceToken", "typeMembers", "closeBraceToken"], ["typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["type", "openBracketToken", "closeBracketToken"], ["newKeyword", "typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["name", "typeArgumentList"], ["typeOfKeyword", "name"], ["openBracketToken", "types", "closeBracketToken"], ["modifiers", "interfaceKeyword", "identifier", "typeParameterList", "heritageClauses", "body"], ["modifiers", "functionKeyword", "identifier", "callSignature", "block", "semicolonToken"], ["modifiers", "moduleKeyword", "name", "stringLiteral", "openBraceToken", "moduleElements", "closeBraceToken"], ["modifiers", "classKeyword", "identifier", "typeParameterList", "heritageClauses", "openBraceToken", "classElements", "closeBraceToken"], ["modifiers", "enumKeyword", "identifier", "openBraceToken", "enumElements", "closeBraceToken"], ["modifiers", "importKeyword", "identifier", "equalsToken", "moduleReference", "semicolonToken"], ["exportKeyword", "equalsToken", "identifier", "semicolonToken"], ["modifiers", "propertyName", "callSignature", "block", "semicolonToken"], ["modifiers", "variableDeclarator", "semicolonToken"], ["modifiers", "constructorKeyword", "callSignature", "block", "semicolonToken"], ["modifiers", "indexSignature", "semicolonToken"], ["modifiers", "getKeyword", "propertyName", "callSignature", "block"], ["modifiers", "setKeyword", "propertyName", "callSignature", "block"], ["propertyName", "questionToken", "typeAnnotation"], ["typeParameterList", "parameterList", "typeAnnotation"], ["newKeyword", "callSignature"], ["openBracketToken", "parameters", "closeBracketToken", "typeAnnotation"], ["propertyName", "questionToken", "callSignature"], ["openBraceToken", "statements", "closeBraceToken"], ["ifKeyword", "openParenToken", "condition", "closeParenToken", "statement", "elseClause"], ["modifiers", "variableDeclaration", "semicolonToken"], ["expression", "semicolonToken"], ["returnKeyword", "expression", "semicolonToken"], ["switchKeyword", "openParenToken", "expression", "closeParenToken", "openBraceToken", "switchClauses", "closeBraceToken"], ["breakKeyword", "identifier", "semicolonToken"], ["continueKeyword", "identifier", "semicolonToken"], ["forKeyword", "openParenToken", "variableDeclaration", "initializer", "firstSemicolonToken", "condition", "secondSemicolonToken", "incrementor", "closeParenToken", "statement"], ["forKeyword", "openParenToken", "variableDeclaration", "left", "inKeyword", "expression", "closeParenToken", "statement"], ["semicolonToken"], ["throwKeyword", "expression", "semicolonToken"], ["whileKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["tryKeyword", "block", "catchClause", "finallyClause"], ["identifier", "colonToken", "statement"], ["doKeyword", "statement", "whileKeyword", "openParenToken", "condition", "closeParenToken", "semicolonToken"], ["debuggerKeyword", "semicolonToken"], ["withKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["deleteKeyword", "expression"], ["typeOfKeyword", "expression"], ["voidKeyword", "expression"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["condition", "questionToken", "whenTrue", "colonToken", "whenFalse"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["operand", "operatorToken"], ["operand", "operatorToken"], ["expression", "dotToken", "name"], ["expression", "argumentList"], ["openBracketToken", "expressions", "closeBracketToken"], ["openBraceToken", "propertyAssignments", "closeBraceToken"], ["newKeyword", "expression", "argumentList"], ["openParenToken", "expression", "closeParenToken"], ["callSignature", "equalsGreaterThanToken", "block", "expression"], ["parameter", "equalsGreaterThanToken", "block", "expression"], ["lessThanToken", "type", "greaterThanToken", "expression"], ["expression", "openBracketToken", "argumentExpression", "closeBracketToken"], ["functionKeyword", "identifier", "callSignature", "block"], [], ["varKeyword", "variableDeclarators"], ["propertyName", "typeAnnotation", "equalsValueClause"], ["typeArgumentList", "openParenToken", "arguments", "closeParenToken"], ["openParenToken", "parameters", "closeParenToken"], ["lessThanToken", "typeArguments", "greaterThanToken"], ["lessThanToken", "typeParameters", "greaterThanToken"], ["extendsOrImplementsKeyword", "typeNames"], ["extendsOrImplementsKeyword", "typeNames"], ["equalsToken", "value"], ["caseKeyword", "expression", "colonToken", "statements"], ["defaultKeyword", "colonToken", "statements"], ["elseKeyword", "statement"], ["catchKeyword", "openParenToken", "identifier", "typeAnnotation", "closeParenToken", "block"], ["finallyKeyword", "block"], ["identifier", "constraint"], ["extendsKeyword", "typeOrExpression"], ["propertyName", "colonToken", "expression"], ["propertyName", "callSignature", "block"], ["dotDotDotToken", "modifiers", "identifier", "questionToken", "typeAnnotation", "equalsValueClause"], ["propertyName", "equalsValueClause"], ["colonToken", "type"], ["requireKeyword", "openParenToken", "stringLiteral", "closeParenToken"], ["moduleName"],]; -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { function tokenValue(token) { if (token.fullWidth() === 0) { - return null; + return undefined; } var kind = token.kind(); var text = token.text(); - if (kind === 11 /* IdentifierName */) { + if (kind === 9 /* IdentifierName */) { return massageEscapes(text); } switch (kind) { - case 37 /* TrueKeyword */: + case 39 /* TrueKeyword */: return true; - case 24 /* FalseKeyword */: + case 26 /* FalseKeyword */: return false; - case 32 /* NullKeyword */: - return null; + case 34 /* NullKeyword */: + return undefined; } if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { return TypeScript.SyntaxFacts.getText(kind); } - if (kind === 13 /* NumericLiteral */) { + if (kind === 11 /* NumericLiteral */) { return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); } - else if (kind === 14 /* StringLiteral */) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - return massageEscapes(text.substr(1, text.length - 2)); - } - else { - return massageEscapes(text.substr(1)); - } + else if (kind === 12 /* StringLiteral */) { + return (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) ? massageEscapes(text.substr(1, text.length - "''".length)) : massageEscapes(text.substr(1)); } - else if (kind === 12 /* RegularExpressionLiteral */) { + else if (kind === 13 /* NoSubstitutionTemplateToken */ || kind === 16 /* TemplateEndToken */) { + return (text.length > 1 && text.charCodeAt(text.length - 1) === 96 /* backtick */) ? massageTemplate(text.substr(1, text.length - "``".length)) : massageTemplate(text.substr(1)); + } + else if (kind === 14 /* TemplateStartToken */ || kind === 15 /* TemplateMiddleToken */) { + return massageTemplate(text.substr(1, text.length - "`${".length)); + } + else if (kind === 10 /* RegularExpressionLiteral */) { return regularExpressionValue(text); } - else if (kind === 10 /* EndOfFileToken */ || kind === 9 /* ErrorToken */) { - return null; + else if (kind === 8 /* EndOfFileToken */ || kind === 7 /* ErrorToken */) { + return undefined; } else { throw TypeScript.Errors.invalidOperation(); @@ -20452,9 +20588,13 @@ var TypeScript; TypeScript.tokenValue = tokenValue; function tokenValueText(token) { var value = tokenValue(token); - return value === null ? "" : massageDisallowedIdentifiers(value.toString()); + return value === undefined ? "" : massageDisallowedIdentifiers(value.toString()); } TypeScript.tokenValueText = tokenValueText; + function massageTemplate(text) { + text = text.replace("\r\n", "\n").replace("\r", "\n"); + return massageEscapes(text); + } function massageEscapes(text) { return text.indexOf("\\") >= 0 ? convertEscapes(text) : text; } @@ -20467,7 +20607,7 @@ var TypeScript; return new RegExp(body, flags); } catch (e) { - return null; + return undefined; } } function massageDisallowedIdentifiers(text) { @@ -20532,12 +20672,12 @@ var TypeScript; } characterArray.push(ch); if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); characterArray.length = 0; } } if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); } return result; } @@ -20586,6 +20726,15 @@ var TypeScript; EmptyToken.prototype.kind = function () { return this._kind; }; + EmptyToken.prototype.childCount = function () { + return 0; + }; + EmptyToken.prototype.childAt = function (index) { + throw TypeScript.Errors.invalidOperation(); + }; + EmptyToken.prototype.accept = function (visitor) { + return visitor.visitToken(this); + }; EmptyToken.prototype.clone = function () { return new EmptyToken(this.kind()); }; @@ -20600,15 +20749,15 @@ var TypeScript; }; EmptyToken.prototype.position = function () { var previousElement = this.previousNonZeroWidthElement(); - return previousElement === null ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); + return !previousElement ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); }; EmptyToken.prototype.previousNonZeroWidthElement = function () { var current = this; while (true) { var parent = current.parent; - if (parent === null) { - TypeScript.Debug.assert(current.kind() === 120 /* SourceUnit */, "We had a node without a parent that was not the root node!"); - return null; + if (parent === undefined) { + TypeScript.Debug.assert(current.kind() === 122 /* SourceUnit */, "We had a node without a parent that was not the root node!"); + return undefined; } for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { if (TypeScript.childAt(parent, i) === current) { @@ -20684,6 +20833,15 @@ var TypeScript; RealizedToken.prototype.kind = function () { return this._kind; }; + RealizedToken.prototype.childCount = function () { + return 0; + }; + RealizedToken.prototype.childAt = function (index) { + throw TypeScript.Errors.invalidOperation(); + }; + RealizedToken.prototype.accept = function (visitor) { + return visitor.visitToken(this); + }; RealizedToken.prototype.clone = function () { return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); }; @@ -20739,11 +20897,20 @@ var TypeScript; this.underlyingToken = underlyingToken; } ConvertedKeywordToken.prototype.kind = function () { - return 11 /* IdentifierName */; + return 9 /* IdentifierName */; }; ConvertedKeywordToken.prototype.setFullStart = function (fullStart) { this.underlyingToken.setFullStart(fullStart); }; + ConvertedKeywordToken.prototype.childCount = function () { + return 0; + }; + ConvertedKeywordToken.prototype.childAt = function (index) { + throw TypeScript.Errors.invalidOperation(); + }; + ConvertedKeywordToken.prototype.accept = function (visitor) { + return visitor.visitToken(this); + }; ConvertedKeywordToken.prototype.fullStart = function () { return this.underlyingToken.fullStart(); }; @@ -20832,23 +20999,23 @@ var TypeScript; throw TypeScript.Errors.abstract(); }; AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 4 /* WhitespaceTrivia */; + return this.kind() === 2 /* WhitespaceTrivia */; }; AbstractTrivia.prototype.isComment = function () { - return this.kind() === 7 /* SingleLineCommentTrivia */ || this.kind() === 6 /* MultiLineCommentTrivia */; + return this.kind() === 5 /* SingleLineCommentTrivia */ || this.kind() === 4 /* MultiLineCommentTrivia */; }; AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 5 /* NewLineTrivia */; + return this.kind() === 3 /* NewLineTrivia */; }; AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 8 /* SkippedTokenTrivia */; + return this.kind() === 6 /* SkippedTokenTrivia */; }; return AbstractTrivia; })(); var SkippedTokenTrivia = (function (_super) { __extends(SkippedTokenTrivia, _super); function SkippedTokenTrivia(_skippedToken, _fullText) { - _super.call(this, 8 /* SkippedTokenTrivia */); + _super.call(this, 6 /* SkippedTokenTrivia */); this._skippedToken = _skippedToken; this._fullText = _fullText; _skippedToken.parent = this; @@ -20938,9 +21105,6 @@ var TypeScript; var EmptyTriviaList = (function () { function EmptyTriviaList() { } - EmptyTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; EmptyTriviaList.prototype.isShared = function () { return true; }; @@ -20979,16 +21143,13 @@ var TypeScript; ; Syntax.emptyTriviaList = new EmptyTriviaList(); function isComment(trivia) { - return trivia.kind() === 6 /* MultiLineCommentTrivia */ || trivia.kind() === 7 /* SingleLineCommentTrivia */; + return trivia.kind() === 4 /* MultiLineCommentTrivia */ || trivia.kind() === 5 /* SingleLineCommentTrivia */; } var SingletonSyntaxTriviaList = (function () { function SingletonSyntaxTriviaList(item) { this.item = item.clone(); this.item.parent = this; } - SingletonSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; SingletonSyntaxTriviaList.prototype.isShared = function () { return false; }; @@ -21014,10 +21175,10 @@ var TypeScript; return isComment(this.item); }; SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 5 /* NewLineTrivia */; + return this.item.kind() === 3 /* NewLineTrivia */; }; SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 8 /* SkippedTokenTrivia */; + return this.item.kind() === 6 /* SkippedTokenTrivia */; }; SingletonSyntaxTriviaList.prototype.toArray = function () { return [this.item]; @@ -21036,9 +21197,6 @@ var TypeScript; return cloned; }); } - NormalSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; NormalSyntaxTriviaList.prototype.isShared = function () { return false; }; @@ -21074,7 +21232,7 @@ var TypeScript; }; NormalSyntaxTriviaList.prototype.hasNewLine = function () { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 5 /* NewLineTrivia */) { + if (this.trivia[i].kind() === 3 /* NewLineTrivia */) { return true; } } @@ -21082,7 +21240,7 @@ var TypeScript; }; NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 8 /* SkippedTokenTrivia */) { + if (this.trivia[i].kind() === 6 /* SkippedTokenTrivia */) { return true; } } @@ -21097,7 +21255,7 @@ var TypeScript; return NormalSyntaxTriviaList; })(); function triviaList(trivia) { - if (trivia === undefined || trivia === null || trivia.length === 0) { + if (!trivia || trivia.length === 0) { return Syntax.emptyTriviaList; } if (trivia.length === 1) { @@ -21115,22 +21273,22 @@ var TypeScript; } SyntaxUtilities.isAnyFunctionExpressionOrDeclaration = function (ast) { switch (ast.kind()) { - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 223 /* FunctionExpression */: - case 130 /* FunctionDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 242 /* FunctionPropertyAssignment */: - case 138 /* ConstructorDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: + case 183 /* SimpleArrowFunctionExpression */: + case 182 /* ParenthesizedArrowFunctionExpression */: + case 186 /* FunctionExpression */: + case 134 /* FunctionDeclaration */: + case 140 /* MemberFunctionDeclaration */: + case 207 /* FunctionPropertyAssignment */: + case 142 /* ConstructorDeclaration */: + case 144 /* GetAccessor */: + case 145 /* SetAccessor */: return true; } return false; }; SyntaxUtilities.isLastTokenOnLine = function (token, text) { var _nextToken = TypeScript.nextToken(token, text); - if (_nextToken === null) { + if (_nextToken === undefined) { return true; } var lineMap = text.lineMap(); @@ -21141,100 +21299,24 @@ var TypeScript; SyntaxUtilities.isLeftHandSizeExpression = function (element) { if (element) { switch (element.kind()) { - case 213 /* MemberAccessExpression */: - case 222 /* ElementAccessExpression */: - case 217 /* ObjectCreationExpression */: - case 214 /* InvocationExpression */: - case 215 /* ArrayLiteralExpression */: - case 218 /* ParenthesizedExpression */: - case 216 /* ObjectLiteralExpression */: - case 223 /* FunctionExpression */: - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - return true; - } - } - return false; - }; - SyntaxUtilities.isExpression = function (element) { - if (element) { - switch (element.kind()) { - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - case 167 /* BitwiseNotExpression */: - case 168 /* LogicalNotExpression */: - case 169 /* PreIncrementExpression */: - case 170 /* PreDecrementExpression */: - case 171 /* DeleteExpression */: - case 172 /* TypeOfExpression */: - case 173 /* VoidExpression */: - case 174 /* CommaExpression */: - case 175 /* AssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 183 /* OrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* ConditionalExpression */: - case 188 /* LogicalOrExpression */: - case 189 /* LogicalAndExpression */: - case 190 /* BitwiseOrExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 192 /* BitwiseAndExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - case 211 /* PostIncrementExpression */: - case 212 /* PostDecrementExpression */: - case 213 /* MemberAccessExpression */: - case 214 /* InvocationExpression */: - case 215 /* ArrayLiteralExpression */: - case 216 /* ObjectLiteralExpression */: - case 217 /* ObjectCreationExpression */: - case 218 /* ParenthesizedExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - case 221 /* CastExpression */: - case 222 /* ElementAccessExpression */: - case 223 /* FunctionExpression */: - case 224 /* OmittedExpression */: + case 176 /* MemberAccessExpression */: + case 185 /* ElementAccessExpression */: + case 189 /* TemplateAccessExpression */: + case 180 /* ObjectCreationExpression */: + case 177 /* InvocationExpression */: + case 178 /* ArrayLiteralExpression */: + case 181 /* ParenthesizedExpression */: + case 179 /* ObjectLiteralExpression */: + case 186 /* FunctionExpression */: + case 9 /* IdentifierName */: + case 10 /* RegularExpressionLiteral */: + case 11 /* NumericLiteral */: + case 12 /* StringLiteral */: + case 26 /* FalseKeyword */: + case 34 /* NullKeyword */: + case 37 /* ThisKeyword */: + case 39 /* TrueKeyword */: + case 52 /* SuperKeyword */: return true; } } @@ -21243,8 +21325,8 @@ var TypeScript; SyntaxUtilities.isSwitchClause = function (element) { if (element) { switch (element.kind()) { - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: + case 198 /* CaseSwitchClause */: + case 199 /* DefaultSwitchClause */: return true; } } @@ -21253,11 +21335,11 @@ var TypeScript; SyntaxUtilities.isTypeMember = function (element) { if (element) { switch (element.kind()) { - case 144 /* ConstructSignature */: - case 146 /* MethodSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 143 /* CallSignature */: + case 148 /* ConstructSignature */: + case 150 /* MethodSignature */: + case 149 /* IndexSignature */: + case 146 /* PropertySignature */: + case 147 /* CallSignature */: return true; } } @@ -21266,13 +21348,13 @@ var TypeScript; SyntaxUtilities.isClassElement = function (element) { if (element) { switch (element.kind()) { - case 138 /* ConstructorDeclaration */: - case 139 /* IndexMemberDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 136 /* MemberFunctionDeclaration */: - case 137 /* MemberVariableDeclaration */: + case 142 /* ConstructorDeclaration */: + case 143 /* IndexMemberDeclaration */: + case 140 /* MemberFunctionDeclaration */: + case 144 /* GetAccessor */: + case 145 /* SetAccessor */: + case 140 /* MemberFunctionDeclaration */: + case 141 /* MemberVariableDeclaration */: return true; } } @@ -21281,31 +21363,31 @@ var TypeScript; SyntaxUtilities.isModuleElement = function (element) { if (element) { switch (element.kind()) { - case 134 /* ImportDeclaration */: - case 135 /* ExportAssignment */: - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 150 /* ExpressionStatement */: - case 158 /* ThrowStatement */: - case 151 /* ReturnStatement */: - case 152 /* SwitchStatement */: - case 153 /* BreakStatement */: - case 154 /* ContinueStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 164 /* WithStatement */: - case 157 /* EmptyStatement */: - case 160 /* TryStatement */: - case 161 /* LabeledStatement */: - case 162 /* DoStatement */: - case 163 /* DebuggerStatement */: + case 138 /* ImportDeclaration */: + case 139 /* ExportAssignment */: + case 136 /* ClassDeclaration */: + case 133 /* InterfaceDeclaration */: + case 135 /* ModuleDeclaration */: + case 137 /* EnumDeclaration */: + case 134 /* FunctionDeclaration */: + case 153 /* VariableStatement */: + case 151 /* Block */: + case 152 /* IfStatement */: + case 154 /* ExpressionStatement */: + case 162 /* ThrowStatement */: + case 155 /* ReturnStatement */: + case 156 /* SwitchStatement */: + case 157 /* BreakStatement */: + case 158 /* ContinueStatement */: + case 160 /* ForInStatement */: + case 159 /* ForStatement */: + case 163 /* WhileStatement */: + case 168 /* WithStatement */: + case 161 /* EmptyStatement */: + case 164 /* TryStatement */: + case 165 /* LabeledStatement */: + case 166 /* DoStatement */: + case 167 /* DebuggerStatement */: return true; } } @@ -21314,25 +21396,25 @@ var TypeScript; SyntaxUtilities.isStatement = function (element) { if (element) { switch (element.kind()) { - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 150 /* ExpressionStatement */: - case 158 /* ThrowStatement */: - case 151 /* ReturnStatement */: - case 152 /* SwitchStatement */: - case 153 /* BreakStatement */: - case 154 /* ContinueStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 164 /* WithStatement */: - case 157 /* EmptyStatement */: - case 160 /* TryStatement */: - case 161 /* LabeledStatement */: - case 162 /* DoStatement */: - case 163 /* DebuggerStatement */: + case 134 /* FunctionDeclaration */: + case 153 /* VariableStatement */: + case 151 /* Block */: + case 152 /* IfStatement */: + case 154 /* ExpressionStatement */: + case 162 /* ThrowStatement */: + case 155 /* ReturnStatement */: + case 156 /* SwitchStatement */: + case 157 /* BreakStatement */: + case 158 /* ContinueStatement */: + case 160 /* ForInStatement */: + case 159 /* ForStatement */: + case 163 /* WhileStatement */: + case 168 /* WithStatement */: + case 161 /* EmptyStatement */: + case 164 /* TryStatement */: + case 165 /* LabeledStatement */: + case 166 /* DoStatement */: + case 167 /* DebuggerStatement */: return true; } } @@ -21341,11 +21423,11 @@ var TypeScript; SyntaxUtilities.isAngleBracket = function (positionedElement) { var element = positionedElement; var parent = positionedElement.parent; - if (parent !== null && (element.kind() === 80 /* LessThanToken */ || element.kind() === 81 /* GreaterThanToken */)) { + if (parent && (element.kind() === 82 /* LessThanToken */ || element.kind() === 83 /* GreaterThanToken */)) { switch (parent.kind()) { - case 229 /* TypeArgumentList */: - case 230 /* TypeParameterList */: - case 221 /* CastExpression */: + case 194 /* TypeArgumentList */: + case 195 /* TypeParameterList */: + case 184 /* CastExpression */: return true; } } @@ -21358,26 +21440,26 @@ var TypeScript; return token; } } - return null; + return undefined; }; SyntaxUtilities.containsToken = function (list, kind) { - return SyntaxUtilities.getToken(list, kind) !== null; + return !!SyntaxUtilities.getToken(list, kind); }; SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; + return !!SyntaxUtilities.getExportKeyword(moduleElement); }; SyntaxUtilities.getExportKeyword = function (moduleElement) { switch (moduleElement.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 133 /* EnumDeclaration */: - case 129 /* InterfaceDeclaration */: - case 134 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 47 /* ExportKeyword */); + case 135 /* ModuleDeclaration */: + case 136 /* ClassDeclaration */: + case 134 /* FunctionDeclaration */: + case 153 /* VariableStatement */: + case 137 /* EnumDeclaration */: + case 133 /* InterfaceDeclaration */: + case 138 /* ImportDeclaration */: + return SyntaxUtilities.getToken(moduleElement.modifiers, 49 /* ExportKeyword */); default: - return null; + return undefined; } }; SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { @@ -21386,24 +21468,24 @@ var TypeScript; } var node = positionNode; switch (node.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 133 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { + case 135 /* ModuleDeclaration */: + case 136 /* ClassDeclaration */: + case 134 /* FunctionDeclaration */: + case 153 /* VariableStatement */: + case 137 /* EnumDeclaration */: + if (SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */)) { return true; } - case 134 /* ImportDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 137 /* MemberVariableDeclaration */: + case 138 /* ImportDeclaration */: + case 142 /* ConstructorDeclaration */: + case 140 /* MemberFunctionDeclaration */: + case 144 /* GetAccessor */: + case 145 /* SetAccessor */: + case 141 /* MemberVariableDeclaration */: if (SyntaxUtilities.isClassElement(node) || SyntaxUtilities.isModuleElement(node)) { return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); } - case 244 /* EnumElement */: + case 209 /* EnumElement */: return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(TypeScript.Syntax.containingNode(positionNode))); default: return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); @@ -21415,230 +21497,897 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - function visitNodeOrToken(visitor, element) { - if (element === null) { - return null; + var childCountArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 5, 2, 2, 3, 3, 3, 6, 6, 7, 8, 6, 6, 4, 5, 3, 5, 3, 5, 5, 3, 3, 2, 4, 3, 3, 6, 3, 2, 3, 7, 3, 3, 10, 8, 1, 3, 5, 4, 3, 7, 2, 5, 2, 2, 2, 2, 5, 3, 2, 3, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 2, 2, 2, 3, 4, 3, 3, 3, 2, 2, 4, 3, 2, 6, 2, 2, 2, 2, 3, 3, 6, 2, 2, 4, 1]; + function childCount(element) { + if (TypeScript.isList(element)) { + return element.length; } - if (TypeScript.isToken(element)) { - return visitor.visitToken(element); + return childCountArray[element.kind()]; + } + TypeScript.childCount = childCount; + function sourceUnitChildAt(node, index) { + switch (index) { + case 0: return node.moduleElements; + case 1: return node.endOfFileToken; + } + } + function qualifiedNameChildAt(node, index) { + switch (index) { + case 0: return node.left; + case 1: return node.dotToken; + case 2: return node.right; + } + } + function objectTypeChildAt(node, index) { + switch (index) { + case 0: return node.openBraceToken; + case 1: return node.typeMembers; + case 2: return node.closeBraceToken; + } + } + function functionTypeChildAt(node, index) { + switch (index) { + case 0: return node.typeParameterList; + case 1: return node.parameterList; + case 2: return node.equalsGreaterThanToken; + case 3: return node.type; + } + } + function arrayTypeChildAt(node, index) { + switch (index) { + case 0: return node.type; + case 1: return node.openBracketToken; + case 2: return node.closeBracketToken; + } + } + function constructorTypeChildAt(node, index) { + switch (index) { + case 0: return node.newKeyword; + case 1: return node.typeParameterList; + case 2: return node.parameterList; + case 3: return node.equalsGreaterThanToken; + case 4: return node.type; + } + } + function genericTypeChildAt(node, index) { + switch (index) { + case 0: return node.name; + case 1: return node.typeArgumentList; + } + } + function typeQueryChildAt(node, index) { + switch (index) { + case 0: return node.typeOfKeyword; + case 1: return node.name; + } + } + function tupleTypeChildAt(node, index) { + switch (index) { + case 0: return node.openBracketToken; + case 1: return node.types; + case 2: return node.closeBracketToken; + } + } + function unionTypeChildAt(node, index) { + switch (index) { + case 0: return node.left; + case 1: return node.barToken; + case 2: return node.right; + } + } + function parenthesizedTypeChildAt(node, index) { + switch (index) { + case 0: return node.openParenToken; + case 1: return node.type; + case 2: return node.closeParenToken; + } + } + function interfaceDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.interfaceKeyword; + case 2: return node.identifier; + case 3: return node.typeParameterList; + case 4: return node.heritageClauses; + case 5: return node.body; + } + } + function functionDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.functionKeyword; + case 2: return node.identifier; + case 3: return node.callSignature; + case 4: return node.block; + case 5: return node.semicolonToken; + } + } + function moduleDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.moduleKeyword; + case 2: return node.name; + case 3: return node.stringLiteral; + case 4: return node.openBraceToken; + case 5: return node.moduleElements; + case 6: return node.closeBraceToken; + } + } + function classDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.classKeyword; + case 2: return node.identifier; + case 3: return node.typeParameterList; + case 4: return node.heritageClauses; + case 5: return node.openBraceToken; + case 6: return node.classElements; + case 7: return node.closeBraceToken; + } + } + function enumDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.enumKeyword; + case 2: return node.identifier; + case 3: return node.openBraceToken; + case 4: return node.enumElements; + case 5: return node.closeBraceToken; + } + } + function importDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.importKeyword; + case 2: return node.identifier; + case 3: return node.equalsToken; + case 4: return node.moduleReference; + case 5: return node.semicolonToken; + } + } + function exportAssignmentChildAt(node, index) { + switch (index) { + case 0: return node.exportKeyword; + case 1: return node.equalsToken; + case 2: return node.identifier; + case 3: return node.semicolonToken; + } + } + function memberFunctionDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.propertyName; + case 2: return node.callSignature; + case 3: return node.block; + case 4: return node.semicolonToken; + } + } + function memberVariableDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.variableDeclarator; + case 2: return node.semicolonToken; + } + } + function constructorDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.constructorKeyword; + case 2: return node.callSignature; + case 3: return node.block; + case 4: return node.semicolonToken; + } + } + function indexMemberDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.indexSignature; + case 2: return node.semicolonToken; + } + } + function getAccessorChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.getKeyword; + case 2: return node.propertyName; + case 3: return node.callSignature; + case 4: return node.block; + } + } + function setAccessorChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.setKeyword; + case 2: return node.propertyName; + case 3: return node.callSignature; + case 4: return node.block; + } + } + function propertySignatureChildAt(node, index) { + switch (index) { + case 0: return node.propertyName; + case 1: return node.questionToken; + case 2: return node.typeAnnotation; + } + } + function callSignatureChildAt(node, index) { + switch (index) { + case 0: return node.typeParameterList; + case 1: return node.parameterList; + case 2: return node.typeAnnotation; + } + } + function constructSignatureChildAt(node, index) { + switch (index) { + case 0: return node.newKeyword; + case 1: return node.callSignature; + } + } + function indexSignatureChildAt(node, index) { + switch (index) { + case 0: return node.openBracketToken; + case 1: return node.parameters; + case 2: return node.closeBracketToken; + case 3: return node.typeAnnotation; + } + } + function methodSignatureChildAt(node, index) { + switch (index) { + case 0: return node.propertyName; + case 1: return node.questionToken; + case 2: return node.callSignature; + } + } + function blockChildAt(node, index) { + switch (index) { + case 0: return node.openBraceToken; + case 1: return node.statements; + case 2: return node.closeBraceToken; + } + } + function ifStatementChildAt(node, index) { + switch (index) { + case 0: return node.ifKeyword; + case 1: return node.openParenToken; + case 2: return node.condition; + case 3: return node.closeParenToken; + case 4: return node.statement; + case 5: return node.elseClause; + } + } + function variableStatementChildAt(node, index) { + switch (index) { + case 0: return node.modifiers; + case 1: return node.variableDeclaration; + case 2: return node.semicolonToken; + } + } + function expressionStatementChildAt(node, index) { + switch (index) { + case 0: return node.expression; + case 1: return node.semicolonToken; + } + } + function returnStatementChildAt(node, index) { + switch (index) { + case 0: return node.returnKeyword; + case 1: return node.expression; + case 2: return node.semicolonToken; + } + } + function switchStatementChildAt(node, index) { + switch (index) { + case 0: return node.switchKeyword; + case 1: return node.openParenToken; + case 2: return node.expression; + case 3: return node.closeParenToken; + case 4: return node.openBraceToken; + case 5: return node.switchClauses; + case 6: return node.closeBraceToken; + } + } + function breakStatementChildAt(node, index) { + switch (index) { + case 0: return node.breakKeyword; + case 1: return node.identifier; + case 2: return node.semicolonToken; + } + } + function continueStatementChildAt(node, index) { + switch (index) { + case 0: return node.continueKeyword; + case 1: return node.identifier; + case 2: return node.semicolonToken; + } + } + function forStatementChildAt(node, index) { + switch (index) { + case 0: return node.forKeyword; + case 1: return node.openParenToken; + case 2: return node.variableDeclaration; + case 3: return node.initializer; + case 4: return node.firstSemicolonToken; + case 5: return node.condition; + case 6: return node.secondSemicolonToken; + case 7: return node.incrementor; + case 8: return node.closeParenToken; + case 9: return node.statement; + } + } + function forInStatementChildAt(node, index) { + switch (index) { + case 0: return node.forKeyword; + case 1: return node.openParenToken; + case 2: return node.variableDeclaration; + case 3: return node.left; + case 4: return node.inKeyword; + case 5: return node.expression; + case 6: return node.closeParenToken; + case 7: return node.statement; + } + } + function emptyStatementChildAt(node, index) { + switch (index) { + case 0: return node.semicolonToken; + } + } + function throwStatementChildAt(node, index) { + switch (index) { + case 0: return node.throwKeyword; + case 1: return node.expression; + case 2: return node.semicolonToken; + } + } + function whileStatementChildAt(node, index) { + switch (index) { + case 0: return node.whileKeyword; + case 1: return node.openParenToken; + case 2: return node.condition; + case 3: return node.closeParenToken; + case 4: return node.statement; + } + } + function tryStatementChildAt(node, index) { + switch (index) { + case 0: return node.tryKeyword; + case 1: return node.block; + case 2: return node.catchClause; + case 3: return node.finallyClause; + } + } + function labeledStatementChildAt(node, index) { + switch (index) { + case 0: return node.identifier; + case 1: return node.colonToken; + case 2: return node.statement; + } + } + function doStatementChildAt(node, index) { + switch (index) { + case 0: return node.doKeyword; + case 1: return node.statement; + case 2: return node.whileKeyword; + case 3: return node.openParenToken; + case 4: return node.condition; + case 5: return node.closeParenToken; + case 6: return node.semicolonToken; + } + } + function debuggerStatementChildAt(node, index) { + switch (index) { + case 0: return node.debuggerKeyword; + case 1: return node.semicolonToken; + } + } + function withStatementChildAt(node, index) { + switch (index) { + case 0: return node.withKeyword; + case 1: return node.openParenToken; + case 2: return node.condition; + case 3: return node.closeParenToken; + case 4: return node.statement; + } + } + function prefixUnaryExpressionChildAt(node, index) { + switch (index) { + case 0: return node.operatorToken; + case 1: return node.operand; + } + } + function deleteExpressionChildAt(node, index) { + switch (index) { + case 0: return node.deleteKeyword; + case 1: return node.expression; + } + } + function typeOfExpressionChildAt(node, index) { + switch (index) { + case 0: return node.typeOfKeyword; + case 1: return node.expression; + } + } + function voidExpressionChildAt(node, index) { + switch (index) { + case 0: return node.voidKeyword; + case 1: return node.expression; + } + } + function conditionalExpressionChildAt(node, index) { + switch (index) { + case 0: return node.condition; + case 1: return node.questionToken; + case 2: return node.whenTrue; + case 3: return node.colonToken; + case 4: return node.whenFalse; + } + } + function binaryExpressionChildAt(node, index) { + switch (index) { + case 0: return node.left; + case 1: return node.operatorToken; + case 2: return node.right; + } + } + function postfixUnaryExpressionChildAt(node, index) { + switch (index) { + case 0: return node.operand; + case 1: return node.operatorToken; + } + } + function memberAccessExpressionChildAt(node, index) { + switch (index) { + case 0: return node.expression; + case 1: return node.dotToken; + case 2: return node.name; + } + } + function invocationExpressionChildAt(node, index) { + switch (index) { + case 0: return node.expression; + case 1: return node.argumentList; + } + } + function arrayLiteralExpressionChildAt(node, index) { + switch (index) { + case 0: return node.openBracketToken; + case 1: return node.expressions; + case 2: return node.closeBracketToken; + } + } + function objectLiteralExpressionChildAt(node, index) { + switch (index) { + case 0: return node.openBraceToken; + case 1: return node.propertyAssignments; + case 2: return node.closeBraceToken; + } + } + function objectCreationExpressionChildAt(node, index) { + switch (index) { + case 0: return node.newKeyword; + case 1: return node.expression; + case 2: return node.argumentList; + } + } + function parenthesizedExpressionChildAt(node, index) { + switch (index) { + case 0: return node.openParenToken; + case 1: return node.expression; + case 2: return node.closeParenToken; + } + } + function parenthesizedArrowFunctionExpressionChildAt(node, index) { + switch (index) { + case 0: return node.callSignature; + case 1: return node.equalsGreaterThanToken; + case 2: return node.block; + case 3: return node.expression; + } + } + function simpleArrowFunctionExpressionChildAt(node, index) { + switch (index) { + case 0: return node.parameter; + case 1: return node.equalsGreaterThanToken; + case 2: return node.block; + case 3: return node.expression; + } + } + function castExpressionChildAt(node, index) { + switch (index) { + case 0: return node.lessThanToken; + case 1: return node.type; + case 2: return node.greaterThanToken; + case 3: return node.expression; + } + } + function elementAccessExpressionChildAt(node, index) { + switch (index) { + case 0: return node.expression; + case 1: return node.openBracketToken; + case 2: return node.argumentExpression; + case 3: return node.closeBracketToken; + } + } + function functionExpressionChildAt(node, index) { + switch (index) { + case 0: return node.functionKeyword; + case 1: return node.identifier; + case 2: return node.callSignature; + case 3: return node.block; + } + } + function omittedExpressionChildAt(node, index) { + throw TypeScript.Errors.invalidOperation(); + } + function templateExpressionChildAt(node, index) { + switch (index) { + case 0: return node.templateStartToken; + case 1: return node.templateClauses; + } + } + function templateAccessExpressionChildAt(node, index) { + switch (index) { + case 0: return node.expression; + case 1: return node.templateExpression; + } + } + function variableDeclarationChildAt(node, index) { + switch (index) { + case 0: return node.varKeyword; + case 1: return node.variableDeclarators; + } + } + function variableDeclaratorChildAt(node, index) { + switch (index) { + case 0: return node.propertyName; + case 1: return node.typeAnnotation; + case 2: return node.equalsValueClause; + } + } + function argumentListChildAt(node, index) { + switch (index) { + case 0: return node.typeArgumentList; + case 1: return node.openParenToken; + case 2: return node.arguments; + case 3: return node.closeParenToken; + } + } + function parameterListChildAt(node, index) { + switch (index) { + case 0: return node.openParenToken; + case 1: return node.parameters; + case 2: return node.closeParenToken; + } + } + function typeArgumentListChildAt(node, index) { + switch (index) { + case 0: return node.lessThanToken; + case 1: return node.typeArguments; + case 2: return node.greaterThanToken; + } + } + function typeParameterListChildAt(node, index) { + switch (index) { + case 0: return node.lessThanToken; + case 1: return node.typeParameters; + case 2: return node.greaterThanToken; + } + } + function heritageClauseChildAt(node, index) { + switch (index) { + case 0: return node.extendsOrImplementsKeyword; + case 1: return node.typeNames; + } + } + function equalsValueClauseChildAt(node, index) { + switch (index) { + case 0: return node.equalsToken; + case 1: return node.value; + } + } + function caseSwitchClauseChildAt(node, index) { + switch (index) { + case 0: return node.caseKeyword; + case 1: return node.expression; + case 2: return node.colonToken; + case 3: return node.statements; + } + } + function defaultSwitchClauseChildAt(node, index) { + switch (index) { + case 0: return node.defaultKeyword; + case 1: return node.colonToken; + case 2: return node.statements; + } + } + function elseClauseChildAt(node, index) { + switch (index) { + case 0: return node.elseKeyword; + case 1: return node.statement; + } + } + function catchClauseChildAt(node, index) { + switch (index) { + case 0: return node.catchKeyword; + case 1: return node.openParenToken; + case 2: return node.identifier; + case 3: return node.typeAnnotation; + case 4: return node.closeParenToken; + case 5: return node.block; + } + } + function finallyClauseChildAt(node, index) { + switch (index) { + case 0: return node.finallyKeyword; + case 1: return node.block; + } + } + function templateClauseChildAt(node, index) { + switch (index) { + case 0: return node.expression; + case 1: return node.templateMiddleOrEndToken; + } + } + function typeParameterChildAt(node, index) { + switch (index) { + case 0: return node.identifier; + case 1: return node.constraint; + } + } + function constraintChildAt(node, index) { + switch (index) { + case 0: return node.extendsKeyword; + case 1: return node.typeOrExpression; + } + } + function simplePropertyAssignmentChildAt(node, index) { + switch (index) { + case 0: return node.propertyName; + case 1: return node.colonToken; + case 2: return node.expression; + } + } + function functionPropertyAssignmentChildAt(node, index) { + switch (index) { + case 0: return node.propertyName; + case 1: return node.callSignature; + case 2: return node.block; + } + } + function parameterChildAt(node, index) { + switch (index) { + case 0: return node.dotDotDotToken; + case 1: return node.modifiers; + case 2: return node.identifier; + case 3: return node.questionToken; + case 4: return node.typeAnnotation; + case 5: return node.equalsValueClause; + } + } + function enumElementChildAt(node, index) { + switch (index) { + case 0: return node.propertyName; + case 1: return node.equalsValueClause; + } + } + function typeAnnotationChildAt(node, index) { + switch (index) { + case 0: return node.colonToken; + case 1: return node.type; + } + } + function externalModuleReferenceChildAt(node, index) { + switch (index) { + case 0: return node.requireKeyword; + case 1: return node.openParenToken; + case 2: return node.stringLiteral; + case 3: return node.closeParenToken; + } + } + function moduleNameModuleReferenceChildAt(node, index) { + switch (index) { + case 0: return node.moduleName; + } + } + function childAt(element, index) { + if (TypeScript.isList(element)) { + return element[index]; } switch (element.kind()) { - case 120 /* SourceUnit */: - return visitor.visitSourceUnit(element); - case 121 /* QualifiedName */: - return visitor.visitQualifiedName(element); - case 122 /* ObjectType */: - return visitor.visitObjectType(element); - case 123 /* FunctionType */: - return visitor.visitFunctionType(element); - case 124 /* ArrayType */: - return visitor.visitArrayType(element); - case 125 /* ConstructorType */: - return visitor.visitConstructorType(element); - case 126 /* GenericType */: - return visitor.visitGenericType(element); - case 127 /* TypeQuery */: - return visitor.visitTypeQuery(element); - case 128 /* TupleType */: - return visitor.visitTupleType(element); - case 129 /* InterfaceDeclaration */: - return visitor.visitInterfaceDeclaration(element); - case 130 /* FunctionDeclaration */: - return visitor.visitFunctionDeclaration(element); - case 131 /* ModuleDeclaration */: - return visitor.visitModuleDeclaration(element); - case 132 /* ClassDeclaration */: - return visitor.visitClassDeclaration(element); - case 133 /* EnumDeclaration */: - return visitor.visitEnumDeclaration(element); - case 134 /* ImportDeclaration */: - return visitor.visitImportDeclaration(element); - case 135 /* ExportAssignment */: - return visitor.visitExportAssignment(element); - case 136 /* MemberFunctionDeclaration */: - return visitor.visitMemberFunctionDeclaration(element); - case 137 /* MemberVariableDeclaration */: - return visitor.visitMemberVariableDeclaration(element); - case 138 /* ConstructorDeclaration */: - return visitor.visitConstructorDeclaration(element); - case 139 /* IndexMemberDeclaration */: - return visitor.visitIndexMemberDeclaration(element); - case 140 /* GetAccessor */: - return visitor.visitGetAccessor(element); - case 141 /* SetAccessor */: - return visitor.visitSetAccessor(element); - case 142 /* PropertySignature */: - return visitor.visitPropertySignature(element); - case 143 /* CallSignature */: - return visitor.visitCallSignature(element); - case 144 /* ConstructSignature */: - return visitor.visitConstructSignature(element); - case 145 /* IndexSignature */: - return visitor.visitIndexSignature(element); - case 146 /* MethodSignature */: - return visitor.visitMethodSignature(element); - case 147 /* Block */: - return visitor.visitBlock(element); - case 148 /* IfStatement */: - return visitor.visitIfStatement(element); - case 149 /* VariableStatement */: - return visitor.visitVariableStatement(element); - case 150 /* ExpressionStatement */: - return visitor.visitExpressionStatement(element); - case 151 /* ReturnStatement */: - return visitor.visitReturnStatement(element); - case 152 /* SwitchStatement */: - return visitor.visitSwitchStatement(element); - case 153 /* BreakStatement */: - return visitor.visitBreakStatement(element); - case 154 /* ContinueStatement */: - return visitor.visitContinueStatement(element); - case 155 /* ForStatement */: - return visitor.visitForStatement(element); - case 156 /* ForInStatement */: - return visitor.visitForInStatement(element); - case 157 /* EmptyStatement */: - return visitor.visitEmptyStatement(element); - case 158 /* ThrowStatement */: - return visitor.visitThrowStatement(element); - case 159 /* WhileStatement */: - return visitor.visitWhileStatement(element); - case 160 /* TryStatement */: - return visitor.visitTryStatement(element); - case 161 /* LabeledStatement */: - return visitor.visitLabeledStatement(element); - case 162 /* DoStatement */: - return visitor.visitDoStatement(element); - case 163 /* DebuggerStatement */: - return visitor.visitDebuggerStatement(element); - case 164 /* WithStatement */: - return visitor.visitWithStatement(element); - case 169 /* PreIncrementExpression */: - case 170 /* PreDecrementExpression */: - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - case 167 /* BitwiseNotExpression */: - case 168 /* LogicalNotExpression */: - return visitor.visitPrefixUnaryExpression(element); - case 171 /* DeleteExpression */: - return visitor.visitDeleteExpression(element); - case 172 /* TypeOfExpression */: - return visitor.visitTypeOfExpression(element); - case 173 /* VoidExpression */: - return visitor.visitVoidExpression(element); - case 187 /* ConditionalExpression */: - return visitor.visitConditionalExpression(element); - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 192 /* BitwiseAndExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 190 /* BitwiseOrExpression */: - case 189 /* LogicalAndExpression */: - case 188 /* LogicalOrExpression */: - case 183 /* OrAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 175 /* AssignmentExpression */: - case 174 /* CommaExpression */: - return visitor.visitBinaryExpression(element); - case 211 /* PostIncrementExpression */: - case 212 /* PostDecrementExpression */: - return visitor.visitPostfixUnaryExpression(element); - case 213 /* MemberAccessExpression */: - return visitor.visitMemberAccessExpression(element); - case 214 /* InvocationExpression */: - return visitor.visitInvocationExpression(element); - case 215 /* ArrayLiteralExpression */: - return visitor.visitArrayLiteralExpression(element); - case 216 /* ObjectLiteralExpression */: - return visitor.visitObjectLiteralExpression(element); - case 217 /* ObjectCreationExpression */: - return visitor.visitObjectCreationExpression(element); - case 218 /* ParenthesizedExpression */: - return visitor.visitParenthesizedExpression(element); - case 219 /* ParenthesizedArrowFunctionExpression */: - return visitor.visitParenthesizedArrowFunctionExpression(element); - case 220 /* SimpleArrowFunctionExpression */: - return visitor.visitSimpleArrowFunctionExpression(element); - case 221 /* CastExpression */: - return visitor.visitCastExpression(element); - case 222 /* ElementAccessExpression */: - return visitor.visitElementAccessExpression(element); - case 223 /* FunctionExpression */: - return visitor.visitFunctionExpression(element); - case 224 /* OmittedExpression */: - return visitor.visitOmittedExpression(element); - case 225 /* VariableDeclaration */: - return visitor.visitVariableDeclaration(element); - case 226 /* VariableDeclarator */: - return visitor.visitVariableDeclarator(element); - case 227 /* ArgumentList */: - return visitor.visitArgumentList(element); - case 228 /* ParameterList */: - return visitor.visitParameterList(element); - case 229 /* TypeArgumentList */: - return visitor.visitTypeArgumentList(element); - case 230 /* TypeParameterList */: - return visitor.visitTypeParameterList(element); - case 231 /* ExtendsHeritageClause */: - case 232 /* ImplementsHeritageClause */: - return visitor.visitHeritageClause(element); - case 233 /* EqualsValueClause */: - return visitor.visitEqualsValueClause(element); - case 234 /* CaseSwitchClause */: - return visitor.visitCaseSwitchClause(element); - case 235 /* DefaultSwitchClause */: - return visitor.visitDefaultSwitchClause(element); - case 236 /* ElseClause */: - return visitor.visitElseClause(element); - case 237 /* CatchClause */: - return visitor.visitCatchClause(element); - case 238 /* FinallyClause */: - return visitor.visitFinallyClause(element); - case 239 /* TypeParameter */: - return visitor.visitTypeParameter(element); - case 240 /* Constraint */: - return visitor.visitConstraint(element); - case 241 /* SimplePropertyAssignment */: - return visitor.visitSimplePropertyAssignment(element); - case 242 /* FunctionPropertyAssignment */: - return visitor.visitFunctionPropertyAssignment(element); - case 243 /* Parameter */: - return visitor.visitParameter(element); - case 244 /* EnumElement */: - return visitor.visitEnumElement(element); - case 245 /* TypeAnnotation */: - return visitor.visitTypeAnnotation(element); - case 246 /* ExternalModuleReference */: - return visitor.visitExternalModuleReference(element); - case 247 /* ModuleNameModuleReference */: - return visitor.visitModuleNameModuleReference(element); + case 122 /* SourceUnit */: return sourceUnitChildAt(element, index); + case 123 /* QualifiedName */: return qualifiedNameChildAt(element, index); + case 124 /* ObjectType */: return objectTypeChildAt(element, index); + case 125 /* FunctionType */: return functionTypeChildAt(element, index); + case 126 /* ArrayType */: return arrayTypeChildAt(element, index); + case 127 /* ConstructorType */: return constructorTypeChildAt(element, index); + case 128 /* GenericType */: return genericTypeChildAt(element, index); + case 129 /* TypeQuery */: return typeQueryChildAt(element, index); + case 130 /* TupleType */: return tupleTypeChildAt(element, index); + case 131 /* UnionType */: return unionTypeChildAt(element, index); + case 132 /* ParenthesizedType */: return parenthesizedTypeChildAt(element, index); + case 133 /* InterfaceDeclaration */: return interfaceDeclarationChildAt(element, index); + case 134 /* FunctionDeclaration */: return functionDeclarationChildAt(element, index); + case 135 /* ModuleDeclaration */: return moduleDeclarationChildAt(element, index); + case 136 /* ClassDeclaration */: return classDeclarationChildAt(element, index); + case 137 /* EnumDeclaration */: return enumDeclarationChildAt(element, index); + case 138 /* ImportDeclaration */: return importDeclarationChildAt(element, index); + case 139 /* ExportAssignment */: return exportAssignmentChildAt(element, index); + case 140 /* MemberFunctionDeclaration */: return memberFunctionDeclarationChildAt(element, index); + case 141 /* MemberVariableDeclaration */: return memberVariableDeclarationChildAt(element, index); + case 142 /* ConstructorDeclaration */: return constructorDeclarationChildAt(element, index); + case 143 /* IndexMemberDeclaration */: return indexMemberDeclarationChildAt(element, index); + case 144 /* GetAccessor */: return getAccessorChildAt(element, index); + case 145 /* SetAccessor */: return setAccessorChildAt(element, index); + case 146 /* PropertySignature */: return propertySignatureChildAt(element, index); + case 147 /* CallSignature */: return callSignatureChildAt(element, index); + case 148 /* ConstructSignature */: return constructSignatureChildAt(element, index); + case 149 /* IndexSignature */: return indexSignatureChildAt(element, index); + case 150 /* MethodSignature */: return methodSignatureChildAt(element, index); + case 151 /* Block */: return blockChildAt(element, index); + case 152 /* IfStatement */: return ifStatementChildAt(element, index); + case 153 /* VariableStatement */: return variableStatementChildAt(element, index); + case 154 /* ExpressionStatement */: return expressionStatementChildAt(element, index); + case 155 /* ReturnStatement */: return returnStatementChildAt(element, index); + case 156 /* SwitchStatement */: return switchStatementChildAt(element, index); + case 157 /* BreakStatement */: return breakStatementChildAt(element, index); + case 158 /* ContinueStatement */: return continueStatementChildAt(element, index); + case 159 /* ForStatement */: return forStatementChildAt(element, index); + case 160 /* ForInStatement */: return forInStatementChildAt(element, index); + case 161 /* EmptyStatement */: return emptyStatementChildAt(element, index); + case 162 /* ThrowStatement */: return throwStatementChildAt(element, index); + case 163 /* WhileStatement */: return whileStatementChildAt(element, index); + case 164 /* TryStatement */: return tryStatementChildAt(element, index); + case 165 /* LabeledStatement */: return labeledStatementChildAt(element, index); + case 166 /* DoStatement */: return doStatementChildAt(element, index); + case 167 /* DebuggerStatement */: return debuggerStatementChildAt(element, index); + case 168 /* WithStatement */: return withStatementChildAt(element, index); + case 169 /* PrefixUnaryExpression */: return prefixUnaryExpressionChildAt(element, index); + case 170 /* DeleteExpression */: return deleteExpressionChildAt(element, index); + case 171 /* TypeOfExpression */: return typeOfExpressionChildAt(element, index); + case 172 /* VoidExpression */: return voidExpressionChildAt(element, index); + case 173 /* ConditionalExpression */: return conditionalExpressionChildAt(element, index); + case 174 /* BinaryExpression */: return binaryExpressionChildAt(element, index); + case 175 /* PostfixUnaryExpression */: return postfixUnaryExpressionChildAt(element, index); + case 176 /* MemberAccessExpression */: return memberAccessExpressionChildAt(element, index); + case 177 /* InvocationExpression */: return invocationExpressionChildAt(element, index); + case 178 /* ArrayLiteralExpression */: return arrayLiteralExpressionChildAt(element, index); + case 179 /* ObjectLiteralExpression */: return objectLiteralExpressionChildAt(element, index); + case 180 /* ObjectCreationExpression */: return objectCreationExpressionChildAt(element, index); + case 181 /* ParenthesizedExpression */: return parenthesizedExpressionChildAt(element, index); + case 182 /* ParenthesizedArrowFunctionExpression */: return parenthesizedArrowFunctionExpressionChildAt(element, index); + case 183 /* SimpleArrowFunctionExpression */: return simpleArrowFunctionExpressionChildAt(element, index); + case 184 /* CastExpression */: return castExpressionChildAt(element, index); + case 185 /* ElementAccessExpression */: return elementAccessExpressionChildAt(element, index); + case 186 /* FunctionExpression */: return functionExpressionChildAt(element, index); + case 187 /* OmittedExpression */: return omittedExpressionChildAt(element, index); + case 188 /* TemplateExpression */: return templateExpressionChildAt(element, index); + case 189 /* TemplateAccessExpression */: return templateAccessExpressionChildAt(element, index); + case 190 /* VariableDeclaration */: return variableDeclarationChildAt(element, index); + case 191 /* VariableDeclarator */: return variableDeclaratorChildAt(element, index); + case 192 /* ArgumentList */: return argumentListChildAt(element, index); + case 193 /* ParameterList */: return parameterListChildAt(element, index); + case 194 /* TypeArgumentList */: return typeArgumentListChildAt(element, index); + case 195 /* TypeParameterList */: return typeParameterListChildAt(element, index); + case 196 /* HeritageClause */: return heritageClauseChildAt(element, index); + case 197 /* EqualsValueClause */: return equalsValueClauseChildAt(element, index); + case 198 /* CaseSwitchClause */: return caseSwitchClauseChildAt(element, index); + case 199 /* DefaultSwitchClause */: return defaultSwitchClauseChildAt(element, index); + case 200 /* ElseClause */: return elseClauseChildAt(element, index); + case 201 /* CatchClause */: return catchClauseChildAt(element, index); + case 202 /* FinallyClause */: return finallyClauseChildAt(element, index); + case 203 /* TemplateClause */: return templateClauseChildAt(element, index); + case 204 /* TypeParameter */: return typeParameterChildAt(element, index); + case 205 /* Constraint */: return constraintChildAt(element, index); + case 206 /* SimplePropertyAssignment */: return simplePropertyAssignmentChildAt(element, index); + case 207 /* FunctionPropertyAssignment */: return functionPropertyAssignmentChildAt(element, index); + case 208 /* Parameter */: return parameterChildAt(element, index); + case 209 /* EnumElement */: return enumElementChildAt(element, index); + case 210 /* TypeAnnotation */: return typeAnnotationChildAt(element, index); + case 211 /* ExternalModuleReference */: return externalModuleReferenceChildAt(element, index); + case 212 /* ModuleNameModuleReference */: return moduleNameModuleReferenceChildAt(element, index); + } + } + TypeScript.childAt = childAt; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + function visitNodeOrToken(visitor, element) { + if (element === undefined) { + return undefined; + } + switch (element.kind()) { + case 122 /* SourceUnit */: return visitor.visitSourceUnit(element); + case 123 /* QualifiedName */: return visitor.visitQualifiedName(element); + case 124 /* ObjectType */: return visitor.visitObjectType(element); + case 125 /* FunctionType */: return visitor.visitFunctionType(element); + case 126 /* ArrayType */: return visitor.visitArrayType(element); + case 127 /* ConstructorType */: return visitor.visitConstructorType(element); + case 128 /* GenericType */: return visitor.visitGenericType(element); + case 129 /* TypeQuery */: return visitor.visitTypeQuery(element); + case 130 /* TupleType */: return visitor.visitTupleType(element); + case 131 /* UnionType */: return visitor.visitUnionType(element); + case 132 /* ParenthesizedType */: return visitor.visitParenthesizedType(element); + case 133 /* InterfaceDeclaration */: return visitor.visitInterfaceDeclaration(element); + case 134 /* FunctionDeclaration */: return visitor.visitFunctionDeclaration(element); + case 135 /* ModuleDeclaration */: return visitor.visitModuleDeclaration(element); + case 136 /* ClassDeclaration */: return visitor.visitClassDeclaration(element); + case 137 /* EnumDeclaration */: return visitor.visitEnumDeclaration(element); + case 138 /* ImportDeclaration */: return visitor.visitImportDeclaration(element); + case 139 /* ExportAssignment */: return visitor.visitExportAssignment(element); + case 140 /* MemberFunctionDeclaration */: return visitor.visitMemberFunctionDeclaration(element); + case 141 /* MemberVariableDeclaration */: return visitor.visitMemberVariableDeclaration(element); + case 142 /* ConstructorDeclaration */: return visitor.visitConstructorDeclaration(element); + case 143 /* IndexMemberDeclaration */: return visitor.visitIndexMemberDeclaration(element); + case 144 /* GetAccessor */: return visitor.visitGetAccessor(element); + case 145 /* SetAccessor */: return visitor.visitSetAccessor(element); + case 146 /* PropertySignature */: return visitor.visitPropertySignature(element); + case 147 /* CallSignature */: return visitor.visitCallSignature(element); + case 148 /* ConstructSignature */: return visitor.visitConstructSignature(element); + case 149 /* IndexSignature */: return visitor.visitIndexSignature(element); + case 150 /* MethodSignature */: return visitor.visitMethodSignature(element); + case 151 /* Block */: return visitor.visitBlock(element); + case 152 /* IfStatement */: return visitor.visitIfStatement(element); + case 153 /* VariableStatement */: return visitor.visitVariableStatement(element); + case 154 /* ExpressionStatement */: return visitor.visitExpressionStatement(element); + case 155 /* ReturnStatement */: return visitor.visitReturnStatement(element); + case 156 /* SwitchStatement */: return visitor.visitSwitchStatement(element); + case 157 /* BreakStatement */: return visitor.visitBreakStatement(element); + case 158 /* ContinueStatement */: return visitor.visitContinueStatement(element); + case 159 /* ForStatement */: return visitor.visitForStatement(element); + case 160 /* ForInStatement */: return visitor.visitForInStatement(element); + case 161 /* EmptyStatement */: return visitor.visitEmptyStatement(element); + case 162 /* ThrowStatement */: return visitor.visitThrowStatement(element); + case 163 /* WhileStatement */: return visitor.visitWhileStatement(element); + case 164 /* TryStatement */: return visitor.visitTryStatement(element); + case 165 /* LabeledStatement */: return visitor.visitLabeledStatement(element); + case 166 /* DoStatement */: return visitor.visitDoStatement(element); + case 167 /* DebuggerStatement */: return visitor.visitDebuggerStatement(element); + case 168 /* WithStatement */: return visitor.visitWithStatement(element); + case 169 /* PrefixUnaryExpression */: return visitor.visitPrefixUnaryExpression(element); + case 170 /* DeleteExpression */: return visitor.visitDeleteExpression(element); + case 171 /* TypeOfExpression */: return visitor.visitTypeOfExpression(element); + case 172 /* VoidExpression */: return visitor.visitVoidExpression(element); + case 173 /* ConditionalExpression */: return visitor.visitConditionalExpression(element); + case 174 /* BinaryExpression */: return visitor.visitBinaryExpression(element); + case 175 /* PostfixUnaryExpression */: return visitor.visitPostfixUnaryExpression(element); + case 176 /* MemberAccessExpression */: return visitor.visitMemberAccessExpression(element); + case 177 /* InvocationExpression */: return visitor.visitInvocationExpression(element); + case 178 /* ArrayLiteralExpression */: return visitor.visitArrayLiteralExpression(element); + case 179 /* ObjectLiteralExpression */: return visitor.visitObjectLiteralExpression(element); + case 180 /* ObjectCreationExpression */: return visitor.visitObjectCreationExpression(element); + case 181 /* ParenthesizedExpression */: return visitor.visitParenthesizedExpression(element); + case 182 /* ParenthesizedArrowFunctionExpression */: return visitor.visitParenthesizedArrowFunctionExpression(element); + case 183 /* SimpleArrowFunctionExpression */: return visitor.visitSimpleArrowFunctionExpression(element); + case 184 /* CastExpression */: return visitor.visitCastExpression(element); + case 185 /* ElementAccessExpression */: return visitor.visitElementAccessExpression(element); + case 186 /* FunctionExpression */: return visitor.visitFunctionExpression(element); + case 187 /* OmittedExpression */: return visitor.visitOmittedExpression(element); + case 188 /* TemplateExpression */: return visitor.visitTemplateExpression(element); + case 189 /* TemplateAccessExpression */: return visitor.visitTemplateAccessExpression(element); + case 190 /* VariableDeclaration */: return visitor.visitVariableDeclaration(element); + case 191 /* VariableDeclarator */: return visitor.visitVariableDeclarator(element); + case 192 /* ArgumentList */: return visitor.visitArgumentList(element); + case 193 /* ParameterList */: return visitor.visitParameterList(element); + case 194 /* TypeArgumentList */: return visitor.visitTypeArgumentList(element); + case 195 /* TypeParameterList */: return visitor.visitTypeParameterList(element); + case 196 /* HeritageClause */: return visitor.visitHeritageClause(element); + case 197 /* EqualsValueClause */: return visitor.visitEqualsValueClause(element); + case 198 /* CaseSwitchClause */: return visitor.visitCaseSwitchClause(element); + case 199 /* DefaultSwitchClause */: return visitor.visitDefaultSwitchClause(element); + case 200 /* ElseClause */: return visitor.visitElseClause(element); + case 201 /* CatchClause */: return visitor.visitCatchClause(element); + case 202 /* FinallyClause */: return visitor.visitFinallyClause(element); + case 203 /* TemplateClause */: return visitor.visitTemplateClause(element); + case 204 /* TypeParameter */: return visitor.visitTypeParameter(element); + case 205 /* Constraint */: return visitor.visitConstraint(element); + case 206 /* SimplePropertyAssignment */: return visitor.visitSimplePropertyAssignment(element); + case 207 /* FunctionPropertyAssignment */: return visitor.visitFunctionPropertyAssignment(element); + case 208 /* Parameter */: return visitor.visitParameter(element); + case 209 /* EnumElement */: return visitor.visitEnumElement(element); + case 210 /* TypeAnnotation */: return visitor.visitTypeAnnotation(element); + case 211 /* ExternalModuleReference */: return visitor.visitExternalModuleReference(element); + case 212 /* ModuleNameModuleReference */: return visitor.visitModuleNameModuleReference(element); + default: return visitor.visitToken(element); } - throw TypeScript.Errors.invalidOperation(); } TypeScript.visitNodeOrToken = visitNodeOrToken; })(TypeScript || (TypeScript = {})); @@ -21649,44 +22398,15 @@ var TypeScript; } SyntaxWalker.prototype.visitToken = function (token) { }; - SyntaxWalker.prototype.visitNode = function (node) { - TypeScript.visitNodeOrToken(this, node); - }; - SyntaxWalker.prototype.visitNodeOrToken = function (nodeOrToken) { - if (TypeScript.isToken(nodeOrToken)) { - this.visitToken(nodeOrToken); - } - else { - this.visitNode(nodeOrToken); - } - }; SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === null) { + if (token === undefined) { return; } this.visitToken(token); }; - SyntaxWalker.prototype.visitOptionalNode = function (node) { - if (node === null) { - return; - } - this.visitNode(node); - }; - SyntaxWalker.prototype.visitOptionalNodeOrToken = function (nodeOrToken) { - if (nodeOrToken === null) { - return; - } - this.visitNodeOrToken(nodeOrToken); - }; SyntaxWalker.prototype.visitList = function (list) { for (var i = 0, n = list.length; i < n; i++) { - this.visitNodeOrToken(list[i]); - } - }; - SyntaxWalker.prototype.visitSeparatedList = function (list) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var item = TypeScript.childAt(list, i); - this.visitNodeOrToken(item); + TypeScript.visitNodeOrToken(this, list[i]); } }; SyntaxWalker.prototype.visitSourceUnit = function (node) { @@ -21694,66 +22414,76 @@ var TypeScript; this.visitToken(node.endOfFileToken); }; SyntaxWalker.prototype.visitQualifiedName = function (node) { - this.visitNodeOrToken(node.left); + TypeScript.visitNodeOrToken(this, node.left); this.visitToken(node.dotToken); this.visitToken(node.right); }; SyntaxWalker.prototype.visitObjectType = function (node) { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); + this.visitList(node.typeMembers); this.visitToken(node.closeBraceToken); }; SyntaxWalker.prototype.visitFunctionType = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); }; SyntaxWalker.prototype.visitArrayType = function (node) { - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); this.visitToken(node.openBracketToken); this.visitToken(node.closeBracketToken); }; SyntaxWalker.prototype.visitConstructorType = function (node) { this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); }; SyntaxWalker.prototype.visitGenericType = function (node) { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); + TypeScript.visitNodeOrToken(this, node.name); + TypeScript.visitNodeOrToken(this, node.typeArgumentList); }; SyntaxWalker.prototype.visitTypeQuery = function (node) { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); + TypeScript.visitNodeOrToken(this, node.name); }; SyntaxWalker.prototype.visitTupleType = function (node) { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.types); + this.visitList(node.types); this.visitToken(node.closeBracketToken); }; + SyntaxWalker.prototype.visitUnionType = function (node) { + TypeScript.visitNodeOrToken(this, node.left); + this.visitToken(node.barToken); + TypeScript.visitNodeOrToken(this, node.right); + }; + SyntaxWalker.prototype.visitParenthesizedType = function (node) { + this.visitToken(node.openParenToken); + TypeScript.visitNodeOrToken(this, node.type); + this.visitToken(node.closeParenToken); + }; SyntaxWalker.prototype.visitInterfaceDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.interfaceKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); - this.visitNode(node.body); + TypeScript.visitNodeOrToken(this, node.body); }; SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.functionKeyword); this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitModuleDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); + TypeScript.visitNodeOrToken(this, node.name); this.visitOptionalToken(node.stringLiteral); this.visitToken(node.openBraceToken); this.visitList(node.moduleElements); @@ -21763,7 +22493,7 @@ var TypeScript; this.visitList(node.modifiers); this.visitToken(node.classKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); this.visitToken(node.openBraceToken); this.visitList(node.classElements); @@ -21774,7 +22504,7 @@ var TypeScript; this.visitToken(node.enumKeyword); this.visitToken(node.identifier); this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); + this.visitList(node.enumElements); this.visitToken(node.closeBraceToken); }; SyntaxWalker.prototype.visitImportDeclaration = function (node) { @@ -21782,7 +22512,7 @@ var TypeScript; this.visitToken(node.importKeyword); this.visitToken(node.identifier); this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); + TypeScript.visitNodeOrToken(this, node.moduleReference); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitExportAssignment = function (node) { @@ -21794,65 +22524,65 @@ var TypeScript; SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); + TypeScript.visitNodeOrToken(this, node.variableDeclarator); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { this.visitList(node.modifiers); - this.visitNode(node.indexSignature); + TypeScript.visitNodeOrToken(this, node.indexSignature); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitGetAccessor = function (node) { this.visitList(node.modifiers); this.visitToken(node.getKeyword); this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitSetAccessor = function (node) { this.visitList(node.modifiers); this.visitToken(node.setKeyword); this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitPropertySignature = function (node) { this.visitToken(node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); }; SyntaxWalker.prototype.visitCallSignature = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.parameterList); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); }; SyntaxWalker.prototype.visitConstructSignature = function (node) { this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); + TypeScript.visitNodeOrToken(this, node.callSignature); }; SyntaxWalker.prototype.visitIndexSignature = function (node) { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); }; SyntaxWalker.prototype.visitMethodSignature = function (node) { this.visitToken(node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); + TypeScript.visitNodeOrToken(this, node.callSignature); }; SyntaxWalker.prototype.visitBlock = function (node) { this.visitToken(node.openBraceToken); @@ -21862,29 +22592,29 @@ var TypeScript; SyntaxWalker.prototype.visitIfStatement = function (node) { this.visitToken(node.ifKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); + TypeScript.visitNodeOrToken(this, node.statement); + TypeScript.visitNodeOrToken(this, node.elseClause); }; SyntaxWalker.prototype.visitVariableStatement = function (node) { this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); + TypeScript.visitNodeOrToken(this, node.variableDeclaration); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitExpressionStatement = function (node) { - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitReturnStatement = function (node) { this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitSwitchStatement = function (node) { this.visitToken(node.switchKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); this.visitToken(node.openBraceToken); this.visitList(node.switchClauses); @@ -21903,57 +22633,57 @@ var TypeScript; SyntaxWalker.prototype.visitForStatement = function (node) { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); + TypeScript.visitNodeOrToken(this, node.variableDeclaration); + TypeScript.visitNodeOrToken(this, node.initializer); this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); + TypeScript.visitNodeOrToken(this, node.incrementor); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitForInStatement = function (node) { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); + TypeScript.visitNodeOrToken(this, node.variableDeclaration); + TypeScript.visitNodeOrToken(this, node.left); this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitEmptyStatement = function (node) { this.visitToken(node.semicolonToken); }; SyntaxWalker.prototype.visitThrowStatement = function (node) { this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitWhileStatement = function (node) { this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitTryStatement = function (node) { this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); + TypeScript.visitNodeOrToken(this, node.block); + TypeScript.visitNodeOrToken(this, node.catchClause); + TypeScript.visitNodeOrToken(this, node.finallyClause); }; SyntaxWalker.prototype.visitLabeledStatement = function (node) { this.visitToken(node.identifier); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitDoStatement = function (node) { this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); this.visitOptionalToken(node.semicolonToken); }; @@ -21964,144 +22694,152 @@ var TypeScript; SyntaxWalker.prototype.visitWithStatement = function (node) { this.visitToken(node.withKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); + TypeScript.visitNodeOrToken(this, node.operand); }; SyntaxWalker.prototype.visitDeleteExpression = function (node) { this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitTypeOfExpression = function (node) { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitVoidExpression = function (node) { this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitConditionalExpression = function (node) { - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); + TypeScript.visitNodeOrToken(this, node.whenTrue); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); + TypeScript.visitNodeOrToken(this, node.whenFalse); }; SyntaxWalker.prototype.visitBinaryExpression = function (node) { - this.visitNodeOrToken(node.left); + TypeScript.visitNodeOrToken(this, node.left); this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); + TypeScript.visitNodeOrToken(this, node.right); }; SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - this.visitNodeOrToken(node.operand); + TypeScript.visitNodeOrToken(this, node.operand); this.visitToken(node.operatorToken); }; SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.dotToken); this.visitToken(node.name); }; SyntaxWalker.prototype.visitInvocationExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); + TypeScript.visitNodeOrToken(this, node.expression); + TypeScript.visitNodeOrToken(this, node.argumentList); }; SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); + this.visitList(node.expressions); this.visitToken(node.closeBracketToken); }; SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); + this.visitList(node.propertyAssignments); this.visitToken(node.closeBraceToken); }; SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); + TypeScript.visitNodeOrToken(this, node.expression); + TypeScript.visitNodeOrToken(this, node.argumentList); }; SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - this.visitNode(node.callSignature); + TypeScript.visitNodeOrToken(this, node.callSignature); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.block); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - this.visitNode(node.parameter); + TypeScript.visitNodeOrToken(this, node.parameter); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.block); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitCastExpression = function (node) { this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); + TypeScript.visitNodeOrToken(this, node.argumentExpression); this.visitToken(node.closeBracketToken); }; SyntaxWalker.prototype.visitFunctionExpression = function (node) { this.visitToken(node.functionKeyword); this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitOmittedExpression = function (node) { }; + SyntaxWalker.prototype.visitTemplateExpression = function (node) { + this.visitToken(node.templateStartToken); + this.visitList(node.templateClauses); + }; + SyntaxWalker.prototype.visitTemplateAccessExpression = function (node) { + TypeScript.visitNodeOrToken(this, node.expression); + TypeScript.visitNodeOrToken(this, node.templateExpression); + }; SyntaxWalker.prototype.visitVariableDeclaration = function (node) { this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); + this.visitList(node.variableDeclarators); }; SyntaxWalker.prototype.visitVariableDeclarator = function (node) { this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.equalsValueClause); }; SyntaxWalker.prototype.visitArgumentList = function (node) { - this.visitOptionalNode(node.typeArgumentList); + TypeScript.visitNodeOrToken(this, node.typeArgumentList); this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); + this.visitList(node.arguments); this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitParameterList = function (node) { this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitTypeArgumentList = function (node) { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); + this.visitList(node.typeArguments); this.visitToken(node.greaterThanToken); }; SyntaxWalker.prototype.visitTypeParameterList = function (node) { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); + this.visitList(node.typeParameters); this.visitToken(node.greaterThanToken); }; SyntaxWalker.prototype.visitHeritageClause = function (node) { this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); + this.visitList(node.typeNames); }; SyntaxWalker.prototype.visitEqualsValueClause = function (node) { this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); + TypeScript.visitNodeOrToken(this, node.value); }; SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.colonToken); this.visitList(node.statements); }; @@ -22112,53 +22850,57 @@ var TypeScript; }; SyntaxWalker.prototype.visitElseClause = function (node) { this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitCatchClause = function (node) { this.visitToken(node.catchKeyword); this.visitToken(node.openParenToken); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); this.visitToken(node.closeParenToken); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitFinallyClause = function (node) { this.visitToken(node.finallyKeyword); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.block); + }; + SyntaxWalker.prototype.visitTemplateClause = function (node) { + TypeScript.visitNodeOrToken(this, node.expression); + this.visitToken(node.templateMiddleOrEndToken); }; SyntaxWalker.prototype.visitTypeParameter = function (node) { this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); + TypeScript.visitNodeOrToken(this, node.constraint); }; SyntaxWalker.prototype.visitConstraint = function (node) { this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.typeOrExpression); + TypeScript.visitNodeOrToken(this, node.typeOrExpression); }; SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { this.visitToken(node.propertyName); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitParameter = function (node) { this.visitOptionalToken(node.dotDotDotToken); this.visitList(node.modifiers); this.visitToken(node.identifier); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.equalsValueClause); }; SyntaxWalker.prototype.visitEnumElement = function (node) { this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); + TypeScript.visitNodeOrToken(this, node.equalsValueClause); }; SyntaxWalker.prototype.visitTypeAnnotation = function (node) { this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); }; SyntaxWalker.prototype.visitExternalModuleReference = function (node) { this.visitToken(node.requireKeyword); @@ -22167,38 +22909,16 @@ var TypeScript; this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - this.visitNodeOrToken(node.moduleName); + TypeScript.visitNodeOrToken(this, node.moduleName); }; return SyntaxWalker; })(); TypeScript.SyntaxWalker = SyntaxWalker; })(TypeScript || (TypeScript = {})); var TypeScript; -(function (TypeScript) { - var DepthLimitedWalker = (function (_super) { - __extends(DepthLimitedWalker, _super); - function DepthLimitedWalker(maximumDepth) { - _super.call(this); - this._depth = 0; - this._maximumDepth = 0; - this._maximumDepth = maximumDepth; - } - DepthLimitedWalker.prototype.visitNode = function (node) { - if (this._depth < this._maximumDepth) { - this._depth++; - _super.prototype.visitNode.call(this, node); - this._depth--; - } - }; - return DepthLimitedWalker; - })(TypeScript.SyntaxWalker); - TypeScript.DepthLimitedWalker = DepthLimitedWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var Parser; (function (Parser) { - Parser.syntaxFactory; var arrayPool = []; var arrayPoolCount = 0; function getArray() { @@ -22207,14 +22927,9 @@ var TypeScript; } arrayPoolCount--; var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = null; + arrayPool[arrayPoolCount] = undefined; return result; } - function returnZeroLengthArray(array) { - if (array.length === 0) { - returnArray(array); - } - } function returnArray(array) { array.length = 0; arrayPool[arrayPoolCount] = array; @@ -22235,17 +22950,17 @@ var TypeScript; var result = parseSyntaxTreeWorker(isDeclaration); diagnostics = []; parseNodeData = 0 /* None */; - fileName = null; + fileName = undefined; source.release(); - source = null; - _source = null; + source = undefined; + _source = undefined; return result; } function parseSyntaxTreeWorker(isDeclaration) { var sourceUnit = parseSourceUnit(); var allDiagnostics = source.tokenDiagnostics().concat(diagnostics); allDiagnostics.sort(function (a, b) { return a.start() - b.start(); }); - return new TypeScript.SyntaxTree(Parser.syntaxFactory.isConcrete, sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); + return new TypeScript.SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); } function getRewindPoint() { var rewindPoint = source.getRewindPoint(); @@ -22263,8 +22978,8 @@ var TypeScript; } function currentNode() { var node = source.currentNode(); - if (node === null || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { - return null; + if (!node || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { + return undefined; } return node; } @@ -22296,11 +23011,11 @@ var TypeScript; if (_currentToken.kind() === kind) { return consumeToken(_currentToken); } - return null; + return undefined; } function isIdentifier(token) { var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { + if (tokenKind === 9 /* IdentifierName */) { return true; } if (tokenKind >= TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword) { @@ -22314,27 +23029,27 @@ var TypeScript; function eatIdentifierNameToken() { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { + if (tokenKind === 9 /* IdentifierName */) { return consumeToken(token); } if (TypeScript.SyntaxFacts.isAnyKeyword(tokenKind)) { return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); } - return createMissingToken(11 /* IdentifierName */, token); + return createMissingToken(9 /* IdentifierName */, token); } function eatOptionalIdentifierToken() { - return isIdentifier(currentToken()) ? eatIdentifierToken() : null; + return isIdentifier(currentToken()) ? eatIdentifierToken() : undefined; } function eatIdentifierToken(diagnosticCode) { var token = currentToken(); if (isIdentifier(token)) { consumeToken(token); - if (token.kind() === 11 /* IdentifierName */) { + if (token.kind() === 9 /* IdentifierName */) { return token; } return TypeScript.Syntax.convertKeywordToIdentifier(token); } - return createMissingToken(11 /* IdentifierName */, token, diagnosticCode); + return createMissingToken(9 /* IdentifierName */, token, diagnosticCode); } function previousTokenHasTrailingNewLine(token) { var tokenFullStart = token.fullStart(); @@ -22348,10 +23063,10 @@ var TypeScript; function canEatAutomaticSemicolon(allowWithoutNewLine) { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 10 /* EndOfFileToken */) { + if (tokenKind === 8 /* EndOfFileToken */) { return true; } - if (tokenKind === 71 /* CloseBraceToken */) { + if (tokenKind === 73 /* CloseBraceToken */) { return true; } if (allowWithoutNewLine) { @@ -22364,20 +23079,20 @@ var TypeScript; } function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline) { var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { + if (token.kind() === 80 /* SemicolonToken */) { return true; } return canEatAutomaticSemicolon(allowWithoutNewline); } function eatExplicitOrAutomaticSemicolon(allowWithoutNewline) { var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { + if (token.kind() === 80 /* SemicolonToken */) { return consumeToken(token); } if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return null; + return undefined; } - return eatToken(78 /* SemicolonToken */); + return eatToken(80 /* SemicolonToken */); } function createMissingToken(expectedKind, actual, diagnosticCode) { var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); @@ -22386,14 +23101,14 @@ var TypeScript; } function getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode) { var token = currentToken(); - var args = null; + var args = undefined; if (!diagnosticCode) { if (TypeScript.SyntaxFacts.isAnyKeyword(expectedKind) || TypeScript.SyntaxFacts.isAnyPunctuation(expectedKind)) { diagnosticCode = TypeScript.DiagnosticCode._0_expected; args = [TypeScript.SyntaxFacts.getText(expectedKind)]; } else { - if (actual !== null && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { + if (actual && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword; args = [TypeScript.SyntaxFacts.getText(actual.kind())]; } @@ -22406,38 +23121,33 @@ var TypeScript; } function getBinaryExpressionPrecedence(tokenKind) { switch (tokenKind) { - case 104 /* BarBarToken */: - return 2 /* LogicalOrExpressionPrecedence */; - case 103 /* AmpersandAmpersandToken */: - return 3 /* LogicalAndExpressionPrecedence */; - case 99 /* BarToken */: - return 4 /* BitwiseOrExpressionPrecedence */; - case 100 /* CaretToken */: - return 5 /* BitwiseExclusiveOrExpressionPrecedence */; - case 98 /* AmpersandToken */: - return 6 /* BitwiseAndExpressionPrecedence */; - case 84 /* EqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: + case 106 /* BarBarToken */: return 2 /* LogicalOrExpressionPrecedence */; + case 105 /* AmpersandAmpersandToken */: return 3 /* LogicalAndExpressionPrecedence */; + case 101 /* BarToken */: return 4 /* BitwiseOrExpressionPrecedence */; + case 102 /* CaretToken */: return 5 /* BitwiseExclusiveOrExpressionPrecedence */; + case 100 /* AmpersandToken */: return 6 /* BitwiseAndExpressionPrecedence */; + case 86 /* EqualsEqualsToken */: + case 88 /* ExclamationEqualsToken */: + case 89 /* EqualsEqualsEqualsToken */: + case 90 /* ExclamationEqualsEqualsToken */: return 7 /* EqualityExpressionPrecedence */; - case 80 /* LessThanToken */: - case 81 /* GreaterThanToken */: - case 82 /* LessThanEqualsToken */: - case 83 /* GreaterThanEqualsToken */: - case 30 /* InstanceOfKeyword */: - case 29 /* InKeyword */: + case 82 /* LessThanToken */: + case 83 /* GreaterThanToken */: + case 84 /* LessThanEqualsToken */: + case 85 /* GreaterThanEqualsToken */: + case 32 /* InstanceOfKeyword */: + case 31 /* InKeyword */: return 8 /* RelationalExpressionPrecedence */; - case 95 /* LessThanLessThanToken */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: + case 97 /* LessThanLessThanToken */: + case 98 /* GreaterThanGreaterThanToken */: + case 99 /* GreaterThanGreaterThanGreaterThanToken */: return 9 /* ShiftExpressionPrecdence */; - case 89 /* PlusToken */: - case 90 /* MinusToken */: + case 91 /* PlusToken */: + case 92 /* MinusToken */: return 10 /* AdditiveExpressionPrecedence */; - case 91 /* AsteriskToken */: - case 118 /* SlashToken */: - case 92 /* PercentToken */: + case 93 /* AsteriskToken */: + case 120 /* SlashToken */: + case 94 /* PercentToken */: return 11 /* MultiplicativeExpressionPrecedence */; } throw TypeScript.Errors.invalidOperation(); @@ -22458,11 +23168,12 @@ var TypeScript; var parent = oldToken.parent; newToken.parent = parent; while (true) { - TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent) || TypeScript.isSeparatedList(parent)); + TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent)); var dataElement = parent; - if (dataElement.data) { - dataElement.data &= 4 /* NodeParsedInStrictModeMask */; + if (dataElement.__data) { + dataElement.__data &= 4 /* NodeParsedInStrictModeMask */; } + dataElement.__cachedTokens = undefined; if (parent === node) { break; } @@ -22489,20 +23200,6 @@ var TypeScript; } } } - else if (TypeScript.isSeparatedList(parent)) { - var list2 = parent; - for (var i = 0, n = TypeScript.childCount(list2); i < n; i++) { - if (TypeScript.childAt(list2, i) === oldToken) { - if (i % 2 === 0) { - list2[i / 2] = newToken; - } - else { - list2.separators[(i - 1) / 2] = newToken; - } - return; - } - } - } throw TypeScript.Errors.invalidOperation(); } function addSkippedTokenAfterNode(node, skippedToken) { @@ -22569,7 +23266,7 @@ var TypeScript; var skippedTokens = getArray(); var moduleElements = parseSyntaxList(0 /* SourceUnit_ModuleElements */, skippedTokens, updateStrictModeState); setStrictMode(savedIsInStrictMode); - var sourceUnit = new Parser.syntaxFactory.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); + var sourceUnit = new TypeScript.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); sourceUnit = addSkippedTokensBeforeNode(sourceUnit, skippedTokens); if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { TypeScript.Debug.assert(TypeScript.fullWidth(sourceUnit) === source.text.length()); @@ -22607,48 +23304,43 @@ var TypeScript; var _modifierCount = modifierCount(); if (_modifierCount) { switch (peekToken(_modifierCount).kind()) { - case 49 /* ImportKeyword */: - return parseImportDeclaration(); - case 65 /* ModuleKeyword */: - return parseModuleDeclaration(); - case 52 /* InterfaceKeyword */: - return parseInterfaceDeclaration(); - case 44 /* ClassKeyword */: - return parseClassDeclaration(); - case 46 /* EnumKeyword */: - return parseEnumDeclaration(); + case 51 /* ImportKeyword */: return parseImportDeclaration(); + case 67 /* ModuleKeyword */: return parseModuleDeclaration(); + case 54 /* InterfaceKeyword */: return parseInterfaceDeclaration(); + case 46 /* ClassKeyword */: return parseClassDeclaration(); + case 48 /* EnumKeyword */: return parseEnumDeclaration(); } } var nextToken = peekToken(1); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { + case 67 /* ModuleKeyword */: + if (isIdentifier(nextToken) || nextToken.kind() === 12 /* StringLiteral */) { return parseModuleDeclaration(); } break; - case 49 /* ImportKeyword */: + case 51 /* ImportKeyword */: if (isIdentifier(nextToken)) { return parseImportDeclaration(); } break; - case 44 /* ClassKeyword */: + case 46 /* ClassKeyword */: if (isIdentifier(nextToken)) { return parseClassDeclaration(); } break; - case 46 /* EnumKeyword */: + case 48 /* EnumKeyword */: if (isIdentifier(nextToken)) { return parseEnumDeclaration(); } break; - case 52 /* InterfaceKeyword */: + case 54 /* InterfaceKeyword */: if (isIdentifier(nextToken)) { return parseInterfaceDeclaration(); } break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { + case 49 /* ExportKeyword */: + if (nextToken.kind() === 109 /* EqualsToken */) { return parseExportAssignment(); } break; @@ -22656,72 +23348,72 @@ var TypeScript; return tryParseStatementWorker(_currentToken, currentTokenKind, _modifierCount, inErrorRecovery); } function parseImportDeclaration() { - return new Parser.syntaxFactory.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(49 /* ImportKeyword */), eatIdentifierToken(), eatToken(107 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(51 /* ImportKeyword */), eatIdentifierToken(), eatToken(109 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); } function parseExportAssignment() { - return new Parser.syntaxFactory.ExportAssignmentSyntax(parseNodeData, eatToken(47 /* ExportKeyword */), eatToken(107 /* EqualsToken */), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ExportAssignmentSyntax(parseNodeData, eatToken(49 /* ExportKeyword */), eatToken(109 /* EqualsToken */), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(false)); } function parseModuleReference() { return isExternalModuleReference() ? parseExternalModuleReference() : parseModuleNameModuleReference(); } function isExternalModuleReference() { - return currentToken().kind() === 66 /* RequireKeyword */ && peekToken(1).kind() === 72 /* OpenParenToken */; + return currentToken().kind() === 68 /* RequireKeyword */ && peekToken(1).kind() === 74 /* OpenParenToken */; } function parseExternalModuleReference() { - return new Parser.syntaxFactory.ExternalModuleReferenceSyntax(parseNodeData, eatToken(66 /* RequireKeyword */), eatToken(72 /* OpenParenToken */), eatToken(14 /* StringLiteral */), eatToken(73 /* CloseParenToken */)); + return new TypeScript.ExternalModuleReferenceSyntax(parseNodeData, eatToken(68 /* RequireKeyword */), eatToken(74 /* OpenParenToken */), eatToken(12 /* StringLiteral */), eatToken(75 /* CloseParenToken */)); } function parseModuleNameModuleReference() { - return new Parser.syntaxFactory.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); + return new TypeScript.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); } function tryParseTypeArgumentList(inExpression) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; + if (_currentToken.kind() !== 82 /* LessThanToken */) { + return undefined; } if (!inExpression) { var lessThanToken = consumeToken(_currentToken); var skippedTokens = getArray(); var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(81 /* GreaterThanToken */)); + return new TypeScript.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(83 /* GreaterThanToken */)); } var rewindPoint = getRewindPoint(); var lessThanToken = consumeToken(_currentToken); var skippedTokens = getArray(); var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); var lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(81 /* GreaterThanToken */); + var greaterThanToken = eatToken(83 /* GreaterThanToken */); if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); + return new TypeScript.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); } } function canFollowTypeArgumentListInExpression(kind) { switch (kind) { - case 72 /* OpenParenToken */: - case 76 /* DotToken */: - case 73 /* CloseParenToken */: - case 75 /* CloseBracketToken */: - case 106 /* ColonToken */: - case 78 /* SemicolonToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - case 84 /* EqualsEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - case 103 /* AmpersandAmpersandToken */: - case 104 /* BarBarToken */: - case 100 /* CaretToken */: - case 98 /* AmpersandToken */: - case 99 /* BarToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: + case 74 /* OpenParenToken */: + case 78 /* DotToken */: + case 75 /* CloseParenToken */: + case 77 /* CloseBracketToken */: + case 108 /* ColonToken */: + case 80 /* SemicolonToken */: + case 81 /* CommaToken */: + case 107 /* QuestionToken */: + case 86 /* EqualsEqualsToken */: + case 89 /* EqualsEqualsEqualsToken */: + case 88 /* ExclamationEqualsToken */: + case 90 /* ExclamationEqualsEqualsToken */: + case 105 /* AmpersandAmpersandToken */: + case 106 /* BarBarToken */: + case 102 /* CaretToken */: + case 100 /* AmpersandToken */: + case 101 /* BarToken */: + case 73 /* CloseBraceToken */: + case 8 /* EndOfFileToken */: return true; default: return false; @@ -22735,7 +23427,7 @@ var TypeScript; if (TypeScript.SyntaxFacts.isAnyKeyword(_currentToken.kind()) && previousTokenHasTrailingNewLine(_currentToken)) { var token1 = peekToken(1); if (!TypeScript.existsNewLineBetweenTokens(_currentToken, token1, source.text) && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return createMissingToken(11 /* IdentifierName */, _currentToken); + return createMissingToken(9 /* IdentifierName */, _currentToken); } } return allowIdentifierNames ? eatIdentifierNameToken() : eatIdentifierToken(); @@ -22744,59 +23436,59 @@ var TypeScript; var token0 = currentToken(); var shouldContinue = isIdentifier(token0); if (!shouldContinue) { - return null; + return undefined; } var current = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === 76 /* DotToken */) { + while (shouldContinue && currentToken().kind() === 78 /* DotToken */) { var dotToken = consumeToken(currentToken()); var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new Parser.syntaxFactory.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); + current = new TypeScript.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); shouldContinue = identifierName.fullWidth() > 0; } return current; } function parseEnumDeclaration() { var modifiers = parseModifiers(); - var enumKeyword = eatToken(46 /* EnumKeyword */); + var enumKeyword = eatToken(48 /* EnumKeyword */); var identifier = eatIdentifierToken(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var enumElements = TypeScript.Syntax.emptySeparatedList(); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var enumElements; if (openBraceToken.fullWidth() > 0) { var skippedTokens = getArray(); enumElements = parseSeparatedSyntaxList(8 /* EnumDeclaration_EnumElements */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); } - return new Parser.syntaxFactory.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements || [], eatToken(73 /* CloseBraceToken */)); } function isEnumElement(inErrorRecovery) { var node = currentNode(); - if (node !== null && node.kind() === 244 /* EnumElement */) { + if (node && node.kind() === 209 /* EnumElement */) { return true; } return isPropertyName(currentToken(), inErrorRecovery); } function tryParseEnumElementEqualsValueClause() { - return isEqualsValueClause(false) ? parseEqualsValueClause(true) : null; + return isEqualsValueClause(false) ? parseEqualsValueClause(true) : undefined; } function tryParseEnumElement(inErrorRecovery) { var node = currentNode(); - if (node !== null && node.kind() === 244 /* EnumElement */) { + if (node && node.kind() === 209 /* EnumElement */) { consumeNode(node); return node; } if (!isPropertyName(currentToken(), inErrorRecovery)) { - return null; + return undefined; } - return new Parser.syntaxFactory.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); + return new TypeScript.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); } function isModifierKind(kind) { switch (kind) { - case 47 /* ExportKeyword */: - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: - case 63 /* DeclareKeyword */: + case 49 /* ExportKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: + case 60 /* StaticKeyword */: + case 65 /* DeclareKeyword */: return true; } return false; @@ -22806,10 +23498,10 @@ var TypeScript; var nextToken = peekToken(index + 1); var nextTokenKind = nextToken.kind(); switch (nextTokenKind) { - case 11 /* IdentifierName */: - case 74 /* OpenBracketToken */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: + case 9 /* IdentifierName */: + case 76 /* OpenBracketToken */: + case 11 /* NumericLiteral */: + case 12 /* StringLiteral */: return true; default: return TypeScript.SyntaxFacts.isAnyKeyword(nextTokenKind); @@ -22834,39 +23526,37 @@ var TypeScript; } break; } - var result = TypeScript.Syntax.list(tokens); - returnZeroLengthArray(tokens); - return result; + return TypeScript.Syntax.list(tokens); } function parseHeritageClauses() { - var heritageClauses = TypeScript.Syntax.emptyList(); + var heritageClauses; if (isHeritageClause()) { - heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, null); + heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, undefined); } - return heritageClauses; + return heritageClauses || []; } function tryParseHeritageClauseTypeName() { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : null; + return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : undefined; } function parseClassDeclaration() { var modifiers = parseModifiers(); - var classKeyword = eatToken(44 /* ClassKeyword */); + var classKeyword = eatToken(46 /* ClassKeyword */); var identifier = eatIdentifierToken(); var typeParameterList = tryParseTypeParameterList(false); var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var classElements = TypeScript.Syntax.emptyList(); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var classElements; if (openBraceToken.fullWidth() > 0) { var skippedTokens = getArray(); classElements = parseSyntaxList(1 /* ClassDeclaration_ClassElements */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); } ; - return new Parser.syntaxFactory.ClassDeclarationSyntax(parseNodeData, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ClassDeclarationSyntax(parseNodeData, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements || [], eatToken(73 /* CloseBraceToken */)); } function isAccessor(modifierCount, inErrorRecovery) { var tokenKind = peekToken(modifierCount).kind(); - if (tokenKind !== 64 /* GetKeyword */ && tokenKind !== 68 /* SetKeyword */) { + if (tokenKind !== 66 /* GetKeyword */ && tokenKind !== 70 /* SetKeyword */) { return false; } return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); @@ -22875,10 +23565,10 @@ var TypeScript; var modifiers = parseModifiers(); var _currenToken = currentToken(); var tokenKind = _currenToken.kind(); - if (tokenKind === 64 /* GetKeyword */) { + if (tokenKind === 66 /* GetKeyword */) { return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); } - else if (tokenKind === 68 /* SetKeyword */) { + else if (tokenKind === 70 /* SetKeyword */) { return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); } else { @@ -22886,10 +23576,10 @@ var TypeScript; } } function parseGetMemberAccessorDeclaration(modifiers, getKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); + return new TypeScript.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); } function parseSetMemberAccessorDeclaration(modifiers, setKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); + return new TypeScript.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); } function isClassElement(inErrorRecovery) { if (TypeScript.SyntaxUtilities.isClassElement(currentNode())) { @@ -22921,25 +23611,25 @@ var TypeScript; return parseIndexMemberDeclaration(); } else { - return null; + return undefined; } } function isConstructorDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 62 /* ConstructorKeyword */; + return peekToken(modifierCount).kind() === 64 /* ConstructorKeyword */; } function parseConstructorDeclaration() { var modifiers = parseModifiers(); - var constructorKeyword = eatToken(62 /* ConstructorKeyword */); + var constructorKeyword = eatToken(64 /* ConstructorKeyword */); var callSignature = parseCallSignature(false); - var semicolonToken = null; - var block = null; + var semicolonToken = undefined; + var block = undefined; if (isBlock()) { block = parseBlock(false, true); } else { semicolonToken = eatExplicitOrAutomaticSemicolon(false); } - return new Parser.syntaxFactory.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); + return new TypeScript.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); } function isMemberFunctionDeclaration(modifierCount, inErrorRecovery) { return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); @@ -22949,25 +23639,25 @@ var TypeScript; var propertyName = eatPropertyName(); var callSignature = parseCallSignature(false); var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var block = null; - var semicolon = null; + var block = undefined; + var semicolon = undefined; if (parseBlockEvenWithNoOpenBrace || isBlock()) { block = parseBlock(parseBlockEvenWithNoOpenBrace, true); } else { semicolon = eatExplicitOrAutomaticSemicolon(false); } - return new Parser.syntaxFactory.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); + return new TypeScript.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); } function isDefinitelyMemberVariablePropertyName(index) { if (TypeScript.SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { var nextToken = peekToken(index + 1); switch (nextToken.kind()) { - case 78 /* SemicolonToken */: - case 107 /* EqualsToken */: - case 106 /* ColonToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: + case 80 /* SemicolonToken */: + case 109 /* EqualsToken */: + case 108 /* ColonToken */: + case 73 /* CloseBraceToken */: + case 8 /* EndOfFileToken */: return true; default: return previousTokenHasTrailingNewLine(nextToken); @@ -22981,92 +23671,90 @@ var TypeScript; return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); } function parseMemberVariableDeclaration() { - return new Parser.syntaxFactory.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); } function isIndexMemberDeclaration(modifierCount) { return isIndexSignature(modifierCount); } function parseIndexMemberDeclaration() { - return new Parser.syntaxFactory.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); } function tryAddUnexpectedEqualsGreaterThanToken(callSignature) { var token0 = currentToken(); - var hasEqualsGreaterThanToken = token0.kind() === 85 /* EqualsGreaterThanToken */; + var hasEqualsGreaterThanToken = token0.kind() === 87 /* EqualsGreaterThanToken */; if (hasEqualsGreaterThanToken) { var _lastToken = TypeScript.lastToken(callSignature); if (_lastToken && _lastToken.fullWidth() > 0) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(70 /* OpenBraceToken */)]); + var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(72 /* OpenBraceToken */)]); addDiagnostic(diagnostic); consumeToken(token0); - if (Parser.syntaxFactory.isConcrete) { - addSkippedTokenAfterNode(callSignature, token0); - } + addSkippedTokenAfterNode(callSignature, token0); return true; } } return false; } function isFunctionDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 27 /* FunctionKeyword */; + return peekToken(modifierCount).kind() === 29 /* FunctionKeyword */; } function parseFunctionDeclaration() { var modifiers = parseModifiers(); - var functionKeyword = eatToken(27 /* FunctionKeyword */); + var functionKeyword = eatToken(29 /* FunctionKeyword */); var identifier = eatIdentifierToken(); var callSignature = parseCallSignature(false); var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var semicolonToken = null; - var block = null; + var semicolonToken = undefined; + var block = undefined; if (parseBlockEvenWithNoOpenBrace || isBlock()) { block = parseBlock(parseBlockEvenWithNoOpenBrace, true); } else { semicolonToken = eatExplicitOrAutomaticSemicolon(false); } - return new Parser.syntaxFactory.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); + return new TypeScript.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); } function parseModuleDeclaration() { var modifiers = parseModifiers(); - var moduleKeyword = eatToken(65 /* ModuleKeyword */); - var moduleName = null; - var stringLiteral = null; - if (currentToken().kind() === 14 /* StringLiteral */) { - stringLiteral = eatToken(14 /* StringLiteral */); + var moduleKeyword = eatToken(67 /* ModuleKeyword */); + var moduleName = undefined; + var stringLiteral = undefined; + if (currentToken().kind() === 12 /* StringLiteral */) { + stringLiteral = eatToken(12 /* StringLiteral */); } else { moduleName = parseName(false); } - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var moduleElements = TypeScript.Syntax.emptyList(); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var moduleElements; if (openBraceToken.fullWidth() > 0) { var skippedTokens = getArray(); moduleElements = parseSyntaxList(2 /* ModuleDeclaration_ModuleElements */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); } - return new Parser.syntaxFactory.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements || [], eatToken(73 /* CloseBraceToken */)); } function parseInterfaceDeclaration() { - return new Parser.syntaxFactory.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(52 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); + return new TypeScript.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(54 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); } function parseObjectType() { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var typeMembers = TypeScript.Syntax.emptySeparatedList(); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var typeMembers; if (openBraceToken.fullWidth() > 0) { var skippedTokens = getArray(); typeMembers = parseSeparatedSyntaxList(9 /* ObjectType_TypeMembers */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); } - return new Parser.syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers || [], eatToken(73 /* CloseBraceToken */)); } function parseTupleType(currentToken) { var openBracket = consumeToken(currentToken); - var types = TypeScript.Syntax.emptySeparatedList(); + var types; if (openBracket.fullWidth() > 0) { var skippedTokens = getArray(); types = parseSeparatedSyntaxList(21 /* TupleType_Types */, skippedTokens); openBracket = addSkippedTokensAfterToken(openBracket, skippedTokens); } - return new Parser.syntaxFactory.TupleTypeSyntax(parseNodeData, openBracket, types, eatToken(75 /* CloseBracketToken */)); + return new TypeScript.TupleTypeSyntax(parseNodeData, openBracket, types || [], eatToken(77 /* CloseBracketToken */)); } function isTypeMember(inErrorRecovery) { if (TypeScript.SyntaxUtilities.isTypeMember(currentNode())) { @@ -23096,44 +23784,44 @@ var TypeScript; return parsePropertySignature(); } else { - return null; + return undefined; } } function parseConstructSignature() { - return new Parser.syntaxFactory.ConstructSignatureSyntax(parseNodeData, eatToken(31 /* NewKeyword */), parseCallSignature(false)); + return new TypeScript.ConstructSignatureSyntax(parseNodeData, eatToken(33 /* NewKeyword */), parseCallSignature(false)); } function parseIndexSignature() { - var openBracketToken = eatToken(74 /* OpenBracketToken */); + var openBracketToken = eatToken(76 /* OpenBracketToken */); var skippedTokens = getArray(); var parameters = parseSeparatedSyntaxList(18 /* IndexSignature_Parameters */, skippedTokens); openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(75 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); + return new TypeScript.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(77 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); } function parseMethodSignature() { - return new Parser.syntaxFactory.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseCallSignature(false)); + return new TypeScript.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(107 /* QuestionToken */), parseCallSignature(false)); } function parsePropertySignature() { - return new Parser.syntaxFactory.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseOptionalTypeAnnotation(false)); + return new TypeScript.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(107 /* QuestionToken */), parseOptionalTypeAnnotation(false)); } function isCallSignature(peekIndex) { var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === 72 /* OpenParenToken */ || tokenKind === 80 /* LessThanToken */; + return tokenKind === 74 /* OpenParenToken */ || tokenKind === 82 /* LessThanToken */; } function isConstructSignature() { - if (currentToken().kind() !== 31 /* NewKeyword */) { + if (currentToken().kind() !== 33 /* NewKeyword */) { return false; } return isCallSignature(1); } function isIndexSignature(peekIndex) { - return peekToken(peekIndex).kind() === 74 /* OpenBracketToken */; + return peekToken(peekIndex).kind() === 76 /* OpenBracketToken */; } function isMethodSignature(inErrorRecovery) { if (isPropertyName(currentToken(), inErrorRecovery)) { if (isCallSignature(1)) { return true; } - if (peekToken(1).kind() === 105 /* QuestionToken */ && isCallSignature(2)) { + if (peekToken(1).kind() === 107 /* QuestionToken */ && isCallSignature(2)) { return true; } } @@ -23150,11 +23838,11 @@ var TypeScript; } function isHeritageClause() { var tokenKind = currentToken().kind(); - return tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */; + return tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */; } function isNotHeritageClauseTypeName() { var tokenKind = currentToken().kind(); - if (tokenKind === 51 /* ImplementsKeyword */ || tokenKind === 48 /* ExtendsKeyword */) { + if (tokenKind === 53 /* ImplementsKeyword */ || tokenKind === 50 /* ExtendsKeyword */) { return isIdentifier(peekToken(1)); } return false; @@ -23168,47 +23856,38 @@ var TypeScript; function tryParseHeritageClause() { var extendsOrImplementsKeyword = currentToken(); var tokenKind = extendsOrImplementsKeyword.kind(); - if (tokenKind !== 48 /* ExtendsKeyword */ && tokenKind !== 51 /* ImplementsKeyword */) { - return null; + if (tokenKind !== 50 /* ExtendsKeyword */ && tokenKind !== 53 /* ImplementsKeyword */) { + return undefined; } consumeToken(extendsOrImplementsKeyword); var skippedTokens = getArray(); var typeNames = parseSeparatedSyntaxList(11 /* HeritageClause_TypeNameList */, skippedTokens); extendsOrImplementsKeyword = addSkippedTokensAfterToken(extendsOrImplementsKeyword, skippedTokens); - return new Parser.syntaxFactory.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); + return new TypeScript.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); } - function isInterfaceEnumClassModuleImportOrExport(modifierCount) { - var _currentToken = currentToken(); + function isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken) { if (modifierCount) { switch (peekToken(modifierCount).kind()) { - case 49 /* ImportKeyword */: - case 65 /* ModuleKeyword */: - case 52 /* InterfaceKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: + case 51 /* ImportKeyword */: + case 67 /* ModuleKeyword */: + case 54 /* InterfaceKeyword */: + case 46 /* ClassKeyword */: + case 48 /* EnumKeyword */: return true; } } + _currentToken = _currentToken || currentToken(); var nextToken = peekToken(1); switch (_currentToken.kind()) { - case 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { - return true; - } - break; - case 49 /* ImportKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return true; - } - break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { - return true; - } - break; + case 67 /* ModuleKeyword */: + return isIdentifier(nextToken) || nextToken.kind() === 12 /* StringLiteral */; + case 51 /* ImportKeyword */: + case 46 /* ClassKeyword */: + case 48 /* EnumKeyword */: + case 54 /* InterfaceKeyword */: + return isIdentifier(nextToken); + case 49 /* ExportKeyword */: + return nextToken.kind() === 109 /* EqualsToken */; } return false; } @@ -23219,31 +23898,31 @@ var TypeScript; var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: + case 60 /* StaticKeyword */: var token1 = peekToken(1); if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { return false; } break; - case 28 /* IfKeyword */: - case 70 /* OpenBraceToken */: - case 33 /* ReturnKeyword */: - case 34 /* SwitchKeyword */: - case 36 /* ThrowKeyword */: - case 15 /* BreakKeyword */: - case 18 /* ContinueKeyword */: - case 26 /* ForKeyword */: - case 42 /* WhileKeyword */: - case 43 /* WithKeyword */: - case 22 /* DoKeyword */: - case 38 /* TryKeyword */: - case 19 /* DebuggerKeyword */: + case 30 /* IfKeyword */: + case 72 /* OpenBraceToken */: + case 35 /* ReturnKeyword */: + case 36 /* SwitchKeyword */: + case 38 /* ThrowKeyword */: + case 17 /* BreakKeyword */: + case 20 /* ContinueKeyword */: + case 28 /* ForKeyword */: + case 44 /* WhileKeyword */: + case 45 /* WithKeyword */: + case 24 /* DoKeyword */: + case 40 /* TryKeyword */: + case 21 /* DebuggerKeyword */: return true; } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { return false; } return isLabeledStatement(_currentToken) || isVariableStatement(modifierCount) || isFunctionDeclaration(modifierCount) || isEmptyStatement(_currentToken, inErrorRecovery) || isExpressionStatement(_currentToken); @@ -23263,45 +23942,32 @@ var TypeScript; } function tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount, inErrorRecovery) { switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: + case 60 /* StaticKeyword */: if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { - return null; + return undefined; } else { break; } - case 28 /* IfKeyword */: - return parseIfStatement(_currentToken); - case 70 /* OpenBraceToken */: - return parseBlock(false, false); - case 33 /* ReturnKeyword */: - return parseReturnStatement(_currentToken); - case 34 /* SwitchKeyword */: - return parseSwitchStatement(_currentToken); - case 36 /* ThrowKeyword */: - return parseThrowStatement(_currentToken); - case 15 /* BreakKeyword */: - return parseBreakStatement(_currentToken); - case 18 /* ContinueKeyword */: - return parseContinueStatement(_currentToken); - case 26 /* ForKeyword */: - return parseForOrForInStatement(_currentToken); - case 42 /* WhileKeyword */: - return parseWhileStatement(_currentToken); - case 43 /* WithKeyword */: - return parseWithStatement(_currentToken); - case 22 /* DoKeyword */: - return parseDoStatement(_currentToken); - case 38 /* TryKeyword */: - return parseTryStatement(_currentToken); - case 19 /* DebuggerKeyword */: - return parseDebuggerStatement(_currentToken); + case 30 /* IfKeyword */: return parseIfStatement(_currentToken); + case 72 /* OpenBraceToken */: return parseBlock(false, false); + case 35 /* ReturnKeyword */: return parseReturnStatement(_currentToken); + case 36 /* SwitchKeyword */: return parseSwitchStatement(_currentToken); + case 38 /* ThrowKeyword */: return parseThrowStatement(_currentToken); + case 17 /* BreakKeyword */: return parseBreakStatement(_currentToken); + case 20 /* ContinueKeyword */: return parseContinueStatement(_currentToken); + case 28 /* ForKeyword */: return parseForOrForInStatement(_currentToken); + case 44 /* WhileKeyword */: return parseWhileStatement(_currentToken); + case 45 /* WithKeyword */: return parseWithStatement(_currentToken); + case 24 /* DoKeyword */: return parseDoStatement(_currentToken); + case 40 /* TryKeyword */: return parseTryStatement(_currentToken); + case 21 /* DebuggerKeyword */: return parseDebuggerStatement(_currentToken); } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return null; + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { + return undefined; } else if (isVariableStatement(modifierCount)) { return parseVariableStatement(); @@ -23319,20 +23985,20 @@ var TypeScript; return parseExpressionStatement(); } else { - return null; + return undefined; } } function parseDebuggerStatement(debuggerKeyword) { - return new Parser.syntaxFactory.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); } function parseDoStatement(doKeyword) { - return new Parser.syntaxFactory.DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(false), eatToken(42 /* WhileKeyword */), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), eatExplicitOrAutomaticSemicolon(true)); + return new TypeScript.DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(false), eatToken(44 /* WhileKeyword */), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), eatExplicitOrAutomaticSemicolon(true)); } function isLabeledStatement(currentToken) { - return isIdentifier(currentToken) && peekToken(1).kind() === 106 /* ColonToken */; + return isIdentifier(currentToken) && peekToken(1).kind() === 108 /* ColonToken */; } function parseLabeledStatement(identifierToken) { - return new Parser.syntaxFactory.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(106 /* ColonToken */), parseStatement(false)); + return new TypeScript.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(108 /* ColonToken */), parseStatement(false)); } function parseTryStatement(tryKeyword) { var tryKeyword = consumeToken(tryKeyword); @@ -23340,15 +24006,15 @@ var TypeScript; listParsingState |= (1 << 6 /* TryBlock_Statements */); var block = parseBlock(false, false); listParsingState = savedListParsingState; - var catchClause = null; - if (currentToken().kind() === 17 /* CatchKeyword */) { + var catchClause = undefined; + if (currentToken().kind() === 19 /* CatchKeyword */) { catchClause = parseCatchClause(); } - var finallyClause = null; - if (catchClause === null || currentToken().kind() === 25 /* FinallyKeyword */) { + var finallyClause = undefined; + if (!catchClause || currentToken().kind() === 27 /* FinallyKeyword */) { finallyClause = parseFinallyClause(); } - return new Parser.syntaxFactory.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); + return new TypeScript.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); } function parseCatchClauseBlock() { var savedListParsingState = listParsingState; @@ -23358,35 +24024,35 @@ var TypeScript; return block; } function parseCatchClause() { - return new Parser.syntaxFactory.CatchClauseSyntax(parseNodeData, eatToken(17 /* CatchKeyword */), eatToken(72 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(73 /* CloseParenToken */), parseCatchClauseBlock()); + return new TypeScript.CatchClauseSyntax(parseNodeData, eatToken(19 /* CatchKeyword */), eatToken(74 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(75 /* CloseParenToken */), parseCatchClauseBlock()); } function parseFinallyClause() { - return new Parser.syntaxFactory.FinallyClauseSyntax(parseNodeData, eatToken(25 /* FinallyKeyword */), parseBlock(false, false)); + return new TypeScript.FinallyClauseSyntax(parseNodeData, eatToken(27 /* FinallyKeyword */), parseBlock(false, false)); } function parseWithStatement(withKeyword) { - return new Parser.syntaxFactory.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); + return new TypeScript.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); } function parseWhileStatement(whileKeyword) { - return new Parser.syntaxFactory.WhileStatementSyntax(parseNodeData, consumeToken(whileKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); + return new TypeScript.WhileStatementSyntax(parseNodeData, consumeToken(whileKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); } function isEmptyStatement(currentToken, inErrorRecovery) { if (inErrorRecovery) { return false; } - return currentToken.kind() === 78 /* SemicolonToken */; + return currentToken.kind() === 80 /* SemicolonToken */; } function parseEmptyStatement(semicolonToken) { - return new Parser.syntaxFactory.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); + return new TypeScript.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); } function parseForOrForInStatement(forKeyword) { consumeToken(forKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); + var openParenToken = eatToken(74 /* OpenParenToken */); var _currentToken = currentToken(); var tokenKind = _currentToken.kind(); - if (tokenKind === 40 /* VarKeyword */) { + if (tokenKind === 42 /* VarKeyword */) { return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); } - else if (tokenKind === 78 /* SemicolonToken */) { + else if (tokenKind === 80 /* SemicolonToken */) { return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); } else { @@ -23395,70 +24061,70 @@ var TypeScript; } function parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken) { var variableDeclaration = parseVariableDeclaration(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); + return currentToken().kind() === 31 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined); } function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForInStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(29 /* InKeyword */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); + return new TypeScript.ForInStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(31 /* InKeyword */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); } function parseForOrForInStatementWithInitializer(forKeyword, openParenToken) { var initializer = parseExpression(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); + return currentToken().kind() === 31 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer); } function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken) { - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, null); + return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, undefined); } function tryParseForStatementCondition() { var tokenKind = currentToken().kind(); - if (tokenKind !== 78 /* SemicolonToken */ && tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { + if (tokenKind !== 80 /* SemicolonToken */ && tokenKind !== 75 /* CloseParenToken */ && tokenKind !== 8 /* EndOfFileToken */) { return parseExpression(true); } - return null; + return undefined; } function tryParseForStatementIncrementor() { var tokenKind = currentToken().kind(); - if (tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { + if (tokenKind !== 75 /* CloseParenToken */ && tokenKind !== 8 /* EndOfFileToken */) { return parseExpression(true); } - return null; + return undefined; } function parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(78 /* SemicolonToken */), tryParseForStatementCondition(), eatToken(78 /* SemicolonToken */), tryParseForStatementIncrementor(), eatToken(73 /* CloseParenToken */), parseStatement(false)); + return new TypeScript.ForStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(80 /* SemicolonToken */), tryParseForStatementCondition(), eatToken(80 /* SemicolonToken */), tryParseForStatementIncrementor(), eatToken(75 /* CloseParenToken */), parseStatement(false)); } function tryEatBreakOrContinueLabel() { - var identifier = null; + var identifier = undefined; if (!canEatExplicitOrAutomaticSemicolon(false)) { if (isIdentifier(currentToken())) { return eatIdentifierToken(); } } - return null; + return undefined; } function parseBreakStatement(breakKeyword) { - return new Parser.syntaxFactory.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); } function parseContinueStatement(continueKeyword) { - return new Parser.syntaxFactory.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); } function parseSwitchStatement(switchKeyword) { consumeToken(switchKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); + var openParenToken = eatToken(74 /* OpenParenToken */); var expression = parseExpression(true); - var closeParenToken = eatToken(73 /* CloseParenToken */); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var switchClauses = TypeScript.Syntax.emptyList(); + var closeParenToken = eatToken(75 /* CloseParenToken */); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var switchClauses; if (openBraceToken.fullWidth() > 0) { var skippedTokens = getArray(); switchClauses = parseSyntaxList(3 /* SwitchStatement_SwitchClauses */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); } - return new Parser.syntaxFactory.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses || [], eatToken(73 /* CloseBraceToken */)); } function isSwitchClause() { if (TypeScript.SyntaxUtilities.isSwitchClause(currentNode())) { return true; } var currentTokenKind = currentToken().kind(); - return currentTokenKind === 16 /* CaseKeyword */ || currentTokenKind === 20 /* DefaultKeyword */; + return currentTokenKind === 18 /* CaseKeyword */ || currentTokenKind === 22 /* DefaultKeyword */; } function tryParseSwitchClause() { var node = currentNode(); @@ -23468,136 +24134,138 @@ var TypeScript; } var _currentToken = currentToken(); var kind = _currentToken.kind(); - if (kind === 16 /* CaseKeyword */) { + if (kind === 18 /* CaseKeyword */) { return parseCaseSwitchClause(_currentToken); } - else if (kind === 20 /* DefaultKeyword */) { + else if (kind === 22 /* DefaultKeyword */) { return parseDefaultSwitchClause(_currentToken); } else { - return null; + return undefined; } } function parseCaseSwitchClause(caseKeyword) { consumeToken(caseKeyword); var expression = parseExpression(true); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); + var colonToken = eatToken(108 /* ColonToken */); + var statements; if (colonToken.fullWidth() > 0) { var skippedTokens = getArray(); statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); } - return new Parser.syntaxFactory.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements); + return new TypeScript.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements || []); } function parseDefaultSwitchClause(defaultKeyword) { consumeToken(defaultKeyword); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); + var colonToken = eatToken(108 /* ColonToken */); + var statements; if (colonToken.fullWidth() > 0) { var skippedTokens = getArray(); statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); } - return new Parser.syntaxFactory.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements); + return new TypeScript.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements || []); } function parseThrowStatementExpression() { - return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(11 /* IdentifierName */, null) : parseExpression(true); + return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(9 /* IdentifierName */, undefined) : parseExpression(true); } function parseThrowStatement(throwKeyword) { - return new Parser.syntaxFactory.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); } function tryParseReturnStatementExpression() { - return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : null; + return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : undefined; } function parseReturnStatement(returnKeyword) { - return new Parser.syntaxFactory.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); } function isExpressionStatement(currentToken) { var tokenKind = currentToken.kind(); - return tokenKind !== 70 /* OpenBraceToken */ && tokenKind !== 27 /* FunctionKeyword */ && isExpression(currentToken); + return tokenKind !== 72 /* OpenBraceToken */ && tokenKind !== 29 /* FunctionKeyword */ && isExpression(currentToken); } function isAssignmentOrOmittedExpression() { var _currentToken = currentToken(); - return _currentToken.kind() === 79 /* CommaToken */ || isExpression(_currentToken); + return _currentToken.kind() === 81 /* CommaToken */ || isExpression(_currentToken); } function tryParseAssignmentOrOmittedExpression() { - if (currentToken().kind() === 79 /* CommaToken */) { - return new Parser.syntaxFactory.OmittedExpressionSyntax(parseNodeData); + if (currentToken().kind() === 81 /* CommaToken */) { + return new TypeScript.OmittedExpressionSyntax(parseNodeData); } return tryParseAssignmentExpressionOrHigher(false, true); } function isExpression(currentToken) { switch (currentToken.kind()) { - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 12 /* RegularExpressionLiteral */: - case 74 /* OpenBracketToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 70 /* OpenBraceToken */: - case 85 /* EqualsGreaterThanToken */: - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - case 50 /* SuperKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 31 /* NewKeyword */: - case 21 /* DeleteKeyword */: - case 41 /* VoidKeyword */: - case 39 /* TypeOfKeyword */: - case 27 /* FunctionKeyword */: + case 11 /* NumericLiteral */: + case 12 /* StringLiteral */: + case 10 /* RegularExpressionLiteral */: + case 13 /* NoSubstitutionTemplateToken */: + case 14 /* TemplateStartToken */: + case 76 /* OpenBracketToken */: + case 74 /* OpenParenToken */: + case 82 /* LessThanToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 104 /* TildeToken */: + case 103 /* ExclamationToken */: + case 72 /* OpenBraceToken */: + case 87 /* EqualsGreaterThanToken */: + case 120 /* SlashToken */: + case 121 /* SlashEqualsToken */: + case 52 /* SuperKeyword */: + case 37 /* ThisKeyword */: + case 39 /* TrueKeyword */: + case 26 /* FalseKeyword */: + case 34 /* NullKeyword */: + case 33 /* NewKeyword */: + case 23 /* DeleteKeyword */: + case 43 /* VoidKeyword */: + case 41 /* TypeOfKeyword */: + case 29 /* FunctionKeyword */: return true; } return isIdentifier(currentToken); } function parseExpressionStatement() { - return new Parser.syntaxFactory.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); } function parseIfStatement(ifKeyword) { - return new Parser.syntaxFactory.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); + return new TypeScript.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); } function parseOptionalElseClause() { - return currentToken().kind() === 23 /* ElseKeyword */ ? parseElseClause() : null; + return currentToken().kind() === 25 /* ElseKeyword */ ? parseElseClause() : undefined; } function parseElseClause() { - return new Parser.syntaxFactory.ElseClauseSyntax(parseNodeData, eatToken(23 /* ElseKeyword */), parseStatement(false)); + return new TypeScript.ElseClauseSyntax(parseNodeData, eatToken(25 /* ElseKeyword */), parseStatement(false)); } function isVariableStatement(modifierCount) { - return peekToken(modifierCount).kind() === 40 /* VarKeyword */; + return peekToken(modifierCount).kind() === 42 /* VarKeyword */; } function parseVariableStatement() { - return new Parser.syntaxFactory.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); } function parseVariableDeclaration(allowIn) { - var varKeyword = eatToken(40 /* VarKeyword */); + var varKeyword = eatToken(42 /* VarKeyword */); var listParsingState = allowIn ? 12 /* VariableDeclaration_VariableDeclarators_AllowIn */ : 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */; var skippedTokens = getArray(); var variableDeclarators = parseSeparatedSyntaxList(listParsingState, skippedTokens); varKeyword = addSkippedTokensAfterToken(varKeyword, skippedTokens); - return new Parser.syntaxFactory.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); + return new TypeScript.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); } function isVariableDeclarator() { var node = currentNode(); - if (node !== null && node.kind() === 226 /* VariableDeclarator */) { + if (node && node.kind() === 191 /* VariableDeclarator */) { return true; } return isIdentifier(currentToken()); } function canReuseVariableDeclaratorNode(node) { - if (node === null || node.kind() !== 226 /* VariableDeclarator */) { + if (!node || node.kind() !== 191 /* VariableDeclarator */) { return false; } var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; + return variableDeclarator.equalsValueClause === undefined; } function tryParseVariableDeclarator(allowIn, allowPropertyName) { var node = currentNode(); @@ -23608,30 +24276,30 @@ var TypeScript; if (allowPropertyName) { } if (!allowPropertyName && !isIdentifier(currentToken())) { - return null; + return undefined; } var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause = null; - var typeAnnotation = null; + var equalsValueClause = undefined; + var typeAnnotation = undefined; if (propertyName.fullWidth() > 0) { typeAnnotation = parseOptionalTypeAnnotation(false); if (isEqualsValueClause(false)) { equalsValueClause = parseEqualsValueClause(allowIn); } } - return new Parser.syntaxFactory.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); + return new TypeScript.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); } function isEqualsValueClause(inParameter) { var token0 = currentToken(); - if (token0.kind() === 107 /* EqualsToken */) { + if (token0.kind() === 109 /* EqualsToken */) { return true; } if (!previousTokenHasTrailingNewLine(token0)) { var tokenKind = token0.kind(); - if (tokenKind === 85 /* EqualsGreaterThanToken */) { + if (tokenKind === 87 /* EqualsGreaterThanToken */) { return false; } - if (tokenKind === 70 /* OpenBraceToken */ && inParameter) { + if (tokenKind === 72 /* OpenBraceToken */ && inParameter) { return false; } return isExpression(token0); @@ -23639,33 +24307,33 @@ var TypeScript; return false; } function parseEqualsValueClause(allowIn) { - return new Parser.syntaxFactory.EqualsValueClauseSyntax(parseNodeData, eatToken(107 /* EqualsToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); + return new TypeScript.EqualsValueClauseSyntax(parseNodeData, eatToken(109 /* EqualsToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); } function parseExpression(allowIn) { var leftOperand = tryParseAssignmentExpressionOrHigher(true, allowIn); while (true) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 79 /* CommaToken */) { + if (_currentToken.kind() !== 81 /* CommaToken */) { break; } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); + leftOperand = new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); } return leftOperand; } function tryParseAssignmentExpressionOrHigher(force, allowIn) { var _currentToken = currentToken(); var arrowFunction = tryParseAnyArrowFunctionExpression(_currentToken); - if (arrowFunction !== null) { + if (arrowFunction) { return arrowFunction; } var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, 1 /* Lowest */, allowIn); - if (leftOperand === null) { - return null; + if (leftOperand === undefined) { + return undefined; } if (TypeScript.SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { var operatorToken = currentOperatorToken(); if (TypeScript.SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); + return new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); } } return parseConditionalExpressionRest(allowIn, leftOperand); @@ -23676,68 +24344,64 @@ var TypeScript; function tryParseUnaryExpressionOrHigher(_currentToken, force) { var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - return new Parser.syntaxFactory.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), true)); - case 39 /* TypeOfKeyword */: - return parseTypeOfExpression(_currentToken); - case 41 /* VoidKeyword */: - return parseVoidExpression(_currentToken); - case 21 /* DeleteKeyword */: - return parseDeleteExpression(_currentToken); - case 80 /* LessThanToken */: - return parseCastExpression(_currentToken); + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 104 /* TildeToken */: + case 103 /* ExclamationToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: + return new TypeScript.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), true)); + case 41 /* TypeOfKeyword */: return parseTypeOfExpression(_currentToken); + case 43 /* VoidKeyword */: return parseVoidExpression(_currentToken); + case 23 /* DeleteKeyword */: return parseDeleteExpression(_currentToken); + case 82 /* LessThanToken */: return parseCastExpression(_currentToken); default: return tryParsePostfixExpressionOrHigher(_currentToken, force); } } function tryParseBinaryExpressionOrHigher(_currentToken, force, precedence, allowIn) { var leftOperand = tryParseUnaryExpressionOrHigher(_currentToken, force); - if (leftOperand === null) { - return null; + if (leftOperand === undefined) { + return undefined; } return parseBinaryExpressionRest(precedence, allowIn, leftOperand); } function parseConditionalExpressionRest(allowIn, leftOperand) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 105 /* QuestionToken */) { + if (_currentToken.kind() !== 107 /* QuestionToken */) { return leftOperand; } - return new Parser.syntaxFactory.ConditionalExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, true), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); + return new TypeScript.ConditionalExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, true), eatToken(108 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); } function parseBinaryExpressionRest(precedence, allowIn, leftOperand) { while (true) { var operatorToken = currentOperatorToken(); var tokenKind = operatorToken.kind(); - if (!TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || tokenKind === 79 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { + if (!TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || tokenKind === 81 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { break; } - if (tokenKind === 29 /* InKeyword */ && !allowIn) { + if (tokenKind === 31 /* InKeyword */ && !allowIn) { break; } var newPrecedence = getBinaryExpressionPrecedence(tokenKind); if (newPrecedence <= precedence) { break; } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); + leftOperand = new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); } return leftOperand; } function currentOperatorToken() { var token0 = currentToken(); - if (token0.kind() === 81 /* GreaterThanToken */) { + if (token0.kind() === 83 /* GreaterThanToken */) { return currentContextualToken(); } return token0; } function tryParseMemberExpressionOrHigher(_currentToken, force, inObjectCreation) { var expression = tryParsePrimaryExpression(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } return parseMemberExpressionRest(expression, inObjectCreation); } @@ -23746,21 +24410,25 @@ var TypeScript; var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 72 /* OpenParenToken */: - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(null)); + case 74 /* OpenParenToken */: + expression = new TypeScript.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(undefined)); continue; - case 80 /* LessThanToken */: + case 82 /* LessThanToken */: var argumentList = tryParseArgumentList(); - if (argumentList === null) { + if (argumentList === undefined) { break; } - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, argumentList); + expression = new TypeScript.InvocationExpressionSyntax(parseNodeData, expression, argumentList); continue; - case 74 /* OpenBracketToken */: + case 76 /* OpenBracketToken */: expression = parseElementAccessExpression(expression, _currentToken, false); continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + case 78 /* DotToken */: + expression = new TypeScript.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + continue; + case 13 /* NoSubstitutionTemplateToken */: + case 14 /* TemplateStartToken */: + expression = new TypeScript.TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); continue; } return expression; @@ -23771,25 +24439,29 @@ var TypeScript; var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 74 /* OpenBracketToken */: + case 76 /* OpenBracketToken */: expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + case 78 /* DotToken */: + expression = new TypeScript.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + continue; + case 13 /* NoSubstitutionTemplateToken */: + case 14 /* TemplateStartToken */: + expression = new TypeScript.TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); continue; } return expression; } } function tryParseLeftHandSideExpressionOrHigher(_currentToken, force) { - var expression = null; - if (_currentToken.kind() === 50 /* SuperKeyword */) { + var expression = undefined; + if (_currentToken.kind() === 52 /* SuperKeyword */) { expression = parseSuperExpression(_currentToken); } else { expression = tryParseMemberExpressionOrHigher(_currentToken, force, false); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } } return parseCallExpressionRest(expression); @@ -23797,22 +24469,22 @@ var TypeScript; function parseSuperExpression(superToken) { var expression = consumeToken(superToken); var currentTokenKind = currentToken().kind(); - return currentTokenKind === 72 /* OpenParenToken */ || currentTokenKind === 76 /* DotToken */ ? expression : new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(76 /* DotToken */), eatIdentifierNameToken()); + return currentTokenKind === 74 /* OpenParenToken */ || currentTokenKind === 78 /* DotToken */ ? expression : new TypeScript.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(78 /* DotToken */), eatIdentifierNameToken()); } function tryParsePostfixExpressionOrHigher(_currentToken, force) { var expression = tryParseLeftHandSideExpressionOrHigher(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: if (previousTokenHasTrailingNewLine(_currentToken)) { break; } - return new Parser.syntaxFactory.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); + return new TypeScript.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); } return expression; } @@ -23821,21 +24493,21 @@ var TypeScript; var typeArgumentList = tryParseTypeArgumentList(true); var token0 = currentToken(); var tokenKind = token0.kind(); - var isOpenParen = tokenKind === 72 /* OpenParenToken */; - var isDot = tokenKind === 76 /* DotToken */; + var isOpenParen = tokenKind === 74 /* OpenParenToken */; + var isDot = tokenKind === 78 /* DotToken */; var isOpenParenOrDot = isOpenParen || isDot; - var argumentList = null; - if (typeArgumentList === null || !isOpenParenOrDot) { + var argumentList = undefined; + if (!typeArgumentList || !isOpenParenOrDot) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); if (isDot) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); + var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, undefined); addDiagnostic(diagnostic); - return new Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList(), TypeScript.Syntax.emptyToken(73 /* CloseParenToken */)); + return new TypeScript.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(74 /* OpenParenToken */), [], TypeScript.Syntax.emptyToken(75 /* CloseParenToken */)); } else { return parseArgumentList(typeArgumentList); @@ -23844,42 +24516,42 @@ var TypeScript; } function tryParseArgumentList() { var tokenKind = currentToken().kind(); - if (tokenKind === 80 /* LessThanToken */) { + if (tokenKind === 82 /* LessThanToken */) { return tryParseGenericArgumentList(); } - if (tokenKind === 72 /* OpenParenToken */) { - return parseArgumentList(null); + if (tokenKind === 74 /* OpenParenToken */) { + return parseArgumentList(undefined); } - return null; + return undefined; } function parseArgumentList(typeArgumentList) { - var openParenToken = eatToken(72 /* OpenParenToken */); - var _arguments = TypeScript.Syntax.emptySeparatedList(); + var openParenToken = eatToken(74 /* OpenParenToken */); + var _arguments; if (openParenToken.fullWidth() > 0) { var skippedTokens = getArray(); _arguments = parseSeparatedSyntaxList(14 /* ArgumentList_AssignmentExpressions */, skippedTokens); openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); } - return new Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments, eatToken(73 /* CloseParenToken */)); + return new TypeScript.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments || [], eatToken(75 /* CloseParenToken */)); } function tryParseArgumentListExpression() { - var force = currentToken().kind() === 79 /* CommaToken */; + var force = currentToken().kind() === 81 /* CommaToken */; return tryParseAssignmentExpressionOrHigher(force, true); } function parseElementAccessArgumentExpression(openBracketToken, inObjectCreation) { - if (inObjectCreation && currentToken().kind() === 75 /* CloseBracketToken */) { + if (inObjectCreation && currentToken().kind() === 77 /* CloseBracketToken */) { var errorStart = TypeScript.start(openBracketToken, source.text); var errorEnd = TypeScript.end(currentToken(), source.text); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); + var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, undefined); addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(11 /* IdentifierName */); + return TypeScript.Syntax.emptyToken(9 /* IdentifierName */); } else { return parseExpression(true); } } function parseElementAccessExpression(expression, openBracketToken, inObjectCreation) { - return new Parser.syntaxFactory.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(75 /* CloseBracketToken */)); + return new TypeScript.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(77 /* CloseBracketToken */)); } function tryParsePrimaryExpression(_currentToken, force) { if (isIdentifier(_currentToken)) { @@ -23887,41 +24559,39 @@ var TypeScript; } var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 13 /* NumericLiteral */: - case 12 /* RegularExpressionLiteral */: - case 14 /* StringLiteral */: + case 37 /* ThisKeyword */: + case 39 /* TrueKeyword */: + case 26 /* FalseKeyword */: + case 34 /* NullKeyword */: + case 11 /* NumericLiteral */: + case 10 /* RegularExpressionLiteral */: + case 12 /* StringLiteral */: return consumeToken(_currentToken); - case 27 /* FunctionKeyword */: - return parseFunctionExpression(_currentToken); - case 74 /* OpenBracketToken */: - return parseArrayLiteralExpression(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectLiteralExpression(_currentToken); - case 72 /* OpenParenToken */: - return parseParenthesizedExpression(_currentToken); - case 31 /* NewKeyword */: - return parseObjectCreationExpression(_currentToken); - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: + case 29 /* FunctionKeyword */: return parseFunctionExpression(_currentToken); + case 76 /* OpenBracketToken */: return parseArrayLiteralExpression(_currentToken); + case 72 /* OpenBraceToken */: return parseObjectLiteralExpression(_currentToken); + case 74 /* OpenParenToken */: return parseParenthesizedExpression(_currentToken); + case 33 /* NewKeyword */: return parseObjectCreationExpression(_currentToken); + case 13 /* NoSubstitutionTemplateToken */: + case 14 /* TemplateStartToken */: + return parseTemplateExpression(_currentToken); + case 120 /* SlashToken */: + case 121 /* SlashEqualsToken */: var result = tryReparseDivideAsRegularExpression(); return result || eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); } if (!force) { - return null; + return undefined; } return eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); } function tryReparseDivideAsRegularExpression() { var currentToken = currentContextualToken(); var tokenKind = currentToken.kind(); - if (tokenKind === 118 /* SlashToken */ || tokenKind === 119 /* SlashEqualsToken */) { - return null; + if (tokenKind === 120 /* SlashToken */ || tokenKind === 121 /* SlashEqualsToken */) { + return undefined; } - else if (tokenKind === 12 /* RegularExpressionLiteral */) { + else if (tokenKind === 10 /* RegularExpressionLiteral */) { return consumeToken(currentToken); } else { @@ -23929,40 +24599,66 @@ var TypeScript; } } function parseTypeOfExpression(typeOfKeyword) { - return new Parser.syntaxFactory.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseDeleteExpression(deleteKeyword) { - return new Parser.syntaxFactory.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseVoidExpression(voidKeyword) { - return new Parser.syntaxFactory.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseFunctionExpression(functionKeyword) { - return new Parser.syntaxFactory.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); + return new TypeScript.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); } function parseObjectCreationExpression(newKeyword) { - return new Parser.syntaxFactory.ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), true, true), tryParseArgumentList()); + return new TypeScript.ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), true, true), tryParseArgumentList()); + } + function parseTemplateExpression(startToken) { + consumeToken(startToken); + if (startToken.kind() === 13 /* NoSubstitutionTemplateToken */) { + return startToken; + } + var templateClauses = getArray(); + do { + templateClauses.push(parseTemplateClause()); + } while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind() === 15 /* TemplateMiddleToken */); + return new TypeScript.TemplateExpressionSyntax(parseNodeData, startToken, TypeScript.Syntax.list(templateClauses)); + } + function parseTemplateClause() { + var expression = parseExpression(true); + var token = currentToken(); + if (token.kind() === 73 /* CloseBraceToken */) { + token = currentContextualToken(); + TypeScript.Debug.assert(token.kind() === 15 /* TemplateMiddleToken */ || token.kind() === 16 /* TemplateEndToken */); + consumeToken(token); + } + else { + var diagnostic = getExpectedTokenDiagnostic(73 /* CloseBraceToken */); + addDiagnostic(diagnostic); + token = TypeScript.Syntax.emptyToken(16 /* TemplateEndToken */); + } + return new TypeScript.TemplateClauseSyntax(parseNodeData, expression, token); } function parseCastExpression(lessThanToken) { - return new Parser.syntaxFactory.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(81 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(83 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseParenthesizedExpression(openParenToken) { - return new Parser.syntaxFactory.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(73 /* CloseParenToken */)); + return new TypeScript.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(75 /* CloseParenToken */)); } function tryParseParenthesizedArrowFunctionExpression() { var tokenKind = currentToken().kind(); - if (tokenKind !== 72 /* OpenParenToken */ && tokenKind !== 80 /* LessThanToken */) { - return null; + if (tokenKind !== 74 /* OpenParenToken */ && tokenKind !== 82 /* LessThanToken */) { + return undefined; } if (isDefinitelyArrowFunctionExpression()) { return tryParseParenthesizedArrowFunctionExpressionWorker(false); } if (!isPossiblyArrowFunctionExpression()) { - return null; + return undefined; } var rewindPoint = getRewindPoint(); var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(true); - if (arrowFunction === null) { + if (arrowFunction === undefined) { rewind(rewindPoint); } releaseRewindPoint(rewindPoint); @@ -23971,16 +24667,16 @@ var TypeScript; function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow) { var _currentToken = currentToken(); var callSignature = parseCallSignature(true); - if (requireArrow && currentToken().kind() !== 85 /* EqualsGreaterThanToken */) { - return null; + if (requireArrow && currentToken().kind() !== 87 /* EqualsGreaterThanToken */) { + return undefined; } - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); + var equalsGreaterThanToken = eatToken(87 /* EqualsGreaterThanToken */); var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { + var expression = undefined; + if (block === undefined) { expression = tryParseAssignmentExpressionOrHigher(true, true); } - return new Parser.syntaxFactory.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); + return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); } function tryParseArrowFunctionBlock() { if (isBlock()) { @@ -23992,43 +24688,43 @@ var TypeScript; return parseBlock(true, false); } else { - return null; + return undefined; } } } function isSimpleArrowFunctionExpression(_currentToken) { - if (_currentToken.kind() === 85 /* EqualsGreaterThanToken */) { + if (_currentToken.kind() === 87 /* EqualsGreaterThanToken */) { return true; } - return isIdentifier(_currentToken) && peekToken(1).kind() === 85 /* EqualsGreaterThanToken */; + return isIdentifier(_currentToken) && peekToken(1).kind() === 87 /* EqualsGreaterThanToken */; } function parseSimpleArrowFunctionExpression() { var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); + var equalsGreaterThanToken = eatToken(87 /* EqualsGreaterThanToken */); var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { + var expression = undefined; + if (block === undefined) { expression = tryParseAssignmentExpressionOrHigher(true, true); } - return new Parser.syntaxFactory.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); + return new TypeScript.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); } function isBlock() { - return currentToken().kind() === 70 /* OpenBraceToken */; + return currentToken().kind() === 72 /* OpenBraceToken */; } function isDefinitelyArrowFunctionExpression() { var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { + if (token0.kind() !== 74 /* OpenParenToken */) { return false; } var token1 = peekToken(1); var token1Kind = token1.kind(); var token2; - if (token1Kind === 73 /* CloseParenToken */) { + if (token1Kind === 75 /* CloseParenToken */) { token2 = peekToken(2); var token2Kind = token2.kind(); - return token2Kind === 106 /* ColonToken */ || token2Kind === 85 /* EqualsGreaterThanToken */ || token2Kind === 70 /* OpenBraceToken */; + return token2Kind === 108 /* ColonToken */ || token2Kind === 87 /* EqualsGreaterThanToken */ || token2Kind === 72 /* OpenBraceToken */; } - if (token1Kind === 77 /* DotDotDotToken */) { + if (token1Kind === 79 /* DotDotDotToken */) { return true; } token2 = peekToken(2); @@ -24041,18 +24737,18 @@ var TypeScript; if (!isIdentifier(token1)) { return false; } - if (token2Kind === 106 /* ColonToken */) { + if (token2Kind === 108 /* ColonToken */) { return true; } var token3 = peekToken(3); var token3Kind = token3.kind(); - if (token2Kind === 105 /* QuestionToken */) { - if (token3Kind === 106 /* ColonToken */ || token3Kind === 73 /* CloseParenToken */ || token3Kind === 79 /* CommaToken */) { + if (token2Kind === 107 /* QuestionToken */) { + if (token3Kind === 108 /* ColonToken */ || token3Kind === 75 /* CloseParenToken */ || token3Kind === 81 /* CommaToken */) { return true; } } - if (token2Kind === 73 /* CloseParenToken */) { - if (token3Kind === 85 /* EqualsGreaterThanToken */) { + if (token2Kind === 75 /* CloseParenToken */) { + if (token3Kind === 87 /* EqualsGreaterThanToken */) { return true; } } @@ -24060,7 +24756,7 @@ var TypeScript; } function isPossiblyArrowFunctionExpression() { var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { + if (token0.kind() !== 74 /* OpenParenToken */) { return true; } var token1 = peekToken(1); @@ -24069,15 +24765,15 @@ var TypeScript; } var token2 = peekToken(2); var token2Kind = token2.kind(); - if (token2Kind === 107 /* EqualsToken */) { + if (token2Kind === 109 /* EqualsToken */) { return true; } - if (token2Kind === 79 /* CommaToken */) { + if (token2Kind === 81 /* CommaToken */) { return true; } - if (token2Kind === 73 /* CloseParenToken */) { + if (token2Kind === 75 /* CloseParenToken */) { var token3 = peekToken(3); - if (token3.kind() === 106 /* ColonToken */) { + if (token3.kind() === 108 /* ColonToken */) { return true; } } @@ -24088,7 +24784,7 @@ var TypeScript; var skippedTokens = getArray(); var propertyAssignments = parseSeparatedSyntaxList(15 /* ObjectLiteralExpression_PropertyAssignments */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - return new Parser.syntaxFactory.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(73 /* CloseBraceToken */)); } function tryParsePropertyAssignment(inErrorRecovery) { if (isAccessor(modifierCount(), inErrorRecovery)) { @@ -24101,7 +24797,7 @@ var TypeScript; return parseSimplePropertyAssignment(); } else { - return null; + return undefined; } } function isPropertyAssignment(inErrorRecovery) { @@ -24115,13 +24811,13 @@ var TypeScript; return isPropertyName(currentToken(), inErrorRecovery) && isCallSignature(1); } function parseFunctionPropertyAssignment() { - return new Parser.syntaxFactory.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); + return new TypeScript.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); } function isSimplePropertyAssignment(inErrorRecovery) { return isPropertyName(currentToken(), inErrorRecovery); } function parseSimplePropertyAssignment() { - return new Parser.syntaxFactory.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); + return new TypeScript.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(108 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); } function isPropertyName(token, inErrorRecovery) { if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { @@ -24133,50 +24829,50 @@ var TypeScript; } } var kind = token.kind(); - return kind === 14 /* StringLiteral */ || kind === 13 /* NumericLiteral */; + return kind === 12 /* StringLiteral */ || kind === 11 /* NumericLiteral */ || kind === 13 /* NoSubstitutionTemplateToken */; } function parseArrayLiteralExpression(openBracketToken) { consumeToken(openBracketToken); var skippedTokens = getArray(); var expressions = parseSeparatedSyntaxList(16 /* ArrayLiteralExpression_AssignmentExpressions */, skippedTokens); openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(75 /* CloseBracketToken */)); + return new TypeScript.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(77 /* CloseBracketToken */)); } function parseBlock(parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var statements = TypeScript.Syntax.emptyList(); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var statements; if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { var savedIsInStrictMode = isInStrictMode; - var processItems = checkForStrictMode ? updateStrictModeState : null; + var processItems = checkForStrictMode ? updateStrictModeState : undefined; var skippedTokens = getArray(); var statements = parseSyntaxList(5 /* Block_Statements */, skippedTokens, processItems); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); setStrictMode(savedIsInStrictMode); } - return new Parser.syntaxFactory.BlockSyntax(parseNodeData, openBraceToken, statements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.BlockSyntax(parseNodeData, openBraceToken, statements || [], eatToken(73 /* CloseBraceToken */)); } function parseCallSignature(requireCompleteTypeParameterList) { - return new Parser.syntaxFactory.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); + return new TypeScript.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); } function tryParseTypeParameterList(requireCompleteTypeParameterList) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; + if (_currentToken.kind() !== 82 /* LessThanToken */) { + return undefined; } var rewindPoint = getRewindPoint(); var lessThanToken = consumeToken(_currentToken); var skippedTokens = getArray(); var typeParameters = parseSeparatedSyntaxList(20 /* TypeParameterList_TypeParameters */, skippedTokens); lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(81 /* GreaterThanToken */); + var greaterThanToken = eatToken(83 /* GreaterThanToken */); if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); + return new TypeScript.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); } } function isTypeParameter() { @@ -24184,63 +24880,63 @@ var TypeScript; } function tryParseTypeParameter() { if (!isIdentifier(currentToken())) { - return null; + return undefined; } - return new Parser.syntaxFactory.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); + return new TypeScript.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); } function tryParseConstraint() { - if (currentToken().kind() !== 48 /* ExtendsKeyword */) { - return null; + if (currentToken().kind() !== 50 /* ExtendsKeyword */) { + return undefined; } - return new Parser.syntaxFactory.ConstraintSyntax(parseNodeData, eatToken(48 /* ExtendsKeyword */), parseTypeOrExpression()); + return new TypeScript.ConstraintSyntax(parseNodeData, eatToken(50 /* ExtendsKeyword */), parseTypeOrExpression()); } function tryParseParameterList() { - if (currentToken().kind() === 72 /* OpenParenToken */) { + if (currentToken().kind() === 74 /* OpenParenToken */) { var token1 = peekToken(1); - if (token1.kind() === 73 /* CloseParenToken */ || isParameterHelper(token1)) { + if (token1.kind() === 75 /* CloseParenToken */ || isParameterHelper(token1)) { return parseParameterList(); } } - return null; + return undefined; } function parseParameterList() { - var openParenToken = eatToken(72 /* OpenParenToken */); - var parameters = TypeScript.Syntax.emptySeparatedList(); + var openParenToken = eatToken(74 /* OpenParenToken */); + var parameters; if (openParenToken.fullWidth() > 0) { var skippedTokens = getArray(); parameters = parseSeparatedSyntaxList(17 /* ParameterList_Parameters */, skippedTokens); openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); } - return new Parser.syntaxFactory.ParameterListSyntax(parseNodeData, openParenToken, parameters, eatToken(73 /* CloseParenToken */)); + return new TypeScript.ParameterListSyntax(parseNodeData, openParenToken, parameters || [], eatToken(75 /* CloseParenToken */)); } function parseOptionalTypeAnnotation(allowStringLiteral) { - return currentToken().kind() === 106 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : null; + return currentToken().kind() === 108 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : undefined; } function parseTypeAnnotationType(allowStringLiteral) { if (allowStringLiteral) { var _currentToken = currentToken(); - if (_currentToken.kind() === 14 /* StringLiteral */) { + if (_currentToken.kind() === 12 /* StringLiteral */) { return consumeToken(_currentToken); } } return parseType(); } function parseTypeAnnotation(allowStringLiteral) { - return new Parser.syntaxFactory.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); + return new TypeScript.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); } function isType() { var _currentToken = currentToken(); switch (_currentToken.kind()) { - case 39 /* TypeOfKeyword */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 70 /* OpenBraceToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 31 /* NewKeyword */: + case 41 /* TypeOfKeyword */: + case 62 /* AnyKeyword */: + case 69 /* NumberKeyword */: + case 63 /* BooleanKeyword */: + case 71 /* StringKeyword */: + case 43 /* VoidKeyword */: + case 72 /* OpenBraceToken */: + case 74 /* OpenParenToken */: + case 82 /* LessThanToken */: + case 33 /* NewKeyword */: return true; default: return isIdentifier(_currentToken); @@ -24261,115 +24957,149 @@ var TypeScript; return tryParseType() || eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); } function tryParseType() { + if (isFunctionType()) { + return parseFunctionType(); + } + if (currentToken().kind() === 33 /* NewKeyword */) { + return parseConstructorType(); + } + return tryParseUnionTypeOrHigher(); + } + function tryParseUnionTypeOrHigher() { + var type = tryParsePrimaryType(); + if (type) { + var barToken; + while ((barToken = currentToken()).kind() === 101 /* BarToken */) { + consumeToken(barToken); + var right = parsePrimaryType(); + type = new TypeScript.UnionTypeSyntax(parseNodeData, type, barToken, right); + } + } + return type; + } + function parsePrimaryType() { + return tryParsePrimaryType() || eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); + } + function tryParsePrimaryType() { var type = tryParseNonArrayType(); while (type) { var _currentToken = currentToken(); - if (previousTokenHasTrailingNewLine(_currentToken) || _currentToken.kind() !== 74 /* OpenBracketToken */) { + if (previousTokenHasTrailingNewLine(_currentToken) || _currentToken.kind() !== 76 /* OpenBracketToken */) { break; } - type = new Parser.syntaxFactory.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(75 /* CloseBracketToken */)); + type = new TypeScript.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(77 /* CloseBracketToken */)); } return type; } function parseTypeQuery(typeOfKeyword) { - return new Parser.syntaxFactory.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); + return new TypeScript.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); } function tryParseNonArrayType() { var _currentToken = currentToken(); switch (_currentToken.kind()) { - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - if (peekToken(1).kind() === 76 /* DotToken */) { + case 62 /* AnyKeyword */: + case 69 /* NumberKeyword */: + case 63 /* BooleanKeyword */: + case 71 /* StringKeyword */: + if (peekToken(1).kind() === 78 /* DotToken */) { break; } return consumeToken(_currentToken); - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - return tryParseFunctionType(); - case 41 /* VoidKeyword */: - return consumeToken(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectType(); - case 31 /* NewKeyword */: - return parseConstructorType(); - case 39 /* TypeOfKeyword */: - return parseTypeQuery(_currentToken); - case 74 /* OpenBracketToken */: - return parseTupleType(_currentToken); + case 43 /* VoidKeyword */: return consumeToken(_currentToken); + case 74 /* OpenParenToken */: return parseParenthesizedType(_currentToken); + case 72 /* OpenBraceToken */: return parseObjectType(); + case 41 /* TypeOfKeyword */: return parseTypeQuery(_currentToken); + case 76 /* OpenBracketToken */: return parseTupleType(_currentToken); } return tryParseNameOrGenericType(); } + function parseParenthesizedType(openParenToken) { + return new TypeScript.ParenthesizedTypeSyntax(parseNodeData, consumeToken(openParenToken), parseType(), eatToken(75 /* CloseParenToken */)); + } function tryParseNameOrGenericType() { var name = tryParseName(false); - if (name === null) { - return null; + if (name === undefined) { + return undefined; } if (previousTokenHasTrailingNewLine(currentToken())) { return name; } var typeArgumentList = tryParseTypeArgumentList(false); - return typeArgumentList === null ? name : new Parser.syntaxFactory.GenericTypeSyntax(parseNodeData, name, typeArgumentList); + return !typeArgumentList ? name : new TypeScript.GenericTypeSyntax(parseNodeData, name, typeArgumentList); } - function tryParseFunctionType() { - var typeParameterList = tryParseTypeParameterList(false); - var parameterList = null; - if (typeParameterList === null) { - parameterList = tryParseParameterList(); - if (parameterList === null) { - return null; + function isFunctionType() { + var token0 = currentToken(); + var token0Kind = token0.kind(); + if (token0Kind === 82 /* LessThanToken */) { + return true; + } + if (token0Kind === 74 /* OpenParenToken */) { + var token1 = peekToken(1); + var token1Kind = token1.kind(); + if (token1Kind === 75 /* CloseParenToken */ || token1Kind === 79 /* DotDotDotToken */) { + return true; + } + if (isModifierKind(token1Kind) || isIdentifier(token1)) { + var token2 = peekToken(2); + var token2Kind = token2.kind(); + if (token2Kind === 108 /* ColonToken */ || token2Kind === 81 /* CommaToken */ || token2Kind === 107 /* QuestionToken */ || token2Kind === 109 /* EqualsToken */ || isIdentifier(token2) || isModifierKind(token2Kind)) { + return true; + } + if (token2Kind === 75 /* CloseParenToken */) { + return peekToken(3).kind() === 87 /* EqualsGreaterThanToken */; + } } } - else { - parameterList = parseParameterList(); - } - return new Parser.syntaxFactory.FunctionTypeSyntax(parseNodeData, typeParameterList, parameterList, eatToken(85 /* EqualsGreaterThanToken */), parseType()); + return false; + } + function parseFunctionType() { + var typeParameterList = tryParseTypeParameterList(false); + var parameterList = parseParameterList(); + return new TypeScript.FunctionTypeSyntax(parseNodeData, typeParameterList, parameterList, eatToken(87 /* EqualsGreaterThanToken */), parseType()); } function parseConstructorType() { - return new Parser.syntaxFactory.ConstructorTypeSyntax(parseNodeData, eatToken(31 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(85 /* EqualsGreaterThanToken */), parseType()); + return new TypeScript.ConstructorTypeSyntax(parseNodeData, eatToken(33 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(87 /* EqualsGreaterThanToken */), parseType()); } function isParameter() { - if (currentNode() !== null && currentNode().kind() === 243 /* Parameter */) { + if (currentNode() && currentNode().kind() === 208 /* Parameter */) { return true; } return isParameterHelper(currentToken()); } function isParameterHelper(token) { var tokenKind = token.kind(); - return tokenKind === 77 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); + return tokenKind === 79 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); } function eatSimpleParameter() { - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, null, TypeScript.Syntax.emptyList(), eatIdentifierToken(), null, null, null); + return new TypeScript.ParameterSyntax(parseNodeData, undefined, [], eatIdentifierToken(), undefined, undefined, undefined); } function tryParseParameter() { var node = currentNode(); - if (node !== null && node.kind() === 243 /* Parameter */) { + if (node && node.kind() === 208 /* Parameter */) { consumeNode(node); return node; } - var dotDotDotToken = tryEatToken(77 /* DotDotDotToken */); + var dotDotDotToken = tryEatToken(79 /* DotDotDotToken */); var modifiers = parseModifiers(); var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && dotDotDotToken === null && modifiers.length === 0) { + if (!isIdentifier(_currentToken) && !dotDotDotToken && modifiers.length === 0) { if (isModifierKind(_currentToken.kind())) { modifiers = TypeScript.Syntax.list([consumeToken(_currentToken)]); } else { - return null; + return undefined; } } var identifier = eatIdentifierToken(); - var questionToken = tryEatToken(105 /* QuestionToken */); + var questionToken = tryEatToken(107 /* QuestionToken */); var typeAnnotation = parseOptionalTypeAnnotation(true); - var equalsValueClause = null; + var equalsValueClause = undefined; if (isEqualsValueClause(true)) { equalsValueClause = parseEqualsValueClause(true); } - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); + return new TypeScript.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); } function parseSyntaxList(currentListType, skippedTokens, processItems) { - if (processItems === void 0) { processItems = null; } var savedListParsingState = listParsingState; listParsingState |= (1 << currentListType); var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); @@ -24383,7 +25113,7 @@ var TypeScript; listParsingState = savedListParsingState; return result; } - function abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens) { + function abortParsingListOrMoveToNextToken(currentListType, nodeAndSeparators, skippedTokens) { reportUnexpectedTokenDiagnostic(currentListType); for (var state = ListParsingState.LastListParsingState; state >= ListParsingState.FirstListParsingState; state--) { if ((listParsingState & (1 << state)) !== 0) { @@ -24392,70 +25122,63 @@ var TypeScript; } } } - addSkippedTokenToList(nodes, separators, skippedTokens, consumeToken(currentToken())); + addSkippedTokenToList(nodeAndSeparators, skippedTokens, consumeToken(currentToken())); return false; } - function addSkippedTokenToList(nodes, separators, skippedTokens, skippedToken) { - if (Parser.syntaxFactory.isConcrete) { - var length = nodes.length + (separators ? separators.length : 0); - for (var i = length - 1; i >= 0; i--) { - var array = separators && (i % 2 === 1) ? separators : nodes; - var arrayIndex = separators ? TypeScript.IntegerUtilities.integerDivide(i, 2) : i; - var item = array[arrayIndex]; - var _lastToken = TypeScript.lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - array[arrayIndex] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } + function addSkippedTokenToList(nodesAndSeparators, skippedTokens, skippedToken) { + var length = nodesAndSeparators.length; + for (var i = length - 1; i >= 0; i--) { + var item = nodesAndSeparators[i]; + var _lastToken = TypeScript.lastToken(item); + if (_lastToken && _lastToken.fullWidth() > 0) { + nodesAndSeparators[i] = addSkippedTokenAfterNodeOrToken(item, skippedToken); + return; } - skippedTokens.push(skippedToken); } + skippedTokens.push(skippedToken); } function tryParseExpectedListItem(currentListType, inErrorRecovery, items, processItems) { var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - if (item === null) { + if (item === undefined) { return false; } items.push(item); - if (processItems !== null) { + if (processItems) { processItems(items); } return true; } function listIsTerminated(currentListType) { - return isExpectedListTerminator(currentListType) || currentToken().kind() === 10 /* EndOfFileToken */; + return isExpectedListTerminator(currentListType) || currentToken().kind() === 8 /* EndOfFileToken */; } function parseSyntaxListWorker(currentListType, skippedTokens, processItems) { - var items = getArray(); + var items = []; while (true) { var succeeded = tryParseExpectedListItem(currentListType, false, items, processItems); if (!succeeded) { if (listIsTerminated(currentListType)) { break; } - var abort = abortParsingListOrMoveToNextToken(currentListType, items, null, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); if (abort) { break; } } } - var result = TypeScript.Syntax.list(items); - returnZeroLengthArray(items); - return result; + return TypeScript.Syntax.list(items); } function parseSeparatedSyntaxListWorker(currentListType, skippedTokens) { - var nodes = getArray(); - var separators = getArray(); - var _separatorKind = currentListType === 9 /* ObjectType_TypeMembers */ ? 78 /* SemicolonToken */ : 79 /* CommaToken */; - var allowAutomaticSemicolonInsertion = _separatorKind === 78 /* SemicolonToken */; + var nodesAndSeparators = []; + var _separatorKind = currentListType === 9 /* ObjectType_TypeMembers */ ? 80 /* SemicolonToken */ : 81 /* CommaToken */; + var allowAutomaticSemicolonInsertion = _separatorKind === 80 /* SemicolonToken */; var inErrorRecovery = false; while (true) { - var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodes, null); + var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodesAndSeparators, undefined); if (!succeeded) { if (listIsTerminated(currentListType)) { break; } - var abort = abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType, nodesAndSeparators, skippedTokens); if (abort) { break; } @@ -24467,25 +25190,22 @@ var TypeScript; inErrorRecovery = false; var _currentToken = currentToken(); var tokenKind = _currentToken.kind(); - if (tokenKind === _separatorKind || tokenKind === 79 /* CommaToken */) { - separators.push(consumeToken(_currentToken)); + if (tokenKind === _separatorKind || tokenKind === 81 /* CommaToken */) { + nodesAndSeparators.push(consumeToken(_currentToken)); continue; } if (listIsTerminated(currentListType)) { break; } if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(false) || TypeScript.Syntax.emptyToken(78 /* SemicolonToken */); - separators.push(semicolonToken); + var semicolonToken = eatExplicitOrAutomaticSemicolon(false) || TypeScript.Syntax.emptyToken(80 /* SemicolonToken */); + nodesAndSeparators.push(semicolonToken); continue; } - separators.push(eatToken(_separatorKind)); + nodesAndSeparators.push(eatToken(_separatorKind)); inErrorRecovery = true; } - var result = TypeScript.Syntax.separatedList(nodes, separators); - returnZeroLengthArray(nodes); - returnZeroLengthArray(separators); - return result; + return TypeScript.Syntax.separatedList(nodesAndSeparators); } function reportUnexpectedTokenDiagnostic(listType) { var token = currentToken(); @@ -24500,76 +25220,54 @@ var TypeScript; } function isExpectedListTerminator(currentListType) { switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return isExpectedSourceUnit_ModuleElementsTerminator(); - case 1 /* ClassDeclaration_ClassElements */: - return isExpectedClassDeclaration_ClassElementsTerminator(); - case 2 /* ModuleDeclaration_ModuleElements */: - return isExpectedModuleDeclaration_ModuleElementsTerminator(); - case 3 /* SwitchStatement_SwitchClauses */: - return isExpectedSwitchStatement_SwitchClausesTerminator(); - case 4 /* SwitchClause_Statements */: - return isExpectedSwitchClause_StatementsTerminator(); - case 5 /* Block_Statements */: - return isExpectedBlock_StatementsTerminator(); - case 6 /* TryBlock_Statements */: - return isExpectedTryBlock_StatementsTerminator(); - case 7 /* CatchBlock_Statements */: - return isExpectedCatchBlock_StatementsTerminator(); - case 8 /* EnumDeclaration_EnumElements */: - return isExpectedEnumDeclaration_EnumElementsTerminator(); - case 9 /* ObjectType_TypeMembers */: - return isExpectedObjectType_TypeMembersTerminator(); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); - case 11 /* HeritageClause_TypeNameList */: - return isExpectedHeritageClause_TypeNameListTerminator(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); - case 14 /* ArgumentList_AssignmentExpressions */: - return isExpectedArgumentList_AssignmentExpressionsTerminator(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); - case 17 /* ParameterList_Parameters */: - return isExpectedParameterList_ParametersTerminator(); - case 18 /* IndexSignature_Parameters */: - return isExpectedIndexSignature_ParametersTerminator(); - case 19 /* TypeArgumentList_Types */: - return isExpectedTypeArgumentList_TypesTerminator(); - case 20 /* TypeParameterList_TypeParameters */: - return isExpectedTypeParameterList_TypeParametersTerminator(); - case 21 /* TupleType_Types */: - return isExpectedTupleType_TypesTerminator(); + case 0 /* SourceUnit_ModuleElements */: return isExpectedSourceUnit_ModuleElementsTerminator(); + case 1 /* ClassDeclaration_ClassElements */: return isExpectedClassDeclaration_ClassElementsTerminator(); + case 2 /* ModuleDeclaration_ModuleElements */: return isExpectedModuleDeclaration_ModuleElementsTerminator(); + case 3 /* SwitchStatement_SwitchClauses */: return isExpectedSwitchStatement_SwitchClausesTerminator(); + case 4 /* SwitchClause_Statements */: return isExpectedSwitchClause_StatementsTerminator(); + case 5 /* Block_Statements */: return isExpectedBlock_StatementsTerminator(); + case 6 /* TryBlock_Statements */: return isExpectedTryBlock_StatementsTerminator(); + case 7 /* CatchBlock_Statements */: return isExpectedCatchBlock_StatementsTerminator(); + case 8 /* EnumDeclaration_EnumElements */: return isExpectedEnumDeclaration_EnumElementsTerminator(); + case 9 /* ObjectType_TypeMembers */: return isExpectedObjectType_TypeMembersTerminator(); + case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); + case 11 /* HeritageClause_TypeNameList */: return isExpectedHeritageClause_TypeNameListTerminator(); + case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); + case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); + case 14 /* ArgumentList_AssignmentExpressions */: return isExpectedArgumentList_AssignmentExpressionsTerminator(); + case 15 /* ObjectLiteralExpression_PropertyAssignments */: return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); + case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); + case 17 /* ParameterList_Parameters */: return isExpectedParameterList_ParametersTerminator(); + case 18 /* IndexSignature_Parameters */: return isExpectedIndexSignature_ParametersTerminator(); + case 19 /* TypeArgumentList_Types */: return isExpectedTypeArgumentList_TypesTerminator(); + case 20 /* TypeParameterList_TypeParameters */: return isExpectedTypeParameterList_TypeParametersTerminator(); + case 21 /* TupleType_Types */: return isExpectedTupleType_TypesTerminator(); default: throw TypeScript.Errors.invalidOperation(); } } function isExpectedSourceUnit_ModuleElementsTerminator() { - return currentToken().kind() === 10 /* EndOfFileToken */; + return currentToken().kind() === 8 /* EndOfFileToken */; } function isExpectedEnumDeclaration_EnumElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedModuleDeclaration_ModuleElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedObjectType_TypeMembersTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedLiteralExpression_AssignmentExpressionsTerminator() { - return currentToken().kind() === 75 /* CloseBracketToken */; + return currentToken().kind() === 77 /* CloseBracketToken */; } function isExpectedTypeArgumentList_TypesTerminator() { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 81 /* GreaterThanToken */) { + if (tokenKind === 83 /* GreaterThanToken */) { return true; } if (canFollowTypeArgumentListInExpression(tokenKind)) { @@ -24580,70 +25278,70 @@ var TypeScript; function isExpectedTupleType_TypesTerminator() { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 75 /* CloseBracketToken */) { + if (tokenKind === 77 /* CloseBracketToken */) { return true; } return false; } function isExpectedTypeParameterList_TypeParametersTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 81 /* GreaterThanToken */) { + if (tokenKind === 83 /* GreaterThanToken */) { return true; } - if (tokenKind === 72 /* OpenParenToken */ || tokenKind === 70 /* OpenBraceToken */ || tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { + if (tokenKind === 74 /* OpenParenToken */ || tokenKind === 72 /* OpenBraceToken */ || tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */) { return true; } return false; } function isExpectedParameterList_ParametersTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 73 /* CloseParenToken */) { + if (tokenKind === 75 /* CloseParenToken */) { return true; } - if (tokenKind === 70 /* OpenBraceToken */) { + if (tokenKind === 72 /* OpenBraceToken */) { return true; } - if (tokenKind === 85 /* EqualsGreaterThanToken */) { + if (tokenKind === 87 /* EqualsGreaterThanToken */) { return true; } return false; } function isExpectedIndexSignature_ParametersTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 75 /* CloseBracketToken */) { + if (tokenKind === 77 /* CloseBracketToken */) { return true; } - if (tokenKind === 70 /* OpenBraceToken */) { + if (tokenKind === 72 /* OpenBraceToken */) { return true; } return false; } function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 78 /* SemicolonToken */ || tokenKind === 73 /* CloseParenToken */) { + if (tokenKind === 80 /* SemicolonToken */ || tokenKind === 75 /* CloseParenToken */) { return true; } - if (tokenKind === 29 /* InKeyword */) { + if (tokenKind === 31 /* InKeyword */) { return true; } return false; } function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator() { - if (currentToken().kind() === 85 /* EqualsGreaterThanToken */) { + if (currentToken().kind() === 87 /* EqualsGreaterThanToken */) { return true; } return canEatExplicitOrAutomaticSemicolon(false); } function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 70 /* OpenBraceToken */ || tokenKind === 71 /* CloseBraceToken */) { + if (tokenKind === 72 /* OpenBraceToken */ || tokenKind === 73 /* CloseBraceToken */) { return true; } return false; } function isExpectedHeritageClause_TypeNameListTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { + if (tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */) { return true; } if (isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { @@ -24654,75 +25352,52 @@ var TypeScript; function isExpectedArgumentList_AssignmentExpressionsTerminator() { var token0 = currentToken(); var tokenKind = token0.kind(); - return tokenKind === 73 /* CloseParenToken */ || tokenKind === 78 /* SemicolonToken */; + return tokenKind === 75 /* CloseParenToken */ || tokenKind === 80 /* SemicolonToken */; } function isExpectedClassDeclaration_ClassElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedSwitchStatement_SwitchClausesTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedSwitchClause_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */ || isSwitchClause(); + return currentToken().kind() === 73 /* CloseBraceToken */ || isSwitchClause(); } function isExpectedBlock_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedTryBlock_StatementsTerminator() { var tokenKind = currentToken().kind(); - return tokenKind === 17 /* CatchKeyword */ || tokenKind === 25 /* FinallyKeyword */; + return tokenKind === 19 /* CatchKeyword */ || tokenKind === 27 /* FinallyKeyword */; } function isExpectedCatchBlock_StatementsTerminator() { - return currentToken().kind() === 25 /* FinallyKeyword */; + return currentToken().kind() === 27 /* FinallyKeyword */; } function isExpectedListItem(currentListType, inErrorRecovery) { switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return isModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: - return isClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: - return isModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: - return isSwitchClause(); - case 4 /* SwitchClause_Statements */: - return isStatement(modifierCount(), inErrorRecovery); - case 5 /* Block_Statements */: - return isStatement(modifierCount(), inErrorRecovery); - case 6 /* TryBlock_Statements */: - return false; - case 7 /* CatchBlock_Statements */: - return false; - case 8 /* EnumDeclaration_EnumElements */: - return isEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: - return isTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return isHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: - return isHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return isVariableDeclarator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return isVariableDeclarator(); - case 14 /* ArgumentList_AssignmentExpressions */: - return isExpectedArgumentList_AssignmentExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return isPropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return isAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: - return isParameter(); - case 18 /* IndexSignature_Parameters */: - return isParameter(); - case 19 /* TypeArgumentList_Types */: - return isType(); - case 20 /* TypeParameterList_TypeParameters */: - return isTypeParameter(); - case 21 /* TupleType_Types */: - return isType(); - default: - throw TypeScript.Errors.invalidOperation(); + case 0 /* SourceUnit_ModuleElements */: return isModuleElement(inErrorRecovery); + case 1 /* ClassDeclaration_ClassElements */: return isClassElement(inErrorRecovery); + case 2 /* ModuleDeclaration_ModuleElements */: return isModuleElement(inErrorRecovery); + case 3 /* SwitchStatement_SwitchClauses */: return isSwitchClause(); + case 4 /* SwitchClause_Statements */: return isStatement(modifierCount(), inErrorRecovery); + case 5 /* Block_Statements */: return isStatement(modifierCount(), inErrorRecovery); + case 6 /* TryBlock_Statements */: return false; + case 7 /* CatchBlock_Statements */: return false; + case 8 /* EnumDeclaration_EnumElements */: return isEnumElement(inErrorRecovery); + case 9 /* ObjectType_TypeMembers */: return isTypeMember(inErrorRecovery); + case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return isHeritageClause(); + case 11 /* HeritageClause_TypeNameList */: return isHeritageClauseTypeName(); + case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return isVariableDeclarator(); + case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return isVariableDeclarator(); + case 14 /* ArgumentList_AssignmentExpressions */: return isExpectedArgumentList_AssignmentExpression(); + case 15 /* ObjectLiteralExpression_PropertyAssignments */: return isPropertyAssignment(inErrorRecovery); + case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return isAssignmentOrOmittedExpression(); + case 17 /* ParameterList_Parameters */: return isParameter(); + case 18 /* IndexSignature_Parameters */: return isParameter(); + case 19 /* TypeArgumentList_Types */: return isType(); + case 20 /* TypeParameterList_TypeParameters */: return isTypeParameter(); + case 21 /* TupleType_Types */: return isType(); + default: throw TypeScript.Errors.invalidOperation(); } } function isExpectedArgumentList_AssignmentExpression() { @@ -24730,105 +25405,61 @@ var TypeScript; if (isExpression(_currentToken)) { return true; } - if (_currentToken.kind() === 79 /* CommaToken */) { + if (_currentToken.kind() === 81 /* CommaToken */) { return true; } return false; } function tryParseExpectedListItemWorker(currentListType, inErrorRecovery) { switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return tryParseModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: - return tryParseClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: - return tryParseModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: - return tryParseSwitchClause(); - case 4 /* SwitchClause_Statements */: - return tryParseStatement(inErrorRecovery); - case 5 /* Block_Statements */: - return tryParseStatement(inErrorRecovery); - case 6 /* TryBlock_Statements */: - return tryParseStatement(inErrorRecovery); - case 7 /* CatchBlock_Statements */: - return tryParseStatement(inErrorRecovery); - case 8 /* EnumDeclaration_EnumElements */: - return tryParseEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: - return tryParseTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return tryParseHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: - return tryParseHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return tryParseVariableDeclarator(true, false); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return tryParseVariableDeclarator(false, false); - case 14 /* ArgumentList_AssignmentExpressions */: - return tryParseArgumentListExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return tryParsePropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return tryParseAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: - return tryParseParameter(); - case 18 /* IndexSignature_Parameters */: - return tryParseParameter(); - case 19 /* TypeArgumentList_Types */: - return tryParseType(); - case 20 /* TypeParameterList_TypeParameters */: - return tryParseTypeParameter(); - case 21 /* TupleType_Types */: - return tryParseType(); - default: - throw TypeScript.Errors.invalidOperation(); + case 0 /* SourceUnit_ModuleElements */: return tryParseModuleElement(inErrorRecovery); + case 1 /* ClassDeclaration_ClassElements */: return tryParseClassElement(inErrorRecovery); + case 2 /* ModuleDeclaration_ModuleElements */: return tryParseModuleElement(inErrorRecovery); + case 3 /* SwitchStatement_SwitchClauses */: return tryParseSwitchClause(); + case 4 /* SwitchClause_Statements */: return tryParseStatement(inErrorRecovery); + case 5 /* Block_Statements */: return tryParseStatement(inErrorRecovery); + case 6 /* TryBlock_Statements */: return tryParseStatement(inErrorRecovery); + case 7 /* CatchBlock_Statements */: return tryParseStatement(inErrorRecovery); + case 8 /* EnumDeclaration_EnumElements */: return tryParseEnumElement(inErrorRecovery); + case 9 /* ObjectType_TypeMembers */: return tryParseTypeMember(inErrorRecovery); + case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return tryParseHeritageClause(); + case 11 /* HeritageClause_TypeNameList */: return tryParseHeritageClauseTypeName(); + case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return tryParseVariableDeclarator(true, false); + case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return tryParseVariableDeclarator(false, false); + case 14 /* ArgumentList_AssignmentExpressions */: return tryParseArgumentListExpression(); + case 15 /* ObjectLiteralExpression_PropertyAssignments */: return tryParsePropertyAssignment(inErrorRecovery); + case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return tryParseAssignmentOrOmittedExpression(); + case 17 /* ParameterList_Parameters */: return tryParseParameter(); + case 18 /* IndexSignature_Parameters */: return tryParseParameter(); + case 19 /* TypeArgumentList_Types */: return tryParseType(); + case 20 /* TypeParameterList_TypeParameters */: return tryParseTypeParameter(); + case 21 /* TupleType_Types */: return tryParseType(); + default: throw TypeScript.Errors.invalidOperation(); } } function getExpectedListElementType(currentListType) { switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return '{'; - case 1 /* ClassDeclaration_ClassElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, null); - case 2 /* ModuleDeclaration_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 3 /* SwitchStatement_SwitchClauses */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, null); - case 4 /* SwitchClause_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 5 /* Block_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 8 /* EnumDeclaration_EnumElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 9 /* ObjectType_TypeMembers */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, null); - case 14 /* ArgumentList_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - case 11 /* HeritageClause_TypeNameList */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, null); - case 17 /* ParameterList_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 18 /* IndexSignature_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 19 /* TypeArgumentList_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 20 /* TypeParameterList_TypeParameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null); - case 21 /* TupleType_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - default: - throw TypeScript.Errors.invalidOperation(); + case 0 /* SourceUnit_ModuleElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); + case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return '{'; + case 1 /* ClassDeclaration_ClassElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, undefined); + case 2 /* ModuleDeclaration_ModuleElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); + case 3 /* SwitchStatement_SwitchClauses */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, undefined); + case 4 /* SwitchClause_Statements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, undefined); + case 5 /* Block_Statements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, undefined); + case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, undefined); + case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, undefined); + case 8 /* EnumDeclaration_EnumElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, undefined); + case 9 /* ObjectType_TypeMembers */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, undefined); + case 14 /* ArgumentList_AssignmentExpressions */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, undefined); + case 11 /* HeritageClause_TypeNameList */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, undefined); + case 15 /* ObjectLiteralExpression_PropertyAssignments */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, undefined); + case 17 /* ParameterList_Parameters */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, undefined); + case 18 /* IndexSignature_Parameters */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, undefined); + case 19 /* TypeArgumentList_Types */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, undefined); + case 20 /* TypeParameterList_TypeParameters */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, undefined); + case 21 /* TupleType_Types */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, undefined); + case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, undefined); + default: throw TypeScript.Errors.invalidOperation(); } } return parseSyntaxTree; @@ -24887,810 +25518,922 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - var Syntax; - (function (Syntax) { - var Concrete; - (function (Concrete) { - TypeScript.Parser.syntaxFactory = Concrete; - Concrete.isConcrete = true; - var SourceUnitSyntax = (function (_super) { - __extends(SourceUnitSyntax, _super); - function SourceUnitSyntax(data, moduleElements, endOfFileToken) { - _super.call(this, data); - this.syntaxTree = null; - this.parent = null, this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), endOfFileToken.parent = this; - } - return SourceUnitSyntax; - })(TypeScript.SyntaxNode); - Concrete.SourceUnitSyntax = SourceUnitSyntax; - var QualifiedNameSyntax = (function (_super) { - __extends(QualifiedNameSyntax, _super); - function QualifiedNameSyntax(data, left, dotToken, right) { - _super.call(this, data); - this.left = left, this.dotToken = dotToken, this.right = right, left.parent = this, dotToken.parent = this, right.parent = this; - } - return QualifiedNameSyntax; - })(TypeScript.SyntaxNode); - Concrete.QualifiedNameSyntax = QualifiedNameSyntax; - var ObjectTypeSyntax = (function (_super) { - __extends(ObjectTypeSyntax, _super); - function ObjectTypeSyntax(data, openBraceToken, typeMembers, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(typeMembers) && (typeMembers.parent = this), closeBraceToken.parent = this; - } - return ObjectTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectTypeSyntax = ObjectTypeSyntax; - var FunctionTypeSyntax = (function (_super) { - __extends(FunctionTypeSyntax, _super); - function FunctionTypeSyntax(data, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - } - return FunctionTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionTypeSyntax = FunctionTypeSyntax; - var ArrayTypeSyntax = (function (_super) { - __extends(ArrayTypeSyntax, _super); - function ArrayTypeSyntax(data, type, openBracketToken, closeBracketToken) { - _super.call(this, data); - this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken, type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; - } - return ArrayTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayTypeSyntax = ArrayTypeSyntax; - var ConstructorTypeSyntax = (function (_super) { - __extends(ConstructorTypeSyntax, _super); - function ConstructorTypeSyntax(data, newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, data); - this.newKeyword = newKeyword, this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type, newKeyword.parent = this, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - } - return ConstructorTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorTypeSyntax = ConstructorTypeSyntax; - var GenericTypeSyntax = (function (_super) { - __extends(GenericTypeSyntax, _super); - function GenericTypeSyntax(data, name, typeArgumentList) { - _super.call(this, data); - this.name = name, this.typeArgumentList = typeArgumentList, name.parent = this, typeArgumentList.parent = this; - } - return GenericTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.GenericTypeSyntax = GenericTypeSyntax; - var TypeQuerySyntax = (function (_super) { - __extends(TypeQuerySyntax, _super); - function TypeQuerySyntax(data, typeOfKeyword, name) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.name = name, typeOfKeyword.parent = this, name.parent = this; - } - return TypeQuerySyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeQuerySyntax = TypeQuerySyntax; - var TupleTypeSyntax = (function (_super) { - __extends(TupleTypeSyntax, _super); - function TupleTypeSyntax(data, openBracketToken, types, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.types = types, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(types) && (types.parent = this), closeBracketToken.parent = this; - } - return TupleTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.TupleTypeSyntax = TupleTypeSyntax; - var InterfaceDeclarationSyntax = (function (_super) { - __extends(InterfaceDeclarationSyntax, _super); - function InterfaceDeclarationSyntax(data, modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - _super.call(this, data); - this.modifiers = modifiers, this.interfaceKeyword = interfaceKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.body = body, !TypeScript.isShared(modifiers) && (modifiers.parent = this), interfaceKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), body.parent = this; - } - return InterfaceDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.InterfaceDeclarationSyntax = InterfaceDeclarationSyntax; - var FunctionDeclarationSyntax = (function (_super) { - __extends(FunctionDeclarationSyntax, _super); - function FunctionDeclarationSyntax(data, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), functionKeyword.parent = this, identifier.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return FunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionDeclarationSyntax = FunctionDeclarationSyntax; - var ModuleDeclarationSyntax = (function (_super) { - __extends(ModuleDeclarationSyntax, _super); - function ModuleDeclarationSyntax(data, modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.moduleKeyword = moduleKeyword, this.name = name, this.stringLiteral = stringLiteral, this.openBraceToken = openBraceToken, this.moduleElements = moduleElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), moduleKeyword.parent = this, name && (name.parent = this), stringLiteral && (stringLiteral.parent = this), openBraceToken.parent = this, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), closeBraceToken.parent = this; - } - return ModuleDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleDeclarationSyntax = ModuleDeclarationSyntax; - var ClassDeclarationSyntax = (function (_super) { - __extends(ClassDeclarationSyntax, _super); - function ClassDeclarationSyntax(data, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.classKeyword = classKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.openBraceToken = openBraceToken, this.classElements = classElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), classKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), openBraceToken.parent = this, !TypeScript.isShared(classElements) && (classElements.parent = this), closeBraceToken.parent = this; - } - return ClassDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ClassDeclarationSyntax = ClassDeclarationSyntax; - var EnumDeclarationSyntax = (function (_super) { - __extends(EnumDeclarationSyntax, _super); - function EnumDeclarationSyntax(data, modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.enumKeyword = enumKeyword, this.identifier = identifier, this.openBraceToken = openBraceToken, this.enumElements = enumElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), enumKeyword.parent = this, identifier.parent = this, openBraceToken.parent = this, !TypeScript.isShared(enumElements) && (enumElements.parent = this), closeBraceToken.parent = this; - } - return EnumDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumDeclarationSyntax = EnumDeclarationSyntax; - var ImportDeclarationSyntax = (function (_super) { - __extends(ImportDeclarationSyntax, _super); - function ImportDeclarationSyntax(data, modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.importKeyword = importKeyword, this.identifier = identifier, this.equalsToken = equalsToken, this.moduleReference = moduleReference, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), importKeyword.parent = this, identifier.parent = this, equalsToken.parent = this, moduleReference.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ImportDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ImportDeclarationSyntax = ImportDeclarationSyntax; - var ExportAssignmentSyntax = (function (_super) { - __extends(ExportAssignmentSyntax, _super); - function ExportAssignmentSyntax(data, exportKeyword, equalsToken, identifier, semicolonToken) { - _super.call(this, data); - this.exportKeyword = exportKeyword, this.equalsToken = equalsToken, this.identifier = identifier, this.semicolonToken = semicolonToken, exportKeyword.parent = this, equalsToken.parent = this, identifier.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExportAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExportAssignmentSyntax = ExportAssignmentSyntax; - var MemberFunctionDeclarationSyntax = (function (_super) { - __extends(MemberFunctionDeclarationSyntax, _super); - function MemberFunctionDeclarationSyntax(data, modifiers, propertyName, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), propertyName.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return MemberFunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberFunctionDeclarationSyntax = MemberFunctionDeclarationSyntax; - var MemberVariableDeclarationSyntax = (function (_super) { - __extends(MemberVariableDeclarationSyntax, _super); - function MemberVariableDeclarationSyntax(data, modifiers, variableDeclarator, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return MemberVariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberVariableDeclarationSyntax = MemberVariableDeclarationSyntax; - var ConstructorDeclarationSyntax = (function (_super) { - __extends(ConstructorDeclarationSyntax, _super); - function ConstructorDeclarationSyntax(data, modifiers, constructorKeyword, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), constructorKeyword.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ConstructorDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorDeclarationSyntax = ConstructorDeclarationSyntax; - var IndexMemberDeclarationSyntax = (function (_super) { - __extends(IndexMemberDeclarationSyntax, _super); - function IndexMemberDeclarationSyntax(data, modifiers, indexSignature, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return IndexMemberDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexMemberDeclarationSyntax = IndexMemberDeclarationSyntax; - var GetAccessorSyntax = (function (_super) { - __extends(GetAccessorSyntax, _super); - function GetAccessorSyntax(data, modifiers, getKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return GetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.GetAccessorSyntax = GetAccessorSyntax; - var SetAccessorSyntax = (function (_super) { - __extends(SetAccessorSyntax, _super); - function SetAccessorSyntax(data, modifiers, setKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return SetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.SetAccessorSyntax = SetAccessorSyntax; - var PropertySignatureSyntax = (function (_super) { - __extends(PropertySignatureSyntax, _super); - function PropertySignatureSyntax(data, propertyName, questionToken, typeAnnotation) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, propertyName.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this); - } - return PropertySignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.PropertySignatureSyntax = PropertySignatureSyntax; - var CallSignatureSyntax = (function (_super) { - __extends(CallSignatureSyntax, _super); - function CallSignatureSyntax(data, typeParameterList, parameterList, typeAnnotation) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.typeAnnotation = typeAnnotation, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return CallSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.CallSignatureSyntax = CallSignatureSyntax; - var ConstructSignatureSyntax = (function (_super) { - __extends(ConstructSignatureSyntax, _super); - function ConstructSignatureSyntax(data, newKeyword, callSignature) { - _super.call(this, data); - this.newKeyword = newKeyword, this.callSignature = callSignature, newKeyword.parent = this, callSignature.parent = this; - } - return ConstructSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructSignatureSyntax = ConstructSignatureSyntax; - var IndexSignatureSyntax = (function (_super) { - __extends(IndexSignatureSyntax, _super); - function IndexSignatureSyntax(data, openBracketToken, parameters, closeBracketToken, typeAnnotation) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.parameters = parameters, this.closeBracketToken = closeBracketToken, this.typeAnnotation = typeAnnotation, openBracketToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeBracketToken.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return IndexSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexSignatureSyntax = IndexSignatureSyntax; - var MethodSignatureSyntax = (function (_super) { - __extends(MethodSignatureSyntax, _super); - function MethodSignatureSyntax(data, propertyName, questionToken, callSignature) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature, propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; - } - return MethodSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.MethodSignatureSyntax = MethodSignatureSyntax; - var BlockSyntax = (function (_super) { - __extends(BlockSyntax, _super); - function BlockSyntax(data, openBraceToken, statements, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this), closeBraceToken.parent = this; - } - return BlockSyntax; - })(TypeScript.SyntaxNode); - Concrete.BlockSyntax = BlockSyntax; - var IfStatementSyntax = (function (_super) { - __extends(IfStatementSyntax, _super); - function IfStatementSyntax(data, ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - _super.call(this, data); - this.ifKeyword = ifKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, this.elseClause = elseClause, ifKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this, elseClause && (elseClause.parent = this); - } - return IfStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.IfStatementSyntax = IfStatementSyntax; - var VariableStatementSyntax = (function (_super) { - __extends(VariableStatementSyntax, _super); - function VariableStatementSyntax(data, modifiers, variableDeclaration, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return VariableStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableStatementSyntax = VariableStatementSyntax; - var ExpressionStatementSyntax = (function (_super) { - __extends(ExpressionStatementSyntax, _super); - function ExpressionStatementSyntax(data, expression, semicolonToken) { - _super.call(this, data); - this.expression = expression, this.semicolonToken = semicolonToken, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExpressionStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExpressionStatementSyntax = ExpressionStatementSyntax; - var ReturnStatementSyntax = (function (_super) { - __extends(ReturnStatementSyntax, _super); - function ReturnStatementSyntax(data, returnKeyword, expression, semicolonToken) { - _super.call(this, data); - this.returnKeyword = returnKeyword, this.expression = expression, this.semicolonToken = semicolonToken, returnKeyword.parent = this, expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ReturnStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ReturnStatementSyntax = ReturnStatementSyntax; - var SwitchStatementSyntax = (function (_super) { - __extends(SwitchStatementSyntax, _super); - function SwitchStatementSyntax(data, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - _super.call(this, data); - this.switchKeyword = switchKeyword, this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, this.openBraceToken = openBraceToken, this.switchClauses = switchClauses, this.closeBraceToken = closeBraceToken, switchKeyword.parent = this, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this, openBraceToken.parent = this, !TypeScript.isShared(switchClauses) && (switchClauses.parent = this), closeBraceToken.parent = this; - } - return SwitchStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.SwitchStatementSyntax = SwitchStatementSyntax; - var BreakStatementSyntax = (function (_super) { - __extends(BreakStatementSyntax, _super); - function BreakStatementSyntax(data, breakKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.breakKeyword = breakKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, breakKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return BreakStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.BreakStatementSyntax = BreakStatementSyntax; - var ContinueStatementSyntax = (function (_super) { - __extends(ContinueStatementSyntax, _super); - function ContinueStatementSyntax(data, continueKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.continueKeyword = continueKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, continueKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ContinueStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ContinueStatementSyntax = ContinueStatementSyntax; - var ForStatementSyntax = (function (_super) { - __extends(ForStatementSyntax, _super); - function ForStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - _super.call(this, data); - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.initializer = initializer, this.firstSemicolonToken = firstSemicolonToken, this.condition = condition, this.secondSemicolonToken = secondSemicolonToken, this.incrementor = incrementor, this.closeParenToken = closeParenToken, this.statement = statement, forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), initializer && (initializer.parent = this), firstSemicolonToken.parent = this, condition && (condition.parent = this), secondSemicolonToken.parent = this, incrementor && (incrementor.parent = this), closeParenToken.parent = this, statement.parent = this; - } - return ForStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForStatementSyntax = ForStatementSyntax; - var ForInStatementSyntax = (function (_super) { - __extends(ForInStatementSyntax, _super); - function ForInStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - _super.call(this, data); - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.left = left, this.inKeyword = inKeyword, this.expression = expression, this.closeParenToken = closeParenToken, this.statement = statement, forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), left && (left.parent = this), inKeyword.parent = this, expression.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return ForInStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForInStatementSyntax = ForInStatementSyntax; - var EmptyStatementSyntax = (function (_super) { - __extends(EmptyStatementSyntax, _super); - function EmptyStatementSyntax(data, semicolonToken) { - _super.call(this, data); - this.semicolonToken = semicolonToken, semicolonToken.parent = this; - } - return EmptyStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EmptyStatementSyntax = EmptyStatementSyntax; - var ThrowStatementSyntax = (function (_super) { - __extends(ThrowStatementSyntax, _super); - function ThrowStatementSyntax(data, throwKeyword, expression, semicolonToken) { - _super.call(this, data); - this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken, throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ThrowStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ThrowStatementSyntax = ThrowStatementSyntax; - var WhileStatementSyntax = (function (_super) { - __extends(WhileStatementSyntax, _super); - function WhileStatementSyntax(data, whileKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, data); - this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return WhileStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WhileStatementSyntax = WhileStatementSyntax; - var TryStatementSyntax = (function (_super) { - __extends(TryStatementSyntax, _super); - function TryStatementSyntax(data, tryKeyword, block, catchClause, finallyClause) { - _super.call(this, data); - this.tryKeyword = tryKeyword, this.block = block, this.catchClause = catchClause, this.finallyClause = finallyClause, tryKeyword.parent = this, block.parent = this, catchClause && (catchClause.parent = this), finallyClause && (finallyClause.parent = this); - } - return TryStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.TryStatementSyntax = TryStatementSyntax; - var LabeledStatementSyntax = (function (_super) { - __extends(LabeledStatementSyntax, _super); - function LabeledStatementSyntax(data, identifier, colonToken, statement) { - _super.call(this, data); - this.identifier = identifier, this.colonToken = colonToken, this.statement = statement, identifier.parent = this, colonToken.parent = this, statement.parent = this; - } - return LabeledStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.LabeledStatementSyntax = LabeledStatementSyntax; - var DoStatementSyntax = (function (_super) { - __extends(DoStatementSyntax, _super); - function DoStatementSyntax(data, doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - _super.call(this, data); - this.doKeyword = doKeyword, this.statement = statement, this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.semicolonToken = semicolonToken, doKeyword.parent = this, statement.parent = this, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DoStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DoStatementSyntax = DoStatementSyntax; - var DebuggerStatementSyntax = (function (_super) { - __extends(DebuggerStatementSyntax, _super); - function DebuggerStatementSyntax(data, debuggerKeyword, semicolonToken) { - _super.call(this, data); - this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken, debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DebuggerStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DebuggerStatementSyntax = DebuggerStatementSyntax; - var WithStatementSyntax = (function (_super) { - __extends(WithStatementSyntax, _super); - function WithStatementSyntax(data, withKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, data); - this.withKeyword = withKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, withKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return WithStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WithStatementSyntax = WithStatementSyntax; - var PrefixUnaryExpressionSyntax = (function (_super) { - __extends(PrefixUnaryExpressionSyntax, _super); - function PrefixUnaryExpressionSyntax(data, operatorToken, operand) { - _super.call(this, data); - this.operatorToken = operatorToken, this.operand = operand, operatorToken.parent = this, operand.parent = this; - } - PrefixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PrefixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PrefixUnaryExpressionSyntax = PrefixUnaryExpressionSyntax; - var DeleteExpressionSyntax = (function (_super) { - __extends(DeleteExpressionSyntax, _super); - function DeleteExpressionSyntax(data, deleteKeyword, expression) { - _super.call(this, data); - this.deleteKeyword = deleteKeyword, this.expression = expression, deleteKeyword.parent = this, expression.parent = this; - } - return DeleteExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.DeleteExpressionSyntax = DeleteExpressionSyntax; - var TypeOfExpressionSyntax = (function (_super) { - __extends(TypeOfExpressionSyntax, _super); - function TypeOfExpressionSyntax(data, typeOfKeyword, expression) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.expression = expression, typeOfKeyword.parent = this, expression.parent = this; - } - return TypeOfExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeOfExpressionSyntax = TypeOfExpressionSyntax; - var VoidExpressionSyntax = (function (_super) { - __extends(VoidExpressionSyntax, _super); - function VoidExpressionSyntax(data, voidKeyword, expression) { - _super.call(this, data); - this.voidKeyword = voidKeyword, this.expression = expression, voidKeyword.parent = this, expression.parent = this; - } - return VoidExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.VoidExpressionSyntax = VoidExpressionSyntax; - var ConditionalExpressionSyntax = (function (_super) { - __extends(ConditionalExpressionSyntax, _super); - function ConditionalExpressionSyntax(data, condition, questionToken, whenTrue, colonToken, whenFalse) { - _super.call(this, data); - this.condition = condition, this.questionToken = questionToken, this.whenTrue = whenTrue, this.colonToken = colonToken, this.whenFalse = whenFalse, condition.parent = this, questionToken.parent = this, whenTrue.parent = this, colonToken.parent = this, whenFalse.parent = this; - } - return ConditionalExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConditionalExpressionSyntax = ConditionalExpressionSyntax; - var BinaryExpressionSyntax = (function (_super) { - __extends(BinaryExpressionSyntax, _super); - function BinaryExpressionSyntax(data, left, operatorToken, right) { - _super.call(this, data); - this.left = left, this.operatorToken = operatorToken, this.right = right, left.parent = this, operatorToken.parent = this, right.parent = this; - } - BinaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return BinaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.BinaryExpressionSyntax = BinaryExpressionSyntax; - var PostfixUnaryExpressionSyntax = (function (_super) { - __extends(PostfixUnaryExpressionSyntax, _super); - function PostfixUnaryExpressionSyntax(data, operand, operatorToken) { - _super.call(this, data); - this.operand = operand, this.operatorToken = operatorToken, operand.parent = this, operatorToken.parent = this; - } - PostfixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PostfixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PostfixUnaryExpressionSyntax = PostfixUnaryExpressionSyntax; - var MemberAccessExpressionSyntax = (function (_super) { - __extends(MemberAccessExpressionSyntax, _super); - function MemberAccessExpressionSyntax(data, expression, dotToken, name) { - _super.call(this, data); - this.expression = expression, this.dotToken = dotToken, this.name = name, expression.parent = this, dotToken.parent = this, name.parent = this; - } - return MemberAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberAccessExpressionSyntax = MemberAccessExpressionSyntax; - var InvocationExpressionSyntax = (function (_super) { - __extends(InvocationExpressionSyntax, _super); - function InvocationExpressionSyntax(data, expression, argumentList) { - _super.call(this, data); - this.expression = expression, this.argumentList = argumentList, expression.parent = this, argumentList.parent = this; - } - return InvocationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.InvocationExpressionSyntax = InvocationExpressionSyntax; - var ArrayLiteralExpressionSyntax = (function (_super) { - __extends(ArrayLiteralExpressionSyntax, _super); - function ArrayLiteralExpressionSyntax(data, openBracketToken, expressions, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(expressions) && (expressions.parent = this), closeBracketToken.parent = this; - } - return ArrayLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayLiteralExpressionSyntax = ArrayLiteralExpressionSyntax; - var ObjectLiteralExpressionSyntax = (function (_super) { - __extends(ObjectLiteralExpressionSyntax, _super); - function ObjectLiteralExpressionSyntax(data, openBraceToken, propertyAssignments, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(propertyAssignments) && (propertyAssignments.parent = this), closeBraceToken.parent = this; - } - return ObjectLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectLiteralExpressionSyntax = ObjectLiteralExpressionSyntax; - var ObjectCreationExpressionSyntax = (function (_super) { - __extends(ObjectCreationExpressionSyntax, _super); - function ObjectCreationExpressionSyntax(data, newKeyword, expression, argumentList) { - _super.call(this, data); - this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList, newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); - } - return ObjectCreationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectCreationExpressionSyntax = ObjectCreationExpressionSyntax; - var ParenthesizedExpressionSyntax = (function (_super) { - __extends(ParenthesizedExpressionSyntax, _super); - function ParenthesizedExpressionSyntax(data, openParenToken, expression, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; - } - return ParenthesizedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedExpressionSyntax = ParenthesizedExpressionSyntax; - var ParenthesizedArrowFunctionExpressionSyntax = (function (_super) { - __extends(ParenthesizedArrowFunctionExpressionSyntax, _super); - function ParenthesizedArrowFunctionExpressionSyntax(data, callSignature, equalsGreaterThanToken, block, expression) { - _super.call(this, data); - this.callSignature = callSignature, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression, callSignature.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - } - return ParenthesizedArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedArrowFunctionExpressionSyntax = ParenthesizedArrowFunctionExpressionSyntax; - var SimpleArrowFunctionExpressionSyntax = (function (_super) { - __extends(SimpleArrowFunctionExpressionSyntax, _super); - function SimpleArrowFunctionExpressionSyntax(data, parameter, equalsGreaterThanToken, block, expression) { - _super.call(this, data); - this.parameter = parameter, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression, parameter.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - } - return SimpleArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimpleArrowFunctionExpressionSyntax = SimpleArrowFunctionExpressionSyntax; - var CastExpressionSyntax = (function (_super) { - __extends(CastExpressionSyntax, _super); - function CastExpressionSyntax(data, lessThanToken, type, greaterThanToken, expression) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.type = type, this.greaterThanToken = greaterThanToken, this.expression = expression, lessThanToken.parent = this, type.parent = this, greaterThanToken.parent = this, expression.parent = this; - } - return CastExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.CastExpressionSyntax = CastExpressionSyntax; - var ElementAccessExpressionSyntax = (function (_super) { - __extends(ElementAccessExpressionSyntax, _super); - function ElementAccessExpressionSyntax(data, expression, openBracketToken, argumentExpression, closeBracketToken) { - _super.call(this, data); - this.expression = expression, this.openBracketToken = openBracketToken, this.argumentExpression = argumentExpression, this.closeBracketToken = closeBracketToken, expression.parent = this, openBracketToken.parent = this, argumentExpression.parent = this, closeBracketToken.parent = this; - } - return ElementAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElementAccessExpressionSyntax = ElementAccessExpressionSyntax; - var FunctionExpressionSyntax = (function (_super) { - __extends(FunctionExpressionSyntax, _super); - function FunctionExpressionSyntax(data, functionKeyword, identifier, callSignature, block) { - _super.call(this, data); - this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, functionKeyword.parent = this, identifier && (identifier.parent = this), callSignature.parent = this, block.parent = this; - } - return FunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionExpressionSyntax = FunctionExpressionSyntax; - var OmittedExpressionSyntax = (function (_super) { - __extends(OmittedExpressionSyntax, _super); - function OmittedExpressionSyntax(data) { - _super.call(this, data); - } - return OmittedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.OmittedExpressionSyntax = OmittedExpressionSyntax; - var VariableDeclarationSyntax = (function (_super) { - __extends(VariableDeclarationSyntax, _super); - function VariableDeclarationSyntax(data, varKeyword, variableDeclarators) { - _super.call(this, data); - this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators, varKeyword.parent = this, !TypeScript.isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - return VariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclarationSyntax = VariableDeclarationSyntax; - var VariableDeclaratorSyntax = (function (_super) { - __extends(VariableDeclaratorSyntax, _super); - function VariableDeclaratorSyntax(data, propertyName, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, propertyName.parent = this, typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return VariableDeclaratorSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclaratorSyntax = VariableDeclaratorSyntax; - var ArgumentListSyntax = (function (_super) { - __extends(ArgumentListSyntax, _super); - function ArgumentListSyntax(data, typeArgumentList, openParenToken, _arguments, closeParenToken) { - _super.call(this, data); - this.typeArgumentList = typeArgumentList, this.openParenToken = openParenToken, this.arguments = _arguments, this.closeParenToken = closeParenToken, typeArgumentList && (typeArgumentList.parent = this), openParenToken.parent = this, !TypeScript.isShared(_arguments) && (_arguments.parent = this), closeParenToken.parent = this; - } - return ArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArgumentListSyntax = ArgumentListSyntax; - var ParameterListSyntax = (function (_super) { - __extends(ParameterListSyntax, _super); - function ParameterListSyntax(data, openParenToken, parameters, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken, openParenToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeParenToken.parent = this; - } - return ParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterListSyntax = ParameterListSyntax; - var TypeArgumentListSyntax = (function (_super) { - __extends(TypeArgumentListSyntax, _super); - function TypeArgumentListSyntax(data, lessThanToken, typeArguments, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeArguments) && (typeArguments.parent = this), greaterThanToken.parent = this; - } - return TypeArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeArgumentListSyntax = TypeArgumentListSyntax; - var TypeParameterListSyntax = (function (_super) { - __extends(TypeParameterListSyntax, _super); - function TypeParameterListSyntax(data, lessThanToken, typeParameters, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeParameters) && (typeParameters.parent = this), greaterThanToken.parent = this; - } - return TypeParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterListSyntax = TypeParameterListSyntax; - var HeritageClauseSyntax = (function (_super) { - __extends(HeritageClauseSyntax, _super); - function HeritageClauseSyntax(data, extendsOrImplementsKeyword, typeNames) { - _super.call(this, data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames, extendsOrImplementsKeyword.parent = this, !TypeScript.isShared(typeNames) && (typeNames.parent = this); - } - HeritageClauseSyntax.prototype.kind = function () { - return this.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */ ? 231 /* ExtendsHeritageClause */ : 232 /* ImplementsHeritageClause */; - }; - return HeritageClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.HeritageClauseSyntax = HeritageClauseSyntax; - var EqualsValueClauseSyntax = (function (_super) { - __extends(EqualsValueClauseSyntax, _super); - function EqualsValueClauseSyntax(data, equalsToken, value) { - _super.call(this, data); - this.equalsToken = equalsToken, this.value = value, equalsToken.parent = this, value.parent = this; - } - return EqualsValueClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.EqualsValueClauseSyntax = EqualsValueClauseSyntax; - var CaseSwitchClauseSyntax = (function (_super) { - __extends(CaseSwitchClauseSyntax, _super); - function CaseSwitchClauseSyntax(data, caseKeyword, expression, colonToken, statements) { - _super.call(this, data); - this.caseKeyword = caseKeyword, this.expression = expression, this.colonToken = colonToken, this.statements = statements, caseKeyword.parent = this, expression.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return CaseSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CaseSwitchClauseSyntax = CaseSwitchClauseSyntax; - var DefaultSwitchClauseSyntax = (function (_super) { - __extends(DefaultSwitchClauseSyntax, _super); - function DefaultSwitchClauseSyntax(data, defaultKeyword, colonToken, statements) { - _super.call(this, data); - this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements, defaultKeyword.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return DefaultSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.DefaultSwitchClauseSyntax = DefaultSwitchClauseSyntax; - var ElseClauseSyntax = (function (_super) { - __extends(ElseClauseSyntax, _super); - function ElseClauseSyntax(data, elseKeyword, statement) { - _super.call(this, data); - this.elseKeyword = elseKeyword, this.statement = statement, elseKeyword.parent = this, statement.parent = this; - } - return ElseClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElseClauseSyntax = ElseClauseSyntax; - var CatchClauseSyntax = (function (_super) { - __extends(CatchClauseSyntax, _super); - function CatchClauseSyntax(data, catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - _super.call(this, data); - this.catchKeyword = catchKeyword, this.openParenToken = openParenToken, this.identifier = identifier, this.typeAnnotation = typeAnnotation, this.closeParenToken = closeParenToken, this.block = block, catchKeyword.parent = this, openParenToken.parent = this, identifier.parent = this, typeAnnotation && (typeAnnotation.parent = this), closeParenToken.parent = this, block.parent = this; - } - return CatchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CatchClauseSyntax = CatchClauseSyntax; - var FinallyClauseSyntax = (function (_super) { - __extends(FinallyClauseSyntax, _super); - function FinallyClauseSyntax(data, finallyKeyword, block) { - _super.call(this, data); - this.finallyKeyword = finallyKeyword, this.block = block, finallyKeyword.parent = this, block.parent = this; - } - return FinallyClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.FinallyClauseSyntax = FinallyClauseSyntax; - var TypeParameterSyntax = (function (_super) { - __extends(TypeParameterSyntax, _super); - function TypeParameterSyntax(data, identifier, constraint) { - _super.call(this, data); - this.identifier = identifier, this.constraint = constraint, identifier.parent = this, constraint && (constraint.parent = this); - } - return TypeParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterSyntax = TypeParameterSyntax; - var ConstraintSyntax = (function (_super) { - __extends(ConstraintSyntax, _super); - function ConstraintSyntax(data, extendsKeyword, typeOrExpression) { - _super.call(this, data); - this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression, extendsKeyword.parent = this, typeOrExpression.parent = this; - } - return ConstraintSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstraintSyntax = ConstraintSyntax; - var SimplePropertyAssignmentSyntax = (function (_super) { - __extends(SimplePropertyAssignmentSyntax, _super); - function SimplePropertyAssignmentSyntax(data, propertyName, colonToken, expression) { - _super.call(this, data); - this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression, propertyName.parent = this, colonToken.parent = this, expression.parent = this; - } - return SimplePropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimplePropertyAssignmentSyntax = SimplePropertyAssignmentSyntax; - var FunctionPropertyAssignmentSyntax = (function (_super) { - __extends(FunctionPropertyAssignmentSyntax, _super); - function FunctionPropertyAssignmentSyntax(data, propertyName, callSignature, block) { - _super.call(this, data); - this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return FunctionPropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionPropertyAssignmentSyntax = FunctionPropertyAssignmentSyntax; - var ParameterSyntax = (function (_super) { - __extends(ParameterSyntax, _super); - function ParameterSyntax(data, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.dotDotDotToken = dotDotDotToken, this.modifiers = modifiers, this.identifier = identifier, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, dotDotDotToken && (dotDotDotToken.parent = this), !TypeScript.isShared(modifiers) && (modifiers.parent = this), identifier.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return ParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterSyntax = ParameterSyntax; - var EnumElementSyntax = (function (_super) { - __extends(EnumElementSyntax, _super); - function EnumElementSyntax(data, propertyName, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.equalsValueClause = equalsValueClause, propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); - } - return EnumElementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumElementSyntax = EnumElementSyntax; - var TypeAnnotationSyntax = (function (_super) { - __extends(TypeAnnotationSyntax, _super); - function TypeAnnotationSyntax(data, colonToken, type) { - _super.call(this, data); - this.colonToken = colonToken, this.type = type, colonToken.parent = this, type.parent = this; - } - return TypeAnnotationSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeAnnotationSyntax = TypeAnnotationSyntax; - var ExternalModuleReferenceSyntax = (function (_super) { - __extends(ExternalModuleReferenceSyntax, _super); - function ExternalModuleReferenceSyntax(data, requireKeyword, openParenToken, stringLiteral, closeParenToken) { - _super.call(this, data); - this.requireKeyword = requireKeyword, this.openParenToken = openParenToken, this.stringLiteral = stringLiteral, this.closeParenToken = closeParenToken, requireKeyword.parent = this, openParenToken.parent = this, stringLiteral.parent = this, closeParenToken.parent = this; - } - return ExternalModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExternalModuleReferenceSyntax = ExternalModuleReferenceSyntax; - var ModuleNameModuleReferenceSyntax = (function (_super) { - __extends(ModuleNameModuleReferenceSyntax, _super); - function ModuleNameModuleReferenceSyntax(data, moduleName) { - _super.call(this, data); - this.moduleName = moduleName, moduleName.parent = this; - } - return ModuleNameModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleNameModuleReferenceSyntax = ModuleNameModuleReferenceSyntax; - SourceUnitSyntax.prototype.__kind = 120 /* SourceUnit */, QualifiedNameSyntax.prototype.__kind = 121 /* QualifiedName */, ObjectTypeSyntax.prototype.__kind = 122 /* ObjectType */, FunctionTypeSyntax.prototype.__kind = 123 /* FunctionType */, ArrayTypeSyntax.prototype.__kind = 124 /* ArrayType */, ConstructorTypeSyntax.prototype.__kind = 125 /* ConstructorType */, GenericTypeSyntax.prototype.__kind = 126 /* GenericType */, TypeQuerySyntax.prototype.__kind = 127 /* TypeQuery */, TupleTypeSyntax.prototype.__kind = 128 /* TupleType */, InterfaceDeclarationSyntax.prototype.__kind = 129 /* InterfaceDeclaration */, FunctionDeclarationSyntax.prototype.__kind = 130 /* FunctionDeclaration */, ModuleDeclarationSyntax.prototype.__kind = 131 /* ModuleDeclaration */, ClassDeclarationSyntax.prototype.__kind = 132 /* ClassDeclaration */, EnumDeclarationSyntax.prototype.__kind = 133 /* EnumDeclaration */, ImportDeclarationSyntax.prototype.__kind = 134 /* ImportDeclaration */, ExportAssignmentSyntax.prototype.__kind = 135 /* ExportAssignment */, MemberFunctionDeclarationSyntax.prototype.__kind = 136 /* MemberFunctionDeclaration */, MemberVariableDeclarationSyntax.prototype.__kind = 137 /* MemberVariableDeclaration */, ConstructorDeclarationSyntax.prototype.__kind = 138 /* ConstructorDeclaration */, IndexMemberDeclarationSyntax.prototype.__kind = 139 /* IndexMemberDeclaration */, GetAccessorSyntax.prototype.__kind = 140 /* GetAccessor */, SetAccessorSyntax.prototype.__kind = 141 /* SetAccessor */, PropertySignatureSyntax.prototype.__kind = 142 /* PropertySignature */, CallSignatureSyntax.prototype.__kind = 143 /* CallSignature */, ConstructSignatureSyntax.prototype.__kind = 144 /* ConstructSignature */, IndexSignatureSyntax.prototype.__kind = 145 /* IndexSignature */, MethodSignatureSyntax.prototype.__kind = 146 /* MethodSignature */, BlockSyntax.prototype.__kind = 147 /* Block */, IfStatementSyntax.prototype.__kind = 148 /* IfStatement */, VariableStatementSyntax.prototype.__kind = 149 /* VariableStatement */, ExpressionStatementSyntax.prototype.__kind = 150 /* ExpressionStatement */, ReturnStatementSyntax.prototype.__kind = 151 /* ReturnStatement */, SwitchStatementSyntax.prototype.__kind = 152 /* SwitchStatement */, BreakStatementSyntax.prototype.__kind = 153 /* BreakStatement */, ContinueStatementSyntax.prototype.__kind = 154 /* ContinueStatement */, ForStatementSyntax.prototype.__kind = 155 /* ForStatement */, ForInStatementSyntax.prototype.__kind = 156 /* ForInStatement */, EmptyStatementSyntax.prototype.__kind = 157 /* EmptyStatement */, ThrowStatementSyntax.prototype.__kind = 158 /* ThrowStatement */, WhileStatementSyntax.prototype.__kind = 159 /* WhileStatement */, TryStatementSyntax.prototype.__kind = 160 /* TryStatement */, LabeledStatementSyntax.prototype.__kind = 161 /* LabeledStatement */, DoStatementSyntax.prototype.__kind = 162 /* DoStatement */, DebuggerStatementSyntax.prototype.__kind = 163 /* DebuggerStatement */, WithStatementSyntax.prototype.__kind = 164 /* WithStatement */, DeleteExpressionSyntax.prototype.__kind = 171 /* DeleteExpression */, TypeOfExpressionSyntax.prototype.__kind = 172 /* TypeOfExpression */, VoidExpressionSyntax.prototype.__kind = 173 /* VoidExpression */, ConditionalExpressionSyntax.prototype.__kind = 187 /* ConditionalExpression */, MemberAccessExpressionSyntax.prototype.__kind = 213 /* MemberAccessExpression */, InvocationExpressionSyntax.prototype.__kind = 214 /* InvocationExpression */, ArrayLiteralExpressionSyntax.prototype.__kind = 215 /* ArrayLiteralExpression */, ObjectLiteralExpressionSyntax.prototype.__kind = 216 /* ObjectLiteralExpression */, ObjectCreationExpressionSyntax.prototype.__kind = 217 /* ObjectCreationExpression */, ParenthesizedExpressionSyntax.prototype.__kind = 218 /* ParenthesizedExpression */, ParenthesizedArrowFunctionExpressionSyntax.prototype.__kind = 219 /* ParenthesizedArrowFunctionExpression */, SimpleArrowFunctionExpressionSyntax.prototype.__kind = 220 /* SimpleArrowFunctionExpression */, CastExpressionSyntax.prototype.__kind = 221 /* CastExpression */, ElementAccessExpressionSyntax.prototype.__kind = 222 /* ElementAccessExpression */, FunctionExpressionSyntax.prototype.__kind = 223 /* FunctionExpression */, OmittedExpressionSyntax.prototype.__kind = 224 /* OmittedExpression */, VariableDeclarationSyntax.prototype.__kind = 225 /* VariableDeclaration */, VariableDeclaratorSyntax.prototype.__kind = 226 /* VariableDeclarator */, ArgumentListSyntax.prototype.__kind = 227 /* ArgumentList */, ParameterListSyntax.prototype.__kind = 228 /* ParameterList */, TypeArgumentListSyntax.prototype.__kind = 229 /* TypeArgumentList */, TypeParameterListSyntax.prototype.__kind = 230 /* TypeParameterList */, EqualsValueClauseSyntax.prototype.__kind = 233 /* EqualsValueClause */, CaseSwitchClauseSyntax.prototype.__kind = 234 /* CaseSwitchClause */, DefaultSwitchClauseSyntax.prototype.__kind = 235 /* DefaultSwitchClause */, ElseClauseSyntax.prototype.__kind = 236 /* ElseClause */, CatchClauseSyntax.prototype.__kind = 237 /* CatchClause */, FinallyClauseSyntax.prototype.__kind = 238 /* FinallyClause */, TypeParameterSyntax.prototype.__kind = 239 /* TypeParameter */, ConstraintSyntax.prototype.__kind = 240 /* Constraint */, SimplePropertyAssignmentSyntax.prototype.__kind = 241 /* SimplePropertyAssignment */, FunctionPropertyAssignmentSyntax.prototype.__kind = 242 /* FunctionPropertyAssignment */, ParameterSyntax.prototype.__kind = 243 /* Parameter */, EnumElementSyntax.prototype.__kind = 244 /* EnumElement */, TypeAnnotationSyntax.prototype.__kind = 245 /* TypeAnnotation */, ExternalModuleReferenceSyntax.prototype.__kind = 246 /* ExternalModuleReference */, ModuleNameModuleReferenceSyntax.prototype.__kind = 247 /* ModuleNameModuleReference */; - })(Concrete = Syntax.Concrete || (Syntax.Concrete = {})); - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); + TypeScript.SourceUnitSyntax = function (data, moduleElements, endOfFileToken) { + if (data) { + this.__data = data; + } + this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken; + moduleElements.parent = this, endOfFileToken.parent = this; + }; + TypeScript.SourceUnitSyntax.prototype.kind = function () { + return 122 /* SourceUnit */; + }; + TypeScript.QualifiedNameSyntax = function (data, left, dotToken, right) { + if (data) { + this.__data = data; + } + this.left = left, this.dotToken = dotToken, this.right = right; + left.parent = this, dotToken.parent = this, right.parent = this; + }; + TypeScript.QualifiedNameSyntax.prototype.kind = function () { + return 123 /* QualifiedName */; + }; + TypeScript.ObjectTypeSyntax = function (data, openBraceToken, typeMembers, closeBraceToken) { + if (data) { + this.__data = data; + } + this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken; + openBraceToken.parent = this, typeMembers.parent = this, closeBraceToken.parent = this; + }; + TypeScript.ObjectTypeSyntax.prototype.kind = function () { + return 124 /* ObjectType */; + }; + TypeScript.FunctionTypeSyntax = function (data, typeParameterList, parameterList, equalsGreaterThanToken, type) { + if (data) { + this.__data = data; + } + this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type; + typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; + }; + TypeScript.FunctionTypeSyntax.prototype.kind = function () { + return 125 /* FunctionType */; + }; + TypeScript.ArrayTypeSyntax = function (data, type, openBracketToken, closeBracketToken) { + if (data) { + this.__data = data; + } + this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken; + type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; + }; + TypeScript.ArrayTypeSyntax.prototype.kind = function () { + return 126 /* ArrayType */; + }; + TypeScript.ConstructorTypeSyntax = function (data, newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { + if (data) { + this.__data = data; + } + this.newKeyword = newKeyword, this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type; + newKeyword.parent = this, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; + }; + TypeScript.ConstructorTypeSyntax.prototype.kind = function () { + return 127 /* ConstructorType */; + }; + TypeScript.GenericTypeSyntax = function (data, name, typeArgumentList) { + if (data) { + this.__data = data; + } + this.name = name, this.typeArgumentList = typeArgumentList; + name.parent = this, typeArgumentList.parent = this; + }; + TypeScript.GenericTypeSyntax.prototype.kind = function () { + return 128 /* GenericType */; + }; + TypeScript.TypeQuerySyntax = function (data, typeOfKeyword, name) { + if (data) { + this.__data = data; + } + this.typeOfKeyword = typeOfKeyword, this.name = name; + typeOfKeyword.parent = this, name.parent = this; + }; + TypeScript.TypeQuerySyntax.prototype.kind = function () { + return 129 /* TypeQuery */; + }; + TypeScript.TupleTypeSyntax = function (data, openBracketToken, types, closeBracketToken) { + if (data) { + this.__data = data; + } + this.openBracketToken = openBracketToken, this.types = types, this.closeBracketToken = closeBracketToken; + openBracketToken.parent = this, types.parent = this, closeBracketToken.parent = this; + }; + TypeScript.TupleTypeSyntax.prototype.kind = function () { + return 130 /* TupleType */; + }; + TypeScript.UnionTypeSyntax = function (data, left, barToken, right) { + if (data) { + this.__data = data; + } + this.left = left, this.barToken = barToken, this.right = right; + left.parent = this, barToken.parent = this, right.parent = this; + }; + TypeScript.UnionTypeSyntax.prototype.kind = function () { + return 131 /* UnionType */; + }; + TypeScript.ParenthesizedTypeSyntax = function (data, openParenToken, type, closeParenToken) { + if (data) { + this.__data = data; + } + this.openParenToken = openParenToken, this.type = type, this.closeParenToken = closeParenToken; + openParenToken.parent = this, type.parent = this, closeParenToken.parent = this; + }; + TypeScript.ParenthesizedTypeSyntax.prototype.kind = function () { + return 132 /* ParenthesizedType */; + }; + TypeScript.InterfaceDeclarationSyntax = function (data, modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.interfaceKeyword = interfaceKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.body = body; + modifiers.parent = this, interfaceKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), heritageClauses.parent = this, body.parent = this; + }; + TypeScript.InterfaceDeclarationSyntax.prototype.kind = function () { + return 133 /* InterfaceDeclaration */; + }; + TypeScript.FunctionDeclarationSyntax = function (data, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken; + modifiers.parent = this, functionKeyword.parent = this, identifier.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.FunctionDeclarationSyntax.prototype.kind = function () { + return 134 /* FunctionDeclaration */; + }; + TypeScript.ModuleDeclarationSyntax = function (data, modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.moduleKeyword = moduleKeyword, this.name = name, this.stringLiteral = stringLiteral, this.openBraceToken = openBraceToken, this.moduleElements = moduleElements, this.closeBraceToken = closeBraceToken; + modifiers.parent = this, moduleKeyword.parent = this, name && (name.parent = this), stringLiteral && (stringLiteral.parent = this), openBraceToken.parent = this, moduleElements.parent = this, closeBraceToken.parent = this; + }; + TypeScript.ModuleDeclarationSyntax.prototype.kind = function () { + return 135 /* ModuleDeclaration */; + }; + TypeScript.ClassDeclarationSyntax = function (data, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.classKeyword = classKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.openBraceToken = openBraceToken, this.classElements = classElements, this.closeBraceToken = closeBraceToken; + modifiers.parent = this, classKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), heritageClauses.parent = this, openBraceToken.parent = this, classElements.parent = this, closeBraceToken.parent = this; + }; + TypeScript.ClassDeclarationSyntax.prototype.kind = function () { + return 136 /* ClassDeclaration */; + }; + TypeScript.EnumDeclarationSyntax = function (data, modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.enumKeyword = enumKeyword, this.identifier = identifier, this.openBraceToken = openBraceToken, this.enumElements = enumElements, this.closeBraceToken = closeBraceToken; + modifiers.parent = this, enumKeyword.parent = this, identifier.parent = this, openBraceToken.parent = this, enumElements.parent = this, closeBraceToken.parent = this; + }; + TypeScript.EnumDeclarationSyntax.prototype.kind = function () { + return 137 /* EnumDeclaration */; + }; + TypeScript.ImportDeclarationSyntax = function (data, modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.importKeyword = importKeyword, this.identifier = identifier, this.equalsToken = equalsToken, this.moduleReference = moduleReference, this.semicolonToken = semicolonToken; + modifiers.parent = this, importKeyword.parent = this, identifier.parent = this, equalsToken.parent = this, moduleReference.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ImportDeclarationSyntax.prototype.kind = function () { + return 138 /* ImportDeclaration */; + }; + TypeScript.ExportAssignmentSyntax = function (data, exportKeyword, equalsToken, identifier, semicolonToken) { + if (data) { + this.__data = data; + } + this.exportKeyword = exportKeyword, this.equalsToken = equalsToken, this.identifier = identifier, this.semicolonToken = semicolonToken; + exportKeyword.parent = this, equalsToken.parent = this, identifier.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ExportAssignmentSyntax.prototype.kind = function () { + return 139 /* ExportAssignment */; + }; + TypeScript.MemberFunctionDeclarationSyntax = function (data, modifiers, propertyName, callSignature, block, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken; + modifiers.parent = this, propertyName.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.MemberFunctionDeclarationSyntax.prototype.kind = function () { + return 140 /* MemberFunctionDeclaration */; + }; + TypeScript.MemberVariableDeclarationSyntax = function (data, modifiers, variableDeclarator, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken; + modifiers.parent = this, variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.MemberVariableDeclarationSyntax.prototype.kind = function () { + return 141 /* MemberVariableDeclaration */; + }; + TypeScript.ConstructorDeclarationSyntax = function (data, modifiers, constructorKeyword, callSignature, block, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken; + modifiers.parent = this, constructorKeyword.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ConstructorDeclarationSyntax.prototype.kind = function () { + return 142 /* ConstructorDeclaration */; + }; + TypeScript.IndexMemberDeclarationSyntax = function (data, modifiers, indexSignature, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken; + modifiers.parent = this, indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.IndexMemberDeclarationSyntax.prototype.kind = function () { + return 143 /* IndexMemberDeclaration */; + }; + TypeScript.GetAccessorSyntax = function (data, modifiers, getKeyword, propertyName, callSignature, block) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; + modifiers.parent = this, getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; + }; + TypeScript.GetAccessorSyntax.prototype.kind = function () { + return 144 /* GetAccessor */; + }; + TypeScript.SetAccessorSyntax = function (data, modifiers, setKeyword, propertyName, callSignature, block) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; + modifiers.parent = this, setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; + }; + TypeScript.SetAccessorSyntax.prototype.kind = function () { + return 145 /* SetAccessor */; + }; + TypeScript.PropertySignatureSyntax = function (data, propertyName, questionToken, typeAnnotation) { + if (data) { + this.__data = data; + } + this.propertyName = propertyName, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation; + propertyName.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this); + }; + TypeScript.PropertySignatureSyntax.prototype.kind = function () { + return 146 /* PropertySignature */; + }; + TypeScript.CallSignatureSyntax = function (data, typeParameterList, parameterList, typeAnnotation) { + if (data) { + this.__data = data; + } + this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.typeAnnotation = typeAnnotation; + typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, typeAnnotation && (typeAnnotation.parent = this); + }; + TypeScript.CallSignatureSyntax.prototype.kind = function () { + return 147 /* CallSignature */; + }; + TypeScript.ConstructSignatureSyntax = function (data, newKeyword, callSignature) { + if (data) { + this.__data = data; + } + this.newKeyword = newKeyword, this.callSignature = callSignature; + newKeyword.parent = this, callSignature.parent = this; + }; + TypeScript.ConstructSignatureSyntax.prototype.kind = function () { + return 148 /* ConstructSignature */; + }; + TypeScript.IndexSignatureSyntax = function (data, openBracketToken, parameters, closeBracketToken, typeAnnotation) { + if (data) { + this.__data = data; + } + this.openBracketToken = openBracketToken, this.parameters = parameters, this.closeBracketToken = closeBracketToken, this.typeAnnotation = typeAnnotation; + openBracketToken.parent = this, parameters.parent = this, closeBracketToken.parent = this, typeAnnotation && (typeAnnotation.parent = this); + }; + TypeScript.IndexSignatureSyntax.prototype.kind = function () { + return 149 /* IndexSignature */; + }; + TypeScript.MethodSignatureSyntax = function (data, propertyName, questionToken, callSignature) { + if (data) { + this.__data = data; + } + this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature; + propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; + }; + TypeScript.MethodSignatureSyntax.prototype.kind = function () { + return 150 /* MethodSignature */; + }; + TypeScript.BlockSyntax = function (data, openBraceToken, statements, closeBraceToken) { + if (data) { + this.__data = data; + } + this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken; + openBraceToken.parent = this, statements.parent = this, closeBraceToken.parent = this; + }; + TypeScript.BlockSyntax.prototype.kind = function () { + return 151 /* Block */; + }; + TypeScript.IfStatementSyntax = function (data, ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { + if (data) { + this.__data = data; + } + this.ifKeyword = ifKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, this.elseClause = elseClause; + ifKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this, elseClause && (elseClause.parent = this); + }; + TypeScript.IfStatementSyntax.prototype.kind = function () { + return 152 /* IfStatement */; + }; + TypeScript.VariableStatementSyntax = function (data, modifiers, variableDeclaration, semicolonToken) { + if (data) { + this.__data = data; + } + this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken; + modifiers.parent = this, variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.VariableStatementSyntax.prototype.kind = function () { + return 153 /* VariableStatement */; + }; + TypeScript.ExpressionStatementSyntax = function (data, expression, semicolonToken) { + if (data) { + this.__data = data; + } + this.expression = expression, this.semicolonToken = semicolonToken; + expression.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ExpressionStatementSyntax.prototype.kind = function () { + return 154 /* ExpressionStatement */; + }; + TypeScript.ReturnStatementSyntax = function (data, returnKeyword, expression, semicolonToken) { + if (data) { + this.__data = data; + } + this.returnKeyword = returnKeyword, this.expression = expression, this.semicolonToken = semicolonToken; + returnKeyword.parent = this, expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ReturnStatementSyntax.prototype.kind = function () { + return 155 /* ReturnStatement */; + }; + TypeScript.SwitchStatementSyntax = function (data, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { + if (data) { + this.__data = data; + } + this.switchKeyword = switchKeyword, this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, this.openBraceToken = openBraceToken, this.switchClauses = switchClauses, this.closeBraceToken = closeBraceToken; + switchKeyword.parent = this, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this, openBraceToken.parent = this, switchClauses.parent = this, closeBraceToken.parent = this; + }; + TypeScript.SwitchStatementSyntax.prototype.kind = function () { + return 156 /* SwitchStatement */; + }; + TypeScript.BreakStatementSyntax = function (data, breakKeyword, identifier, semicolonToken) { + if (data) { + this.__data = data; + } + this.breakKeyword = breakKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken; + breakKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.BreakStatementSyntax.prototype.kind = function () { + return 157 /* BreakStatement */; + }; + TypeScript.ContinueStatementSyntax = function (data, continueKeyword, identifier, semicolonToken) { + if (data) { + this.__data = data; + } + this.continueKeyword = continueKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken; + continueKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ContinueStatementSyntax.prototype.kind = function () { + return 158 /* ContinueStatement */; + }; + TypeScript.ForStatementSyntax = function (data, forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { + if (data) { + this.__data = data; + } + this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.initializer = initializer, this.firstSemicolonToken = firstSemicolonToken, this.condition = condition, this.secondSemicolonToken = secondSemicolonToken, this.incrementor = incrementor, this.closeParenToken = closeParenToken, this.statement = statement; + forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), initializer && (initializer.parent = this), firstSemicolonToken.parent = this, condition && (condition.parent = this), secondSemicolonToken.parent = this, incrementor && (incrementor.parent = this), closeParenToken.parent = this, statement.parent = this; + }; + TypeScript.ForStatementSyntax.prototype.kind = function () { + return 159 /* ForStatement */; + }; + TypeScript.ForInStatementSyntax = function (data, forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { + if (data) { + this.__data = data; + } + this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.left = left, this.inKeyword = inKeyword, this.expression = expression, this.closeParenToken = closeParenToken, this.statement = statement; + forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), left && (left.parent = this), inKeyword.parent = this, expression.parent = this, closeParenToken.parent = this, statement.parent = this; + }; + TypeScript.ForInStatementSyntax.prototype.kind = function () { + return 160 /* ForInStatement */; + }; + TypeScript.EmptyStatementSyntax = function (data, semicolonToken) { + if (data) { + this.__data = data; + } + this.semicolonToken = semicolonToken; + semicolonToken.parent = this; + }; + TypeScript.EmptyStatementSyntax.prototype.kind = function () { + return 161 /* EmptyStatement */; + }; + TypeScript.ThrowStatementSyntax = function (data, throwKeyword, expression, semicolonToken) { + if (data) { + this.__data = data; + } + this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken; + throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.ThrowStatementSyntax.prototype.kind = function () { + return 162 /* ThrowStatement */; + }; + TypeScript.WhileStatementSyntax = function (data, whileKeyword, openParenToken, condition, closeParenToken, statement) { + if (data) { + this.__data = data; + } + this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement; + whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; + }; + TypeScript.WhileStatementSyntax.prototype.kind = function () { + return 163 /* WhileStatement */; + }; + TypeScript.TryStatementSyntax = function (data, tryKeyword, block, catchClause, finallyClause) { + if (data) { + this.__data = data; + } + this.tryKeyword = tryKeyword, this.block = block, this.catchClause = catchClause, this.finallyClause = finallyClause; + tryKeyword.parent = this, block.parent = this, catchClause && (catchClause.parent = this), finallyClause && (finallyClause.parent = this); + }; + TypeScript.TryStatementSyntax.prototype.kind = function () { + return 164 /* TryStatement */; + }; + TypeScript.LabeledStatementSyntax = function (data, identifier, colonToken, statement) { + if (data) { + this.__data = data; + } + this.identifier = identifier, this.colonToken = colonToken, this.statement = statement; + identifier.parent = this, colonToken.parent = this, statement.parent = this; + }; + TypeScript.LabeledStatementSyntax.prototype.kind = function () { + return 165 /* LabeledStatement */; + }; + TypeScript.DoStatementSyntax = function (data, doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { + if (data) { + this.__data = data; + } + this.doKeyword = doKeyword, this.statement = statement, this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.semicolonToken = semicolonToken; + doKeyword.parent = this, statement.parent = this, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.DoStatementSyntax.prototype.kind = function () { + return 166 /* DoStatement */; + }; + TypeScript.DebuggerStatementSyntax = function (data, debuggerKeyword, semicolonToken) { + if (data) { + this.__data = data; + } + this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken; + debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); + }; + TypeScript.DebuggerStatementSyntax.prototype.kind = function () { + return 167 /* DebuggerStatement */; + }; + TypeScript.WithStatementSyntax = function (data, withKeyword, openParenToken, condition, closeParenToken, statement) { + if (data) { + this.__data = data; + } + this.withKeyword = withKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement; + withKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; + }; + TypeScript.WithStatementSyntax.prototype.kind = function () { + return 168 /* WithStatement */; + }; + TypeScript.PrefixUnaryExpressionSyntax = function (data, operatorToken, operand) { + if (data) { + this.__data = data; + } + this.operatorToken = operatorToken, this.operand = operand; + operatorToken.parent = this, operand.parent = this; + }; + TypeScript.PrefixUnaryExpressionSyntax.prototype.kind = function () { + return 169 /* PrefixUnaryExpression */; + }; + TypeScript.DeleteExpressionSyntax = function (data, deleteKeyword, expression) { + if (data) { + this.__data = data; + } + this.deleteKeyword = deleteKeyword, this.expression = expression; + deleteKeyword.parent = this, expression.parent = this; + }; + TypeScript.DeleteExpressionSyntax.prototype.kind = function () { + return 170 /* DeleteExpression */; + }; + TypeScript.TypeOfExpressionSyntax = function (data, typeOfKeyword, expression) { + if (data) { + this.__data = data; + } + this.typeOfKeyword = typeOfKeyword, this.expression = expression; + typeOfKeyword.parent = this, expression.parent = this; + }; + TypeScript.TypeOfExpressionSyntax.prototype.kind = function () { + return 171 /* TypeOfExpression */; + }; + TypeScript.VoidExpressionSyntax = function (data, voidKeyword, expression) { + if (data) { + this.__data = data; + } + this.voidKeyword = voidKeyword, this.expression = expression; + voidKeyword.parent = this, expression.parent = this; + }; + TypeScript.VoidExpressionSyntax.prototype.kind = function () { + return 172 /* VoidExpression */; + }; + TypeScript.ConditionalExpressionSyntax = function (data, condition, questionToken, whenTrue, colonToken, whenFalse) { + if (data) { + this.__data = data; + } + this.condition = condition, this.questionToken = questionToken, this.whenTrue = whenTrue, this.colonToken = colonToken, this.whenFalse = whenFalse; + condition.parent = this, questionToken.parent = this, whenTrue.parent = this, colonToken.parent = this, whenFalse.parent = this; + }; + TypeScript.ConditionalExpressionSyntax.prototype.kind = function () { + return 173 /* ConditionalExpression */; + }; + TypeScript.BinaryExpressionSyntax = function (data, left, operatorToken, right) { + if (data) { + this.__data = data; + } + this.left = left, this.operatorToken = operatorToken, this.right = right; + left.parent = this, operatorToken.parent = this, right.parent = this; + }; + TypeScript.BinaryExpressionSyntax.prototype.kind = function () { + return 174 /* BinaryExpression */; + }; + TypeScript.PostfixUnaryExpressionSyntax = function (data, operand, operatorToken) { + if (data) { + this.__data = data; + } + this.operand = operand, this.operatorToken = operatorToken; + operand.parent = this, operatorToken.parent = this; + }; + TypeScript.PostfixUnaryExpressionSyntax.prototype.kind = function () { + return 175 /* PostfixUnaryExpression */; + }; + TypeScript.MemberAccessExpressionSyntax = function (data, expression, dotToken, name) { + if (data) { + this.__data = data; + } + this.expression = expression, this.dotToken = dotToken, this.name = name; + expression.parent = this, dotToken.parent = this, name.parent = this; + }; + TypeScript.MemberAccessExpressionSyntax.prototype.kind = function () { + return 176 /* MemberAccessExpression */; + }; + TypeScript.InvocationExpressionSyntax = function (data, expression, argumentList) { + if (data) { + this.__data = data; + } + this.expression = expression, this.argumentList = argumentList; + expression.parent = this, argumentList.parent = this; + }; + TypeScript.InvocationExpressionSyntax.prototype.kind = function () { + return 177 /* InvocationExpression */; + }; + TypeScript.ArrayLiteralExpressionSyntax = function (data, openBracketToken, expressions, closeBracketToken) { + if (data) { + this.__data = data; + } + this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken; + openBracketToken.parent = this, expressions.parent = this, closeBracketToken.parent = this; + }; + TypeScript.ArrayLiteralExpressionSyntax.prototype.kind = function () { + return 178 /* ArrayLiteralExpression */; + }; + TypeScript.ObjectLiteralExpressionSyntax = function (data, openBraceToken, propertyAssignments, closeBraceToken) { + if (data) { + this.__data = data; + } + this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken; + openBraceToken.parent = this, propertyAssignments.parent = this, closeBraceToken.parent = this; + }; + TypeScript.ObjectLiteralExpressionSyntax.prototype.kind = function () { + return 179 /* ObjectLiteralExpression */; + }; + TypeScript.ObjectCreationExpressionSyntax = function (data, newKeyword, expression, argumentList) { + if (data) { + this.__data = data; + } + this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList; + newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); + }; + TypeScript.ObjectCreationExpressionSyntax.prototype.kind = function () { + return 180 /* ObjectCreationExpression */; + }; + TypeScript.ParenthesizedExpressionSyntax = function (data, openParenToken, expression, closeParenToken) { + if (data) { + this.__data = data; + } + this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken; + openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; + }; + TypeScript.ParenthesizedExpressionSyntax.prototype.kind = function () { + return 181 /* ParenthesizedExpression */; + }; + TypeScript.ParenthesizedArrowFunctionExpressionSyntax = function (data, callSignature, equalsGreaterThanToken, block, expression) { + if (data) { + this.__data = data; + } + this.callSignature = callSignature, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression; + callSignature.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); + }; + TypeScript.ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = function () { + return 182 /* ParenthesizedArrowFunctionExpression */; + }; + TypeScript.SimpleArrowFunctionExpressionSyntax = function (data, parameter, equalsGreaterThanToken, block, expression) { + if (data) { + this.__data = data; + } + this.parameter = parameter, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression; + parameter.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); + }; + TypeScript.SimpleArrowFunctionExpressionSyntax.prototype.kind = function () { + return 183 /* SimpleArrowFunctionExpression */; + }; + TypeScript.CastExpressionSyntax = function (data, lessThanToken, type, greaterThanToken, expression) { + if (data) { + this.__data = data; + } + this.lessThanToken = lessThanToken, this.type = type, this.greaterThanToken = greaterThanToken, this.expression = expression; + lessThanToken.parent = this, type.parent = this, greaterThanToken.parent = this, expression.parent = this; + }; + TypeScript.CastExpressionSyntax.prototype.kind = function () { + return 184 /* CastExpression */; + }; + TypeScript.ElementAccessExpressionSyntax = function (data, expression, openBracketToken, argumentExpression, closeBracketToken) { + if (data) { + this.__data = data; + } + this.expression = expression, this.openBracketToken = openBracketToken, this.argumentExpression = argumentExpression, this.closeBracketToken = closeBracketToken; + expression.parent = this, openBracketToken.parent = this, argumentExpression.parent = this, closeBracketToken.parent = this; + }; + TypeScript.ElementAccessExpressionSyntax.prototype.kind = function () { + return 185 /* ElementAccessExpression */; + }; + TypeScript.FunctionExpressionSyntax = function (data, functionKeyword, identifier, callSignature, block) { + if (data) { + this.__data = data; + } + this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block; + functionKeyword.parent = this, identifier && (identifier.parent = this), callSignature.parent = this, block.parent = this; + }; + TypeScript.FunctionExpressionSyntax.prototype.kind = function () { + return 186 /* FunctionExpression */; + }; + TypeScript.OmittedExpressionSyntax = function (data) { + if (data) { + this.__data = data; + } + }; + TypeScript.OmittedExpressionSyntax.prototype.kind = function () { + return 187 /* OmittedExpression */; + }; + TypeScript.TemplateExpressionSyntax = function (data, templateStartToken, templateClauses) { + if (data) { + this.__data = data; + } + this.templateStartToken = templateStartToken, this.templateClauses = templateClauses; + templateStartToken.parent = this, templateClauses.parent = this; + }; + TypeScript.TemplateExpressionSyntax.prototype.kind = function () { + return 188 /* TemplateExpression */; + }; + TypeScript.TemplateAccessExpressionSyntax = function (data, expression, templateExpression) { + if (data) { + this.__data = data; + } + this.expression = expression, this.templateExpression = templateExpression; + expression.parent = this, templateExpression.parent = this; + }; + TypeScript.TemplateAccessExpressionSyntax.prototype.kind = function () { + return 189 /* TemplateAccessExpression */; + }; + TypeScript.VariableDeclarationSyntax = function (data, varKeyword, variableDeclarators) { + if (data) { + this.__data = data; + } + this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators; + varKeyword.parent = this, variableDeclarators.parent = this; + }; + TypeScript.VariableDeclarationSyntax.prototype.kind = function () { + return 190 /* VariableDeclaration */; + }; + TypeScript.VariableDeclaratorSyntax = function (data, propertyName, typeAnnotation, equalsValueClause) { + if (data) { + this.__data = data; + } + this.propertyName = propertyName, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause; + propertyName.parent = this, typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); + }; + TypeScript.VariableDeclaratorSyntax.prototype.kind = function () { + return 191 /* VariableDeclarator */; + }; + TypeScript.ArgumentListSyntax = function (data, typeArgumentList, openParenToken, _arguments, closeParenToken) { + if (data) { + this.__data = data; + } + this.typeArgumentList = typeArgumentList, this.openParenToken = openParenToken, this.arguments = _arguments, this.closeParenToken = closeParenToken; + typeArgumentList && (typeArgumentList.parent = this), openParenToken.parent = this, _arguments.parent = this, closeParenToken.parent = this; + }; + TypeScript.ArgumentListSyntax.prototype.kind = function () { + return 192 /* ArgumentList */; + }; + TypeScript.ParameterListSyntax = function (data, openParenToken, parameters, closeParenToken) { + if (data) { + this.__data = data; + } + this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken; + openParenToken.parent = this, parameters.parent = this, closeParenToken.parent = this; + }; + TypeScript.ParameterListSyntax.prototype.kind = function () { + return 193 /* ParameterList */; + }; + TypeScript.TypeArgumentListSyntax = function (data, lessThanToken, typeArguments, greaterThanToken) { + if (data) { + this.__data = data; + } + this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken; + lessThanToken.parent = this, typeArguments.parent = this, greaterThanToken.parent = this; + }; + TypeScript.TypeArgumentListSyntax.prototype.kind = function () { + return 194 /* TypeArgumentList */; + }; + TypeScript.TypeParameterListSyntax = function (data, lessThanToken, typeParameters, greaterThanToken) { + if (data) { + this.__data = data; + } + this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken; + lessThanToken.parent = this, typeParameters.parent = this, greaterThanToken.parent = this; + }; + TypeScript.TypeParameterListSyntax.prototype.kind = function () { + return 195 /* TypeParameterList */; + }; + TypeScript.HeritageClauseSyntax = function (data, extendsOrImplementsKeyword, typeNames) { + if (data) { + this.__data = data; + } + this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames; + extendsOrImplementsKeyword.parent = this, typeNames.parent = this; + }; + TypeScript.HeritageClauseSyntax.prototype.kind = function () { + return 196 /* HeritageClause */; + }; + TypeScript.EqualsValueClauseSyntax = function (data, equalsToken, value) { + if (data) { + this.__data = data; + } + this.equalsToken = equalsToken, this.value = value; + equalsToken.parent = this, value.parent = this; + }; + TypeScript.EqualsValueClauseSyntax.prototype.kind = function () { + return 197 /* EqualsValueClause */; + }; + TypeScript.CaseSwitchClauseSyntax = function (data, caseKeyword, expression, colonToken, statements) { + if (data) { + this.__data = data; + } + this.caseKeyword = caseKeyword, this.expression = expression, this.colonToken = colonToken, this.statements = statements; + caseKeyword.parent = this, expression.parent = this, colonToken.parent = this, statements.parent = this; + }; + TypeScript.CaseSwitchClauseSyntax.prototype.kind = function () { + return 198 /* CaseSwitchClause */; + }; + TypeScript.DefaultSwitchClauseSyntax = function (data, defaultKeyword, colonToken, statements) { + if (data) { + this.__data = data; + } + this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements; + defaultKeyword.parent = this, colonToken.parent = this, statements.parent = this; + }; + TypeScript.DefaultSwitchClauseSyntax.prototype.kind = function () { + return 199 /* DefaultSwitchClause */; + }; + TypeScript.ElseClauseSyntax = function (data, elseKeyword, statement) { + if (data) { + this.__data = data; + } + this.elseKeyword = elseKeyword, this.statement = statement; + elseKeyword.parent = this, statement.parent = this; + }; + TypeScript.ElseClauseSyntax.prototype.kind = function () { + return 200 /* ElseClause */; + }; + TypeScript.CatchClauseSyntax = function (data, catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { + if (data) { + this.__data = data; + } + this.catchKeyword = catchKeyword, this.openParenToken = openParenToken, this.identifier = identifier, this.typeAnnotation = typeAnnotation, this.closeParenToken = closeParenToken, this.block = block; + catchKeyword.parent = this, openParenToken.parent = this, identifier.parent = this, typeAnnotation && (typeAnnotation.parent = this), closeParenToken.parent = this, block.parent = this; + }; + TypeScript.CatchClauseSyntax.prototype.kind = function () { + return 201 /* CatchClause */; + }; + TypeScript.FinallyClauseSyntax = function (data, finallyKeyword, block) { + if (data) { + this.__data = data; + } + this.finallyKeyword = finallyKeyword, this.block = block; + finallyKeyword.parent = this, block.parent = this; + }; + TypeScript.FinallyClauseSyntax.prototype.kind = function () { + return 202 /* FinallyClause */; + }; + TypeScript.TemplateClauseSyntax = function (data, expression, templateMiddleOrEndToken) { + if (data) { + this.__data = data; + } + this.expression = expression, this.templateMiddleOrEndToken = templateMiddleOrEndToken; + expression.parent = this, templateMiddleOrEndToken.parent = this; + }; + TypeScript.TemplateClauseSyntax.prototype.kind = function () { + return 203 /* TemplateClause */; + }; + TypeScript.TypeParameterSyntax = function (data, identifier, constraint) { + if (data) { + this.__data = data; + } + this.identifier = identifier, this.constraint = constraint; + identifier.parent = this, constraint && (constraint.parent = this); + }; + TypeScript.TypeParameterSyntax.prototype.kind = function () { + return 204 /* TypeParameter */; + }; + TypeScript.ConstraintSyntax = function (data, extendsKeyword, typeOrExpression) { + if (data) { + this.__data = data; + } + this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression; + extendsKeyword.parent = this, typeOrExpression.parent = this; + }; + TypeScript.ConstraintSyntax.prototype.kind = function () { + return 205 /* Constraint */; + }; + TypeScript.SimplePropertyAssignmentSyntax = function (data, propertyName, colonToken, expression) { + if (data) { + this.__data = data; + } + this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression; + propertyName.parent = this, colonToken.parent = this, expression.parent = this; + }; + TypeScript.SimplePropertyAssignmentSyntax.prototype.kind = function () { + return 206 /* SimplePropertyAssignment */; + }; + TypeScript.FunctionPropertyAssignmentSyntax = function (data, propertyName, callSignature, block) { + if (data) { + this.__data = data; + } + this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; + propertyName.parent = this, callSignature.parent = this, block.parent = this; + }; + TypeScript.FunctionPropertyAssignmentSyntax.prototype.kind = function () { + return 207 /* FunctionPropertyAssignment */; + }; + TypeScript.ParameterSyntax = function (data, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { + if (data) { + this.__data = data; + } + this.dotDotDotToken = dotDotDotToken, this.modifiers = modifiers, this.identifier = identifier, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause; + dotDotDotToken && (dotDotDotToken.parent = this), modifiers.parent = this, identifier.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); + }; + TypeScript.ParameterSyntax.prototype.kind = function () { + return 208 /* Parameter */; + }; + TypeScript.EnumElementSyntax = function (data, propertyName, equalsValueClause) { + if (data) { + this.__data = data; + } + this.propertyName = propertyName, this.equalsValueClause = equalsValueClause; + propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); + }; + TypeScript.EnumElementSyntax.prototype.kind = function () { + return 209 /* EnumElement */; + }; + TypeScript.TypeAnnotationSyntax = function (data, colonToken, type) { + if (data) { + this.__data = data; + } + this.colonToken = colonToken, this.type = type; + colonToken.parent = this, type.parent = this; + }; + TypeScript.TypeAnnotationSyntax.prototype.kind = function () { + return 210 /* TypeAnnotation */; + }; + TypeScript.ExternalModuleReferenceSyntax = function (data, requireKeyword, openParenToken, stringLiteral, closeParenToken) { + if (data) { + this.__data = data; + } + this.requireKeyword = requireKeyword, this.openParenToken = openParenToken, this.stringLiteral = stringLiteral, this.closeParenToken = closeParenToken; + requireKeyword.parent = this, openParenToken.parent = this, stringLiteral.parent = this, closeParenToken.parent = this; + }; + TypeScript.ExternalModuleReferenceSyntax.prototype.kind = function () { + return 211 /* ExternalModuleReference */; + }; + TypeScript.ModuleNameModuleReferenceSyntax = function (data, moduleName) { + if (data) { + this.__data = data; + } + this.moduleName = moduleName; + moduleName.parent = this; + }; + TypeScript.ModuleNameModuleReferenceSyntax.prototype.kind = function () { + return 212 /* ModuleNameModuleReference */; + }; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { TypeScript.syntaxDiagnosticsTime = 0; var SyntaxTree = (function () { - function SyntaxTree(isConcrete, sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { + function SyntaxTree(sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { this.text = text; - this._allDiagnostics = null; - this._isConcrete = isConcrete; + this._allDiagnostics = undefined; this._sourceUnit = sourceUnit; this._isDeclaration = isDeclaration; this._parserDiagnostics = diagnostics; @@ -25699,9 +26442,6 @@ var TypeScript; this._languageVersion = languageVersion; sourceUnit.syntaxTree = this; } - SyntaxTree.prototype.isConcrete = function () { - return this._isConcrete; - }; SyntaxTree.prototype.sourceUnit = function () { return this._sourceUnit; }; @@ -25717,7 +26457,7 @@ var TypeScript; return diagnostics; }; SyntaxTree.prototype.diagnostics = function () { - if (this._allDiagnostics === null) { + if (!this._allDiagnostics) { var start = new Date().getTime(); this._allDiagnostics = this.computeDiagnostics(); TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; @@ -25736,7 +26476,7 @@ var TypeScript; SyntaxTree.prototype.cacheSyntaxTreeInfo = function () { var firstToken = firstSyntaxTreeToken(this); var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = externalModuleIndicatorSpanWorker(this, firstToken) !== null; + this._isExternalModule = !!externalModuleIndicatorSpanWorker(this, firstToken); var amdDependencies = []; for (var i = 0, n = leadingTrivia.count(); i < n; i++) { var trivia = leadingTrivia.syntaxTriviaAt(i); @@ -25752,7 +26492,7 @@ var TypeScript; SyntaxTree.prototype.getAmdDependency = function (comment) { var amdDependencyRegEx = /^\/\/\/\s* 0) { return false; } @@ -25890,7 +26629,7 @@ var TypeScript; _super.prototype.visitParameterList.call(this, node); }; GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node, node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { + if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { return; } _super.prototype.visitHeritageClause.call(this, node); @@ -25902,25 +26641,25 @@ var TypeScript; _super.prototype.visitArgumentList.call(this, node); }; GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForAtLeastOneElement(node, node.variableDeclarators, node.varKeyword, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.variable_declaration, null)) || this.checkForTrailingComma(node.variableDeclarators)) { + if (this.checkForAtLeastOneElement(node.variableDeclarators, node.varKeyword, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.variable_declaration, undefined)) || this.checkForTrailingComma(node.variableDeclarators)) { return; } _super.prototype.visitVariableDeclaration.call(this, node); }; GrammarCheckerWalker.prototype.visitTypeArgumentList = function (node) { - if (this.checkForTrailingComma(node.typeArguments) || this.checkForAtLeastOneElement(node, node.typeArguments, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_argument, null))) { + if (this.checkForTrailingComma(node.typeArguments) || this.checkForAtLeastOneElement(node.typeArguments, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_argument, undefined))) { return; } _super.prototype.visitTypeArgumentList.call(this, node); }; GrammarCheckerWalker.prototype.visitTupleType = function (node) { - if (this.checkForTrailingComma(node.types) || this.checkForAtLeastOneElement(node, node.types, node.openBracketToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null))) { + if (this.checkForTrailingComma(node.types) || this.checkForAtLeastOneElement(node.types, node.openBracketToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, undefined))) { return; } _super.prototype.visitTupleType.call(this, node); }; GrammarCheckerWalker.prototype.visitTypeParameterList = function (node) { - if (this.checkForTrailingComma(node.typeParameters) || this.checkForAtLeastOneElement(node, node.typeParameters, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null))) { + if (this.checkForTrailingComma(node.typeParameters) || this.checkForAtLeastOneElement(node.typeParameters, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, undefined))) { return; } _super.prototype.visitTypeParameterList.call(this, node); @@ -25930,7 +26669,7 @@ var TypeScript; this.pushDiagnostic(node.openBracketToken, TypeScript.DiagnosticCode.Index_signature_must_have_exactly_one_parameter); return true; } - var parameter = node.parameters[0]; + var parameter = TypeScript.nonSeparatorAt(node.parameters, 0); if (parameter.dotDotDotToken) { this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); return true; @@ -25951,7 +26690,7 @@ var TypeScript; this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); return true; } - else if (parameter.typeAnnotation.type.kind() !== 69 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 67 /* NumberKeyword */) { + else if (parameter.typeAnnotation.type.kind() !== 71 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 69 /* NumberKeyword */) { this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); return true; } @@ -25973,7 +26712,7 @@ var TypeScript; for (var i = 0, n = node.heritageClauses.length; i < n; i++) { TypeScript.Debug.assert(i <= 2); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */) { + if (heritageClause.extendsOrImplementsKeyword.kind() === 50 /* ExtendsKeyword */) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); return true; @@ -25982,14 +26721,14 @@ var TypeScript; this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); return true; } - if (heritageClause.typeNames.length > 1) { + if (TypeScript.nonSeparatorCount(heritageClause.typeNames) > 1) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Classes_can_only_extend_a_single_class); return true; } seenExtendsClause = true; } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); + TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 53 /* ImplementsKeyword */); if (seenImplementsClause) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); return true; @@ -26001,7 +26740,7 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); + var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 65 /* DeclareKeyword */); if (declareToken) { this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); return true; @@ -26011,7 +26750,7 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, reportToken, modifiers) { if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { + if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 65 /* DeclareKeyword */)) { this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); return true; } @@ -26022,7 +26761,7 @@ var TypeScript; return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitClassDeclaration.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; @@ -26031,7 +26770,7 @@ var TypeScript; for (var i = 0, n = node.heritageClauses.length; i < n; i++) { TypeScript.Debug.assert(i <= 1); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */) { + if (heritageClause.extendsOrImplementsKeyword.kind() === 50 /* ExtendsKeyword */) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); return true; @@ -26039,7 +26778,7 @@ var TypeScript; seenExtendsClause = true; } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); + TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 53 /* ImplementsKeyword */); this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); return true; } @@ -26049,7 +26788,7 @@ var TypeScript; GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (modifier.kind() === 63 /* DeclareKeyword */) { + if (modifier.kind() === 65 /* DeclareKeyword */) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); return true; } @@ -26079,7 +26818,7 @@ var TypeScript; } seenAccessibilityModifier = true; } - else if (modifier.kind() === 58 /* StaticKeyword */) { + else if (modifier.kind() === 60 /* StaticKeyword */) { if (seenStaticModifier) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return true; @@ -26099,8 +26838,20 @@ var TypeScript; } _super.prototype.visitMemberVariableDeclaration.call(this, node); }; + GrammarCheckerWalker.prototype.visitMethodSignature = function (node) { + if (this.checkForTemplatePropertyName(node.propertyName)) { + return; + } + _super.prototype.visitMethodSignature.call(this, node); + }; + GrammarCheckerWalker.prototype.visitPropertySignature = function (node) { + if (this.checkForTemplatePropertyName(node.propertyName)) { + return; + } + _super.prototype.visitPropertySignature.call(this, node); + }; GrammarCheckerWalker.prototype.visitMemberFunctionDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { + if (this.checkClassElementModifiers(node.modifiers) || this.checkForTemplatePropertyName(node.propertyName)) { return; } _super.prototype.visitMemberFunctionDeclaration.call(this, node); @@ -26120,12 +26871,12 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { if (node.modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(node.modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(node.modifiers[0], TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); return true; } return false; }; - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (parent, reportToken, languageVersion, diagnosticKey) { + GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (reportToken, languageVersion, diagnosticKey) { if (this.syntaxTree.languageVersion() < languageVersion) { this.pushDiagnostic(reportToken, diagnosticKey); return true; @@ -26139,7 +26890,7 @@ var TypeScript; this.inObjectLiteralExpression = savedInObjectLiteralExpression; }; GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(node)) { + if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(node) || this.checkForTemplatePropertyName(node.propertyName)) { return; } _super.prototype.visitGetAccessor.call(this, node); @@ -26152,7 +26903,7 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.checkForDisallowedAccessorTypeParameters = function (callSignature) { - if (callSignature.typeParameterList !== null) { + if (callSignature.typeParameterList) { this.pushDiagnostic(callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); return true; } @@ -26167,11 +26918,11 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node) { var parameters = node.callSignature.parameterList.parameters; - if (TypeScript.childCount(parameters) !== 1) { + if (TypeScript.nonSeparatorCount(parameters) !== 1) { this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.set_accessor_must_have_exactly_one_parameter); return true; } - var parameter = parameters[0]; + var parameter = TypeScript.nonSeparatorAt(parameters, 0); if (parameter.questionToken) { this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); return true; @@ -26186,8 +26937,14 @@ var TypeScript; } return false; }; + GrammarCheckerWalker.prototype.visitSimplePropertyAssignment = function (node) { + if (this.checkForTemplatePropertyName(node.propertyName)) { + return; + } + _super.prototype.visitSimplePropertyAssignment.call(this, node); + }; GrammarCheckerWalker.prototype.visitSetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(node)) { + if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(node) || this.checkForTemplatePropertyName(node.propertyName)) { return; } _super.prototype.visitSetAccessor.call(this, node); @@ -26197,29 +26954,29 @@ var TypeScript; return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitEnumDeclaration.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; GrammarCheckerWalker.prototype.checkEnumElements = function (node) { var previousValueWasComputed = false; - for (var i = 0, n = TypeScript.childCount(node.enumElements); i < n; i++) { - var child = TypeScript.childAt(node.enumElements, i); - if (i % 2 === 0) { - var enumElement = child; - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic(enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer); - return true; - } - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); - } + for (var i = 0, n = TypeScript.nonSeparatorCount(node.enumElements); i < n; i++) { + var enumElement = TypeScript.nonSeparatorAt(node.enumElements, i); + if (!enumElement.equalsValueClause && previousValueWasComputed) { + this.pushDiagnostic(enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer); + return true; + } + if (enumElement.equalsValueClause) { + var value = enumElement.equalsValueClause.value; + previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); } } return false; }; GrammarCheckerWalker.prototype.visitEnumElement = function (node) { + if (this.checkForTemplatePropertyName(node.propertyName)) { + return; + } if (this.inAmbientDeclaration && node.equalsValueClause) { var expression = node.equalsValueClause.value; if (!TypeScript.Syntax.isIntegerLiteral(expression)) { @@ -26230,7 +26987,7 @@ var TypeScript; _super.prototype.visitEnumElement.call(this, node); }; GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 50 /* SuperKeyword */ && node.argumentList.typeArgumentList !== null) { + if (node.expression.kind() === 52 /* SuperKeyword */ && node.argumentList.typeArgumentList) { this.pushDiagnostic(node, TypeScript.DiagnosticCode.super_invocation_cannot_have_type_arguments); } _super.prototype.visitInvocationExpression.call(this, node); @@ -26240,24 +26997,24 @@ var TypeScript; var seenDeclareModifier = false; for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind()) || modifier.kind() === 58 /* StaticKeyword */) { + if (TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind()) || modifier.kind() === 60 /* StaticKeyword */) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); return true; } - if (modifier.kind() === 63 /* DeclareKeyword */) { + if (modifier.kind() === 65 /* DeclareKeyword */) { if (seenDeclareModifier) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); return; } seenDeclareModifier = true; } - else if (modifier.kind() === 47 /* ExportKeyword */) { + else if (modifier.kind() === 49 /* ExportKeyword */) { if (seenExportModifier) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return; } if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(47 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(63 /* DeclareKeyword */)]); + this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(49 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(65 /* DeclareKeyword */)]); return; } seenExportModifier = true; @@ -26269,9 +27026,9 @@ var TypeScript; if (!node.stringLiteral) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === 134 /* ImportDeclaration */) { + if (child.kind() === 138 /* ImportDeclaration */) { var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 246 /* ExternalModuleReference */) { + if (importDeclaration.moduleReference.kind() === 211 /* ExternalModuleReference */) { this.pushDiagnostic(importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } } @@ -26280,7 +27037,7 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); + var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 65 /* DeclareKeyword */); if (declareToken) { this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_import_declaration); return true; @@ -26297,7 +27054,7 @@ var TypeScript; return; } if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { + if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */)) { this.pushDiagnostic(node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); return; } @@ -26306,14 +27063,14 @@ var TypeScript; return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitModuleDeclaration.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; GrammarCheckerWalker.prototype.checkForDisallowedExportAssignment = function (node) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === 135 /* ExportAssignment */) { + if (child.kind() === 139 /* ExportAssignment */) { this.pushDiagnostic(child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); return true; } @@ -26387,7 +27144,7 @@ var TypeScript; }; GrammarCheckerWalker.prototype.inSwitchStatement = function (ast) { while (ast) { - if (ast.kind() === 152 /* SwitchStatement */) { + if (ast.kind() === 156 /* SwitchStatement */) { return true; } if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(ast)) { @@ -26399,10 +27156,10 @@ var TypeScript; }; GrammarCheckerWalker.prototype.isIterationStatement = function (ast) { switch (ast.kind()) { - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: + case 159 /* ForStatement */: + case 160 /* ForInStatement */: + case 163 /* WhileStatement */: + case 166 /* DoStatement */: return true; } return false; @@ -26423,7 +27180,7 @@ var TypeScript; var result = []; element = element.parent; while (element) { - if (element.kind() === 161 /* LabeledStatement */) { + if (element.kind() === 165 /* LabeledStatement */) { var labeledStatement = element; if (breakable) { result.push(labeledStatement); @@ -26443,12 +27200,12 @@ var TypeScript; }; GrammarCheckerWalker.prototype.labelIsOnContinuableConstruct = function (statement) { switch (statement.kind()) { - case 161 /* LabeledStatement */: + case 165 /* LabeledStatement */: return this.labelIsOnContinuableConstruct(statement.statement); - case 159 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 162 /* DoStatement */: + case 163 /* WhileStatement */: + case 159 /* ForStatement */: + case 160 /* ForInStatement */: + case 166 /* DoStatement */: return true; default: return false; @@ -26603,21 +27360,21 @@ var TypeScript; } return false; }; - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (parent, modifiers) { + GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (modifiers) { if (this.inBlock || this.inObjectLiteralExpression) { if (modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(modifiers[0], TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); return true; } } return false; }; GrammarCheckerWalker.prototype.visitFunctionDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { + if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitFunctionDeclaration.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; @@ -26627,26 +27384,32 @@ var TypeScript; } _super.prototype.visitFunctionExpression.call(this, node); }; + GrammarCheckerWalker.prototype.visitFunctionPropertyAssignment = function (node) { + if (this.checkForTemplatePropertyName(node.propertyName)) { + return; + } + _super.prototype.visitFunctionPropertyAssignment.call(this, node); + }; GrammarCheckerWalker.prototype.visitVariableStatement = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { + if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitVariableStatement.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; - GrammarCheckerWalker.prototype.checkListSeparators = function (parent, list, kind) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var child = TypeScript.childAt(list, i); - if (i % 2 === 1 && child.kind() !== kind) { + GrammarCheckerWalker.prototype.checkListSeparators = function (list, kind) { + for (var i = 0, n = TypeScript.separatorCount(list); i < n; i++) { + var child = TypeScript.separatorAt(list, i); + if (child.kind() !== kind) { this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(kind)]); } } return false; }; GrammarCheckerWalker.prototype.visitObjectType = function (node) { - if (this.checkListSeparators(node, node.typeMembers, 78 /* SemicolonToken */)) { + if (this.checkListSeparators(node.typeMembers, 80 /* SemicolonToken */)) { return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; @@ -26673,13 +27436,20 @@ var TypeScript; this.inAmbientDeclaration = savedInAmbientDeclaration; }; GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(node)) { + if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(node) || this.checkForTemplatePropertyName(node.propertyName)) { return; } _super.prototype.visitVariableDeclarator.call(this, node); }; + GrammarCheckerWalker.prototype.checkForTemplatePropertyName = function (token) { + if (token.kind() === 13 /* NoSubstitutionTemplateToken */) { + this.pushDiagnostic(token, TypeScript.DiagnosticCode.Template_literal_cannot_be_used_as_an_element_name); + return true; + } + return false; + }; GrammarCheckerWalker.prototype.checkVariableDeclaratorIdentifier = function (node) { - if (node.parent.kind() !== 137 /* MemberVariableDeclaration */) { + if (node.parent.kind() !== 141 /* MemberVariableDeclaration */) { if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { return true; } @@ -26702,7 +27472,7 @@ var TypeScript; GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { for (var i = 0, n = modifiers.length; i < n; i++) { var child = modifiers[i]; - if (child.kind() !== 57 /* PublicKeyword */) { + if (child.kind() !== 59 /* PublicKeyword */) { this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [TypeScript.SyntaxFacts.getText(child.kind())]); return true; } @@ -26757,15 +27527,15 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.isPreIncrementOrDecrementExpression = function (node) { - switch (node.kind()) { - case 170 /* PreDecrementExpression */: - case 169 /* PreIncrementExpression */: + switch (node.operatorToken.kind()) { + case 96 /* MinusMinusToken */: + case 95 /* PlusPlusToken */: return true; } return false; }; GrammarCheckerWalker.prototype.visitDeleteExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && node.expression.kind() === 11 /* IdentifierName */) { + if (TypeScript.parsedInStrictMode(node) && node.expression.kind() === 9 /* IdentifierName */) { this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); return; } @@ -26779,16 +27549,16 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.getEvalOrArguments = function (expr) { - if (expr.kind() === 11 /* IdentifierName */) { + if (expr.kind() === 9 /* IdentifierName */) { var text = TypeScript.tokenValueText(expr); if (text === "eval" || text === "arguments") { return text; } } - return null; + return undefined; }; GrammarCheckerWalker.prototype.isEvalOrArguments = function (expr) { - return this.getEvalOrArguments(expr) !== null; + return !!this.getEvalOrArguments(expr); }; GrammarCheckerWalker.prototype.visitConstraint = function (node) { if (this.checkConstraintType(node)) { @@ -26830,7 +27600,7 @@ var TypeScript; } } } - return null; + return undefined; } function implicitImportSpanWorker(trivia) { var implicitImportRegEx = /^(\/\/\/\s*/gim; @@ -26838,24 +27608,24 @@ var TypeScript; if (match) { return new TypeScript.TextSpan(trivia.fullStart(), trivia.fullWidth()); } - return null; + return undefined; } function topLevelImportOrExportSpan(node) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var moduleElement = node.moduleElements[i]; var _firstToken = TypeScript.firstToken(moduleElement); - if (_firstToken !== null && _firstToken.kind() === 47 /* ExportKeyword */) { + if (_firstToken && _firstToken.kind() === 49 /* ExportKeyword */) { return new TypeScript.TextSpan(TypeScript.start(_firstToken), TypeScript.width(_firstToken)); } - if (moduleElement.kind() === 134 /* ImportDeclaration */) { + if (moduleElement.kind() === 138 /* ImportDeclaration */) { var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 246 /* ExternalModuleReference */) { + if (importDecl.moduleReference.kind() === 211 /* ExternalModuleReference */) { var literal = importDecl.moduleReference.stringLiteral; return new TypeScript.TextSpan(TypeScript.start(literal), TypeScript.width(literal)); } } } - return null; + return undefined; } })(TypeScript || (TypeScript = {})); var TypeScript; @@ -26889,7 +27659,7 @@ var TypeScript; if (languageVersion === 0 /* ES3 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); } - else if (languageVersion === 1 /* ES5 */) { + else if (languageVersion >= 1 /* ES5 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); } else { @@ -26900,7 +27670,7 @@ var TypeScript; if (languageVersion === 0 /* ES3 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); } - else if (languageVersion === 1 /* ES5 */) { + else if (languageVersion >= 1 /* ES5 */) { return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); } else { @@ -26940,8 +27710,8 @@ var TypeScript; _scannerParserSource = TypeScript.Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); function release() { _scannerParserSource.release(); - _scannerParserSource = null; - _oldSourceUnitCursor = null; + _scannerParserSource = undefined; + _oldSourceUnitCursor = undefined; _outstandingRewindPointCount = 0; } function extendToAffectedRange(changeRange, sourceUnit) { @@ -26977,11 +27747,11 @@ var TypeScript; _changeDelta = rewindPoint.changeDelta; returnSyntaxCursor(_oldSourceUnitCursor); _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - rewindPoint.oldSourceUnitCursor = null; + rewindPoint.oldSourceUnitCursor = undefined; _scannerParserSource.rewind(rewindPoint); } function releaseRewindPoint(rewindPoint) { - if (rewindPoint.oldSourceUnitCursor !== null) { + if (rewindPoint.oldSourceUnitCursor) { returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); } _scannerParserSource.releaseRewindPoint(rewindPoint); @@ -26995,34 +27765,53 @@ var TypeScript; if (isPinned()) { return false; } - if (_changeRange !== null && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { + if (_changeRange && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { return false; } syncCursorToNewTextIfBehind(); return _changeDelta === 0 && !_oldSourceUnitCursor.isFinished(); } function updateTokens(nodeOrToken) { - var position = absolutePosition(); - var tokenWasMoved = isPastChangeRange() && TypeScript.fullStart(nodeOrToken) !== position; - if (tokenWasMoved) { - setTokenFullStartWalker.position = position; - TypeScript.visitNodeOrToken(setTokenFullStartWalker, nodeOrToken); + if (isPastChangeRange()) { + var position = absolutePosition(); + if (TypeScript.isToken(nodeOrToken)) { + nodeOrToken.setFullStart(position); + } + else { + var tokens = getTokens(nodeOrToken); + for (var i = 0, n = tokens.length; i < n; i++) { + var token = tokens[i]; + token.setFullStart(position); + position += token.fullWidth(); + } + } } } + function getTokens(node) { + var tokens = node.__cachedTokens; + if (!tokens) { + tokens = []; + tokenCollectorWalker.tokens = tokens; + TypeScript.visitNodeOrToken(tokenCollectorWalker, node); + node.__cachedTokens = tokens; + tokenCollectorWalker.tokens = undefined; + } + return tokens; + } function currentNode() { if (canReadFromOldSourceUnit()) { var node = tryGetNodeFromOldSourceUnit(); - if (node !== null) { + if (node) { updateTokens(node); return node; } } - return null; + return undefined; } function currentToken() { if (canReadFromOldSourceUnit()) { var token = tryGetTokenFromOldSourceUnit(); - if (token !== null) { + if (token) { updateTokens(token); return token; } @@ -27056,8 +27845,8 @@ var TypeScript; function tryGetNodeFromOldSourceUnit() { while (true) { var node = _oldSourceUnitCursor.currentNode(); - if (node === null) { - return null; + if (node === undefined) { + return undefined; } if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), TypeScript.fullWidth(node))) { var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); @@ -27069,7 +27858,7 @@ var TypeScript; } } function canReuseTokenFromOldSourceUnit(position, token) { - if (token !== null) { + if (token) { if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { if (!token.isIncrementallyUnusable() && !TypeScript.Scanner.isContextualToken(token)) { return true; @@ -27080,12 +27869,12 @@ var TypeScript; } function tryGetTokenFromOldSourceUnit() { var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : null; + return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : undefined; } function peekToken(n) { if (canReadFromOldSourceUnit()) { var token = tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { + if (token) { return token; } } @@ -27104,13 +27893,13 @@ var TypeScript; for (var i = 0; i < n; i++) { var interimToken = _oldSourceUnitCursor.currentToken(); if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; + return undefined; } currentPosition += interimToken.fullWidth(); _oldSourceUnitCursor.moveToNextSibling(); } var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : null; + return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : undefined; } function consumeNode(node) { _oldSourceUnitCursor.moveToNextSibling(); @@ -27129,13 +27918,13 @@ var TypeScript; if (!isPastChangeRange()) { if (absolutePosition() >= _changeRangeNewSpan.end()) { _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - _changeRange = null; + _changeRange = undefined; } } } } function isPastChangeRange() { - return _changeRange === null; + return _changeRange === undefined; } return { text: text, @@ -27168,7 +27957,7 @@ var TypeScript; var cursor = syntaxCursorPoolCount > 0 ? syntaxCursorPool[syntaxCursorPoolCount - 1] : createSyntaxCursor(); if (syntaxCursorPoolCount > 0) { syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = null; + syntaxCursorPool[syntaxCursorPoolCount] = undefined; } return cursor; } @@ -27183,10 +27972,10 @@ var TypeScript; function clean() { for (var i = 0, n = pieces.length; i < n; i++) { var piece = pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } - piece.element = null; + piece.element = undefined; piece.indexInParent = -1; } currentPieceIndex = -1; @@ -27194,7 +27983,7 @@ var TypeScript; function deepCopyFrom(other) { for (var i = 0, n = other.pieces.length; i < n; i++) { var piece = other.pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } pushElement(piece.element, piece.indexInParent); @@ -27205,18 +27994,21 @@ var TypeScript; } function currentNodeOrToken() { if (isFinished()) { - return null; + return undefined; } var result = pieces[currentPieceIndex].element; return result; } function currentNode() { var element = currentNodeOrToken(); - return TypeScript.isNode(element) ? element : null; + return TypeScript.isNode(element) ? element : undefined; + } + function isEmptyList(element) { + return TypeScript.isList(element) && element.length === 0; } function moveToFirstChild() { var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === null) { + if (nodeOrToken === undefined) { return; } if (TypeScript.isToken(nodeOrToken)) { @@ -27224,7 +28016,7 @@ var TypeScript; } for (var i = 0, n = TypeScript.childCount(nodeOrToken); i < n; i++) { var child = TypeScript.childAt(nodeOrToken, i); - if (child !== null && !TypeScript.isShared(child)) { + if (child && !isEmptyList(child)) { pushElement(child, i); moveToFirstChildIfList(); return; @@ -27238,21 +28030,21 @@ var TypeScript; var parent = currentPiece.element.parent; for (var i = currentPiece.indexInParent + 1, n = TypeScript.childCount(parent); i < n; i++) { var sibling = TypeScript.childAt(parent, i); - if (sibling !== null && !TypeScript.isShared(sibling)) { + if (sibling && !isEmptyList(sibling)) { currentPiece.element = sibling; currentPiece.indexInParent = i; moveToFirstChildIfList(); return; } } - currentPiece.element = null; + currentPiece.element = undefined; currentPiece.indexInParent = -1; currentPieceIndex--; } } function moveToFirstChildIfList() { var element = pieces[currentPieceIndex].element; - if (TypeScript.isList(element) || TypeScript.isSeparatedList(element)) { + if (TypeScript.isList(element)) { pushElement(TypeScript.childAt(element, 0), 0); } } @@ -27280,7 +28072,7 @@ var TypeScript; function currentToken() { moveToFirstToken(); var element = currentNodeOrToken(); - return element === null ? null : element; + return element; } return { pieces: pieces, @@ -27296,21 +28088,19 @@ var TypeScript; deepCopyFrom: deepCopyFrom }; } - var SetTokenFullStartWalker = (function (_super) { - __extends(SetTokenFullStartWalker, _super); - function SetTokenFullStartWalker() { + var TokenCollectorWalker = (function (_super) { + __extends(TokenCollectorWalker, _super); + function TokenCollectorWalker() { _super.apply(this, arguments); + this.tokens = []; } - SetTokenFullStartWalker.prototype.visitToken = function (token) { - var position = this.position; - token.setFullStart(position); - this.position = position + token.fullWidth(); + TokenCollectorWalker.prototype.visitToken = function (token) { + this.tokens.push(token); }; - return SetTokenFullStartWalker; + return TokenCollectorWalker; })(TypeScript.SyntaxWalker); - var setTokenFullStartWalker = new SetTokenFullStartWalker(); + var tokenCollectorWalker = new TokenCollectorWalker(); function parse(oldSyntaxTree, textChangeRange, newText) { - TypeScript.Debug.assert(oldSyntaxTree.isConcrete(), "Can only incrementally parse a concrete syntax tree."); if (textChangeRange.isUnchanged()) { return oldSyntaxTree; } @@ -27339,10 +28129,10 @@ var ts; } function autoCollapse(node) { switch (node.kind) { - case 180 /* ModuleBlock */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 189 /* ModuleBlock */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return false; } return true; @@ -27354,11 +28144,11 @@ var ts; return; } switch (n.kind) { - case 150 /* Block */: + case 158 /* Block */: var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); - if (parent.kind === 155 /* DoStatement */ || parent.kind === 158 /* ForInStatement */ || parent.kind === 157 /* ForStatement */ || parent.kind === 154 /* IfStatement */ || parent.kind === 156 /* WhileStatement */ || parent.kind === 162 /* WithStatement */) { + var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); + if (parent.kind === 163 /* DoStatement */ || parent.kind === 166 /* ForInStatement */ || parent.kind === 165 /* ForStatement */ || parent.kind === 162 /* IfStatement */ || parent.kind === 164 /* WhileStatement */ || parent.kind === 170 /* WithStatement */) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); } else { @@ -27371,27 +28161,27 @@ var ts; }); } break; - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 135 /* ObjectLiteral */: - case 163 /* SwitchStatement */: - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 140 /* ObjectLiteral */: + case 171 /* SwitchStatement */: + var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; - case 134 /* ArrayLiteral */: - var openBracket = ts.findChildOfKind(n, 13 /* OpenBracketToken */, sourceFile); - var closeBracket = ts.findChildOfKind(n, 14 /* CloseBracketToken */, sourceFile); + case 139 /* ArrayLiteral */: + var openBracket = ts.findChildOfKind(n, 17 /* OpenBracketToken */, sourceFile); + var closeBracket = ts.findChildOfKind(n, 18 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } @@ -27417,14 +28207,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: do { current = current.parent; - } while (current.kind === 179 /* ModuleDeclaration */); - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: - case 174 /* FunctionDeclaration */: + } while (current.kind === 188 /* ModuleDeclaration */); + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: + case 182 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -27435,10 +28225,10 @@ var ts; var childNodes = []; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; - if (node.kind === 176 /* ClassDeclaration */ || node.kind === 178 /* EnumDeclaration */ || node.kind === 177 /* InterfaceDeclaration */ || node.kind === 179 /* ModuleDeclaration */ || node.kind === 174 /* FunctionDeclaration */) { + if (node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */ || node.kind === 185 /* InterfaceDeclaration */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 182 /* FunctionDeclaration */) { childNodes.push(node); } - else if (node.kind === 151 /* VariableStatement */) { + else if (node.kind === 159 /* VariableStatement */) { childNodes.push.apply(childNodes, node.declarations); } } @@ -27471,17 +28261,17 @@ var ts; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; switch (node.kind) { - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: - case 177 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -27492,12 +28282,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 174 /* FunctionDeclaration */) { - if (functionDeclaration.body && functionDeclaration.body.kind === 175 /* FunctionBlock */) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 174 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 182 /* FunctionDeclaration */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 183 /* FunctionBlock */) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 182 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } - if (functionDeclaration.parent.kind !== 175 /* FunctionBlock */) { + if (functionDeclaration.parent.kind !== 183 /* FunctionBlock */) { return true; } } @@ -27547,32 +28337,37 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 118 /* Parameter */: - if ((node.flags & ts.NodeFlags.Modifier) === 0) { + case 123 /* Parameter */: + if ((node.flags & 243 /* Modifier */) === 0) { return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 120 /* Method */: + case 125 /* Method */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 122 /* GetAccessor */: + case 127 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 123 /* SetAccessor */: + case 128 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 126 /* IndexSignature */: + case 131 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 183 /* EnumMember */: + case 192 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 124 /* CallSignature */: + case 129 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 125 /* ConstructSignature */: + case 130 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 119 /* Property */: + case 124 /* Property */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 173 /* VariableDeclaration */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); - case 121 /* Constructor */: + case 181 /* VariableDeclaration */: + if (node.flags & 4096 /* Const */) { + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.constantElement); + } + else { + return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); + } + case 126 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); } return undefined; @@ -27602,17 +28397,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 184 /* SourceFile */: + case 193 /* SourceFile */: return createSourceFileItem(node); - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return createClassItem(node); - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return createEnumItem(node); - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return createModuleItem(node); - case 174 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -27622,7 +28417,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 179 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -27634,7 +28429,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 175 /* FunctionBlock */) { + if (node.name && node.body && node.body.kind === 183 /* FunctionBlock */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -27653,7 +28448,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 121 /* Constructor */ && member; + return member.kind === 126 /* Constructor */ && member; }); var nodes = constructor ? constructor.parameters.concat(node.members) : node.members; var childItems = getItemsWorker(sortNodes(nodes), createChildItem); @@ -27670,13 +28465,13 @@ var ts; } } function getInnermostModule(node) { - while (node.body.kind === 179 /* ModuleDeclaration */) { + while (node.body.kind === 188 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 184 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); + return node.kind === 193 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -27686,894 +28481,6 @@ var ts; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Breakpoints; - (function (Breakpoints) { - function createBreakpointSpanInfo(parentElement) { - var childElements = []; - for (var _i = 1; _i < arguments.length; _i++) { - childElements[_i - 1] = arguments[_i]; - } - if (!parentElement) { - return null; - } - if (childElements.length == 0) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(parentElement), TypeScript.end(parentElement)); - } - var start; - var end; - for (var i = 0; i < childElements.length; i++) { - var element = childElements[i]; - if (element && !TypeScript.isShared(element)) { - if (start == undefined) { - start = TypeScript.start(element); - } - end = TypeScript.end(element); - } - } - return TypeScript.TextSpan.fromBounds(start, end); - } - function createBreakpointSpanInfoWithLimChar(startElement, limChar) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(startElement), limChar); - } - var BreakpointResolver = (function () { - function BreakpointResolver(posLine, lineMap) { - this.posLine = posLine; - this.lineMap = lineMap; - } - BreakpointResolver.prototype.breakpointSpanOfToken = function (positionedToken) { - switch (positionedToken.kind()) { - case 70 /* OpenBraceToken */: - return this.breakpointSpanOfOpenBrace(positionedToken); - case 71 /* CloseBraceToken */: - return this.breakpointSpanOfCloseBrace(positionedToken); - case 79 /* CommaToken */: - return this.breakpointSpanOfComma(positionedToken); - case 78 /* SemicolonToken */: - case 10 /* EndOfFileToken */: - return this.breakpointSpanIfStartsOnSameLine(TypeScript.previousToken(positionedToken)); - case 73 /* CloseParenToken */: - return this.breakpointSpanOfCloseParen(positionedToken); - case 22 /* DoKeyword */: - var parentElement = positionedToken.parent; - if (parentElement && parentElement.kind() == 162 /* DoStatement */) { - return this.breakpointSpanIfStartsOnSameLine(TypeScript.nextToken(positionedToken)); - } - break; - } - return this.breakpointSpanOfContainingNode(positionedToken); - }; - BreakpointResolver.prototype.breakpointSpanOfOpenBrace = function (openBraceToken) { - var container = TypeScript.Syntax.containingNode(openBraceToken); - if (container) { - var originalContainer = container; - if (container && container.kind() == 147 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 147 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfFirstStatementInBlock(container); - break; - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(container)); - } - else { - return this.breakpointSpanOf(container); - } - case 133 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstEnumElement(container); - } - else { - return this.breakpointSpanOf(container); - } - case 148 /* IfStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 237 /* CatchClause */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(container); - } - case 162 /* DoStatement */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 155 /* ForStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(TypeScript.previousToken(openBraceToken)); - } - case 236 /* ElseClause */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 238 /* FinallyClause */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 152 /* SwitchStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementOfFirstCaseClause(container); - } - else { - return this.breakpointSpanOf(container); - } - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfCloseBrace = function (closeBraceToken) { - var container = TypeScript.Syntax.containingNode(closeBraceToken); - if (container) { - var originalContainer = container; - if (container.kind() == 147 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 147 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfLastStatementInBlock(container); - break; - case 131 /* ModuleDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - var moduleSyntax = container; - if (moduleSyntax.moduleElements && moduleSyntax.moduleElements.length > 0) { - return createBreakpointSpanInfo(closeBraceToken); - } - else { - return null; - } - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 133 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 148 /* IfStatement */: - case 236 /* ElseClause */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfLastStatementInBlock(originalContainer); - case 152 /* SwitchStatement */: - return this.breakpointSpanOfLastStatementOfLastCaseClause(container); - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfComma = function (commaToken) { - var commaParent = commaToken.parent; - if (TypeScript.isSeparatedList(commaParent)) { - var grandParent = commaParent.parent; - if (grandParent) { - switch (grandParent.kind()) { - case 225 /* VariableDeclaration */: - case 133 /* EnumDeclaration */: - case 228 /* ParameterList */: - var index = TypeScript.Syntax.childIndex(commaParent, commaToken); - if (index > 0) { - var child = TypeScript.childAt(commaParent, index - 1); - return this.breakpointSpanOf(child); - } - if (grandParent.kind() == 133 /* EnumDeclaration */) { - return null; - } - break; - } - } - } - return this.breakpointSpanOfContainingNode(commaToken); - }; - BreakpointResolver.prototype.breakpointSpanOfCloseParen = function (closeParenToken) { - var closeParenParent = closeParenToken.parent; - if (closeParenParent) { - switch (closeParenParent.kind()) { - case 155 /* ForStatement */: - case 228 /* ParameterList */: - return this.breakpointSpanOf(TypeScript.previousToken(closeParenToken)); - } - } - return this.breakpointSpanOfContainingNode(closeParenToken); - }; - BreakpointResolver.prototype.canHaveBreakpointInBlock = function (blockNode) { - if (!blockNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(blockNode)) { - return false; - } - var blockSyntax = blockNode; - return blockSyntax.statements && blockSyntax.statements.length != 0; - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(statementsNode, 0); - if (firstStatement && firstStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(statementsNode, statementsNode.length - 1); - if (lastStatement && lastStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfFirstChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(positionedList, 0); - if (firstStatement && firstStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(positionedList, 0); - if (lastStatement && lastStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfNode = function (positionedNode) { - var node = positionedNode; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - return this.breakpointSpanOfDeclarationWithElements(positionedNode); - case 226 /* VariableDeclarator */: - return this.breakpointSpanOfVariableDeclarator(positionedNode); - case 225 /* VariableDeclaration */: - return this.breakpointSpanOfVariableDeclaration(positionedNode); - case 149 /* VariableStatement */: - return this.breakpointSpanOfVariableStatement(positionedNode); - case 243 /* Parameter */: - return this.breakpointSpanOfParameter(positionedNode); - case 137 /* MemberVariableDeclaration */: - return this.breakpointSpanOfMemberVariableDeclaration(positionedNode); - case 134 /* ImportDeclaration */: - return this.breakpointSpanOfImportDeclaration(positionedNode); - case 133 /* EnumDeclaration */: - return this.breakpointSpanOfEnumDeclaration(positionedNode); - case 244 /* EnumElement */: - return this.breakpointSpanOfEnumElement(positionedNode); - case 148 /* IfStatement */: - return this.breakpointSpanOfIfStatement(positionedNode); - case 236 /* ElseClause */: - return this.breakpointSpanOfElseClause(positionedNode); - case 156 /* ForInStatement */: - return this.breakpointSpanOfForInStatement(positionedNode); - case 155 /* ForStatement */: - return this.breakpointSpanOfForStatement(positionedNode); - case 159 /* WhileStatement */: - return this.breakpointSpanOfWhileStatement(positionedNode); - case 162 /* DoStatement */: - return this.breakpointSpanOfDoStatement(positionedNode); - case 152 /* SwitchStatement */: - return this.breakpointSpanOfSwitchStatement(positionedNode); - case 234 /* CaseSwitchClause */: - return this.breakpointSpanOfCaseSwitchClause(positionedNode); - case 235 /* DefaultSwitchClause */: - return this.breakpointSpanOfDefaultSwitchClause(positionedNode); - case 164 /* WithStatement */: - return this.breakpointSpanOfWithStatement(positionedNode); - case 160 /* TryStatement */: - return this.breakpointSpanOfTryStatement(positionedNode); - case 237 /* CatchClause */: - return this.breakpointSpanOfCatchClause(positionedNode); - case 238 /* FinallyClause */: - return this.breakpointSpanOfFinallyClause(positionedNode); - case 219 /* ParenthesizedArrowFunctionExpression */: - return this.breakpointSpanOfParenthesizedArrowFunctionExpression(positionedNode); - case 220 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfSimpleArrowFunctionExpression(positionedNode); - default: - if (TypeScript.SyntaxUtilities.isStatement(node)) { - return this.breakpointSpanOfStatement(positionedNode); - } - else { - return this.breakpointOfExpression(positionedNode); - } - } - }; - BreakpointResolver.prototype.isExpressionOfArrowExpressions = function (expression) { - if (!expression) { - return false; - } - var expressionParent = expression.parent; - if (expressionParent) { - if (expressionParent.kind() == 219 /* ParenthesizedArrowFunctionExpression */) { - var parenthesizedArrowExpression = expressionParent; - var expressionOfParenthesizedArrowExpression = parenthesizedArrowExpression.expression; - return expressionOfParenthesizedArrowExpression == expression; - } - else if (expressionParent.kind() == 220 /* SimpleArrowFunctionExpression */) { - var simpleArrowExpression = expressionParent; - var expressionOfSimpleArrowExpression = simpleArrowExpression.expression; - return expressionOfSimpleArrowExpression == expression; - } - else if (expressionParent.kind() == 174 /* CommaExpression */) { - return this.isExpressionOfArrowExpressions(expressionParent); - } - } - return false; - }; - BreakpointResolver.prototype.isInitializerOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var initializer = forStatement.initializer; - return initializer === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isInitializerOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isConditionOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var condition = forStatement.condition; - return condition === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isConditionOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isIncrememtorOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var incrementor = forStatement.incrementor; - return incrementor === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isIncrememtorOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.breakpointOfLeftOfCommaExpression = function (commaExpressionNode) { - var commaExpression = commaExpressionNode; - return this.breakpointSpanOf(commaExpression.left); - }; - BreakpointResolver.prototype.breakpointOfExpression = function (expressionNode) { - if (this.isInitializerOfForStatement(expressionNode) || this.isConditionOfForStatement(expressionNode) || this.isIncrememtorOfForStatement(expressionNode)) { - if (expressionNode.kind() == 174 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (this.isExpressionOfArrowExpressions(expressionNode)) { - if (expressionNode.kind() == 174 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (expressionNode.kind() == 135 /* ExportAssignment */) { - var exportAssignmentSyntax = expressionNode; - return createBreakpointSpanInfo(expressionNode, exportAssignmentSyntax.exportKeyword, exportAssignmentSyntax.equalsToken, exportAssignmentSyntax.identifier); - } - return this.breakpointSpanOfContainingNode(expressionNode); - }; - BreakpointResolver.prototype.breakpointSpanOfStatement = function (statementNode) { - var statement = statementNode; - if (statement.kind() == 157 /* EmptyStatement */) { - return null; - } - var containingNode = TypeScript.Syntax.containingNode(statementNode); - if (TypeScript.SyntaxUtilities.isStatement(containingNode)) { - var useNodeForBreakpoint = false; - switch (containingNode.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 236 /* ElseClause */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 152 /* SwitchStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - case 147 /* Block */: - useNodeForBreakpoint = true; - } - if (!useNodeForBreakpoint) { - return this.breakpointSpanOfContainingNode(statementNode); - } - } - switch (statement.kind()) { - case 150 /* ExpressionStatement */: - var expressionSyntax = statement; - return createBreakpointSpanInfo(expressionSyntax.expression); - case 151 /* ReturnStatement */: - var returnStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, returnStatementSyntax.returnKeyword, returnStatementSyntax.expression); - case 158 /* ThrowStatement */: - var throwStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, throwStatementSyntax.throwKeyword, throwStatementSyntax.expression); - case 153 /* BreakStatement */: - var breakStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, breakStatementSyntax.breakKeyword, breakStatementSyntax.identifier); - case 154 /* ContinueStatement */: - var continueStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, continueStatementSyntax.continueKeyword, continueStatementSyntax.identifier); - case 163 /* DebuggerStatement */: - var debuggerStatementSyntax = statement; - return createBreakpointSpanInfo(debuggerStatementSyntax.debuggerKeyword); - case 161 /* LabeledStatement */: - var labeledStatementSyntax = statement; - return this.breakpointSpanOf(labeledStatementSyntax.statement); - } - return null; - }; - BreakpointResolver.prototype.getSyntaxListOfDeclarationWithElements = function (positionedNode) { - var node = positionedNode; - var elementsList; - var block; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - elementsList = node.moduleElements; - break; - case 132 /* ClassDeclaration */: - elementsList = node.classElements; - break; - case 130 /* FunctionDeclaration */: - block = node.block; - break; - case 138 /* ConstructorDeclaration */: - block = node.block; - break; - case 136 /* MemberFunctionDeclaration */: - block = node.block; - break; - case 140 /* GetAccessor */: - block = node.block; - break; - case 141 /* SetAccessor */: - block = node.block; - break; - case 223 /* FunctionExpression */: - block = node.block; - break; - case 219 /* ParenthesizedArrowFunctionExpression */: - block = node.block; - break; - case 220 /* SimpleArrowFunctionExpression */: - block = node.block; - break; - default: - throw TypeScript.Errors.argument('positionNode', 'unknown node kind in getSyntaxListOfDeclarationWithElements'); - } - var parentElement = positionedNode; - if (block) { - parentElement = block; - elementsList = block.statements; - } - return elementsList; - }; - BreakpointResolver.prototype.canHaveBreakpointInDeclaration = function (positionedNode) { - return positionedNode && !TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(positionedNode); - }; - BreakpointResolver.prototype.breakpointSpanOfDeclarationWithElements = function (positionedNode) { - if (!this.canHaveBreakpointInDeclaration(positionedNode)) { - return null; - } - var node = positionedNode; - var moduleSyntax = positionedNode; - if ((TypeScript.SyntaxUtilities.isModuleElement(node) && TypeScript.Syntax.containingNode(positionedNode).kind() != 120 /* SourceUnit */) || TypeScript.SyntaxUtilities.isClassElement(node) || (moduleSyntax.kind() == 131 /* ModuleDeclaration */ && moduleSyntax.name && moduleSyntax.name.kind() == 121 /* QualifiedName */)) { - return createBreakpointSpanInfo(positionedNode); - } - else { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(positionedNode)); - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclarator = function (varDeclaratorNode) { - if (!varDeclaratorNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclaratorNode)) { - return false; - } - var varDeclaratorSyntax = varDeclaratorNode; - return !!varDeclaratorSyntax.equalsValueClause; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclarator = function (varDeclaratorNode) { - if (!this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclaratorNode); - if (container && container.kind() == 225 /* VariableDeclaration */) { - var parentDeclaratorsList = varDeclaratorNode.parent; - if (parentDeclaratorsList && TypeScript.childAt(parentDeclaratorsList, 0) == varDeclaratorNode) { - return this.breakpointSpanOfVariableDeclaration(container); - } - if (this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return createBreakpointSpanInfo(varDeclaratorNode); - } - else { - return null; - } - } - else if (container) { - return this.breakpointSpanOfMemberVariableDeclaration(container); - } - return null; - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclaration = function (varDeclarationNode) { - if (!varDeclarationNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclarationNode)) { - return false; - } - var varDeclarationSyntax = varDeclarationNode; - var containerChildren = varDeclarationSyntax.variableDeclarators; - if (!containerChildren || TypeScript.childCount(containerChildren) == 0) { - return false; - } - var child = TypeScript.childAt(containerChildren, 0); - if (TypeScript.isNode(child)) { - return this.canHaveBreakpointInVariableDeclarator(child); - } - return false; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclaration = function (varDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(varDeclarationNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclarationNode); - var varDeclarationSyntax = varDeclarationNode; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - if (container && container.kind() == 149 /* VariableStatement */) { - return this.breakpointSpanOfVariableStatement(container); - } - if (this.canHaveBreakpointInVariableDeclaration(varDeclarationNode)) { - return createBreakpointSpanInfoWithLimChar(varDeclarationNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - } - else { - return null; - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableStatement = function (varStatementNode) { - if (!varStatementNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varStatementNode)) { - return false; - } - var variableStatement = varStatementNode; - return this.canHaveBreakpointInVariableDeclaration(variableStatement.variableDeclaration); - }; - BreakpointResolver.prototype.breakpointSpanOfVariableStatement = function (varStatementNode) { - if (!this.canHaveBreakpointInVariableStatement(varStatementNode)) { - return null; - } - var variableStatement = varStatementNode; - var variableDeclaration = variableStatement.variableDeclaration; - var varDeclarationSyntax = variableDeclaration; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - return createBreakpointSpanInfoWithLimChar(varStatementNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - }; - BreakpointResolver.prototype.breakpointSpanOfParameter = function (parameterNode) { - if (parameterNode.parent.kind() === 220 /* SimpleArrowFunctionExpression */) { - return this.breakpointSpanOfNode(parameterNode.parent); - } - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(parameterNode)) { - return null; - } - var parameterSyntax = parameterNode; - if (parameterSyntax.dotDotDotToken || parameterSyntax.equalsValueClause || parameterSyntax.modifiers.length > 0) { - return createBreakpointSpanInfo(parameterNode); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfMemberVariableDeclaration = function (memberVarDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(memberVarDeclarationNode)) { - return null; - } - var memberVariableDeclaration = memberVarDeclarationNode; - if (this.canHaveBreakpointInVariableDeclarator(memberVariableDeclaration.variableDeclarator)) { - return createBreakpointSpanInfo(memberVarDeclarationNode, memberVariableDeclaration.modifiers, memberVariableDeclaration.variableDeclarator); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfImportDeclaration = function (importDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(importDeclarationNode)) { - return null; - } - var importSyntax = importDeclarationNode; - return createBreakpointSpanInfo(importDeclarationNode, importSyntax.modifiers, importSyntax.importKeyword, importSyntax.identifier, importSyntax.equalsToken, importSyntax.moduleReference); - }; - BreakpointResolver.prototype.breakpointSpanOfEnumDeclaration = function (enumDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(enumDeclarationNode)) { - return null; - } - return createBreakpointSpanInfo(enumDeclarationNode); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstEnumElement = function (enumDeclarationNode) { - var enumDeclarationSyntax = enumDeclarationNode; - var enumElements = enumDeclarationSyntax.enumElements; - if (enumElements && TypeScript.childCount(enumElements)) { - return this.breakpointSpanOf(TypeScript.childAt(enumElements, 0)); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfEnumElement = function (enumElementNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(enumElementNode)) { - return null; - } - return createBreakpointSpanInfo(enumElementNode); - }; - BreakpointResolver.prototype.breakpointSpanOfIfStatement = function (ifStatementNode) { - var ifStatement = ifStatementNode; - return createBreakpointSpanInfo(ifStatementNode, ifStatement.ifKeyword, ifStatement.openParenToken, ifStatement.condition, ifStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfElseClause = function (elseClauseNode) { - var elseClause = elseClauseNode; - return this.breakpointSpanOf(elseClause.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfForInStatement = function (forInStatementNode) { - var forInStatement = forInStatementNode; - return createBreakpointSpanInfo(forInStatementNode, forInStatement.forKeyword, forInStatement.openParenToken, forInStatement.variableDeclaration, forInStatement.left, forInStatement.inKeyword, forInStatement.expression, forInStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfForStatement = function (forStatementNode) { - var forStatement = forStatementNode; - return this.breakpointSpanOf(forStatement.variableDeclaration ? forStatement.variableDeclaration : forStatement.initializer); - }; - BreakpointResolver.prototype.breakpointSpanOfWhileStatement = function (whileStatementNode) { - var whileStatement = whileStatementNode; - return createBreakpointSpanInfo(whileStatementNode, whileStatement.whileKeyword, whileStatement.openParenToken, whileStatement.condition, whileStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfDoStatement = function (doStatementNode) { - var doStatement = doStatementNode; - return createBreakpointSpanInfo(doStatementNode, doStatement.whileKeyword, doStatement.openParenToken, doStatement.condition, doStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfSwitchStatement = function (switchStatementNode) { - var switchStatement = switchStatementNode; - return createBreakpointSpanInfo(switchStatementNode, switchStatement.switchKeyword, switchStatement.openParenToken, switchStatement.expression, switchStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementOfFirstCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var firstCaseClause = switchClauses[0]; - var statements = firstCaseClause.statements; - return this.breakpointSpanOfFirstChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementOfLastCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var lastClauseNode = switchClauses[switchClauses.length - 1]; - var statements = lastClauseNode.statements; - return this.breakpointSpanOfLastChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfCaseSwitchClause = function (caseClauseNode) { - var caseSwitchClause = caseClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(caseSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfDefaultSwitchClause = function (defaultSwithClauseNode) { - var defaultSwitchClause = defaultSwithClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(defaultSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfWithStatement = function (withStatementNode) { - var withStatement = withStatementNode; - return this.breakpointSpanOf(withStatement.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfTryStatement = function (tryStatementNode) { - var tryStatement = tryStatementNode; - return this.breakpointSpanOfFirstStatementInBlock(tryStatement.block); - }; - BreakpointResolver.prototype.breakpointSpanOfCatchClause = function (catchClauseNode) { - var catchClause = catchClauseNode; - return createBreakpointSpanInfo(catchClauseNode, catchClause.catchKeyword, catchClause.openParenToken, catchClause.identifier, catchClause.typeAnnotation, catchClause.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFinallyClause = function (finallyClauseNode) { - var finallyClause = finallyClauseNode; - return this.breakpointSpanOfFirstStatementInBlock(finallyClause.block); - }; - BreakpointResolver.prototype.breakpointSpanOfParenthesizedArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfSimpleArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfContainingNode = function (positionedElement) { - var current = positionedElement.parent; - while (!TypeScript.isNode(current)) { - current = current.parent; - } - return this.breakpointSpanOf(current); - }; - BreakpointResolver.prototype.breakpointSpanIfStartsOnSameLine = function (positionedElement) { - if (positionedElement && this.posLine == this.lineMap.getLineNumberFromPosition(TypeScript.start(positionedElement))) { - return this.breakpointSpanOf(positionedElement); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOf = function (positionedElement) { - if (!positionedElement) { - return null; - } - for (var containingNode = TypeScript.Syntax.containingNode(positionedElement); containingNode != null; containingNode = TypeScript.Syntax.containingNode(containingNode)) { - if (containingNode.kind() == 245 /* TypeAnnotation */) { - return this.breakpointSpanIfStartsOnSameLine(containingNode); - } - } - var element = positionedElement; - if (TypeScript.isNode(element)) { - return this.breakpointSpanOfNode(positionedElement); - } - if (TypeScript.isToken(element)) { - return this.breakpointSpanOfToken(positionedElement); - } - return this.breakpointSpanOfContainingNode(positionedElement); - }; - return BreakpointResolver; - })(); - function getBreakpointLocation(syntaxTree, askedPos) { - if (TypeScript.isDTSFile(syntaxTree.fileName())) { - return null; - } - var sourceUnit = syntaxTree.sourceUnit(); - var positionedToken = TypeScript.findToken(sourceUnit, askedPos); - var lineMap = syntaxTree.lineMap(); - var posLine = lineMap.getLineNumberFromPosition(askedPos); - var tokenStartLine = lineMap.getLineNumberFromPosition(TypeScript.start(positionedToken)); - if (posLine < tokenStartLine) { - return null; - } - var breakpointResolver = new BreakpointResolver(posLine, lineMap); - return breakpointResolver.breakpointSpanOf(positionedToken); - } - Breakpoints.getBreakpointLocation = getBreakpointLocation; - })(Breakpoints = Services.Breakpoints || (Services.Breakpoints = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var Indentation; (function (Indentation) { @@ -28612,10 +28519,10 @@ var TypeScript; var leadingTrivia = firstTokenInLine.leadingTrivia(); for (var i = leadingTrivia.count() - 1; i >= 0; i--) { var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* NewLineTrivia */) { + if (trivia.kind() === 3 /* NewLineTrivia */) { break; } - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { + if (trivia.kind() === 4 /* MultiLineCommentTrivia */) { var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); if (lineSegments.length > 0) { @@ -28697,30 +28604,27 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind !== 139 /* CallExpression */ && node.parent.kind !== 140 /* NewExpression */) { + if (node.parent.kind !== 144 /* CallExpression */ && node.parent.kind !== 145 /* NewExpression */) { return undefined; } var parent = node.parent; - if (node.kind === 19 /* LessThanToken */ || node.kind === 11 /* OpenParenToken */) { + if (node.kind === 23 /* LessThanToken */ || node.kind === 15 /* OpenParenToken */) { var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); - ts.Debug.assert(list); + ts.Debug.assert(list !== undefined); return { list: list, listItemIndex: 0 }; } - if (node.kind === 20 /* GreaterThanToken */ || node.kind === 12 /* CloseParenToken */ || node === parent.func) { - return undefined; - } return ts.findListItemInfo(node); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 184 /* SourceFile */; n = n.parent) { - if (n.kind === 175 /* FunctionBlock */) { + for (var n = node; n.kind !== 193 /* SourceFile */; n = n.parent) { + if (n.kind === 183 /* FunctionBlock */) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { - ts.Debug.fail("Node of kind " + ts.SyntaxKind[n.kind] + " is not a subspan of its parent of kind " + ts.SyntaxKind[n.parent.kind]); + ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } var argumentInfo = getImmediatelyContainingArgumentInfo(n); if (argumentInfo) { @@ -28766,20 +28670,20 @@ var ts; prefixParts.push.apply(prefixParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(ts.punctuationPart(19 /* LessThanToken */)); + prefixParts.push(ts.punctuationPart(23 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(20 /* GreaterThanToken */)); + suffixParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList); }); suffixParts.push.apply(suffixParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList); }); prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(ts.punctuationPart(11 /* OpenParenToken */)); + prefixParts.push(ts.punctuationPart(15 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(12 /* CloseParenToken */)); + suffixParts.push(ts.punctuationPart(16 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList); }); suffixParts.push.apply(suffixParts, returnTypeParts); @@ -28787,7 +28691,7 @@ var ts; isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixParts, suffixDisplayParts: suffixParts, - separatorDisplayParts: [ts.punctuationPart(18 /* CommaToken */), ts.spacePart()], + separatorDisplayParts: [ts.punctuationPart(22 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; @@ -28796,7 +28700,7 @@ var ts; var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentListOrTypeArgumentList.end, false); var applicableSpan = new TypeScript.TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); var argumentIndex = (argumentInfoOrTypeArgumentInfo.listItemIndex + 1) >> 1; - var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 ? 0 : 1 + ts.countWhere(argumentListOrTypeArgumentList.getChildren(), function (arg) { return arg.kind === 18 /* CommaToken */; }); + var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 ? 0 : 1 + ts.countWhere(argumentListOrTypeArgumentList.getChildren(), function (arg) { return arg.kind === 22 /* CommaToken */; }); var selectedItemIndex = candidates.indexOf(bestSignature); if (selectedItemIndex < 0) { selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount); @@ -28836,6 +28740,9 @@ var ts; (function (ts) { function findListItemInfo(node) { var syntaxList = findContainingList(node); + if (!syntaxList) { + return undefined; + } var children = syntaxList.getChildren(); var index = ts.indexOf(children, node); return { @@ -28850,18 +28757,15 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 186 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 195 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); - if (!syntaxList) { - ts.Debug.assert(findChildOfKind(node.parent, 186 /* SyntaxList */), "Node of kind " + ts.SyntaxKind[node.parent.kind] + " has no list children"); - } return syntaxList; } ts.findContainingList = findContainingList; function findListItemIndexContainingPosition(list, position) { - ts.Debug.assert(list.kind === 186 /* SyntaxList */); + ts.Debug.assert(list.kind === 195 /* SyntaxList */); var children = list.getChildren(); for (var i = 0; i < children.length; i++) { if (children[i].pos <= position && children[i].end > position) { @@ -28897,11 +28801,12 @@ var ts; var child = current.getChildAt(i); var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); if (start <= position) { - if (position < child.getEnd()) { + var end = child.getEnd(); + if (position < end || (position === end && child.kind === 1 /* EndOfFileToken */)) { current = child; continue outer; } - else if (includeItemAtEndPosition && child.getEnd() === position) { + else if (includeItemAtEndPosition && end === position) { var previousToken = findPrecedingToken(position, sourceFile, child); if (previousToken && includeItemAtEndPosition(previousToken)) { return previousToken; @@ -28956,7 +28861,7 @@ var ts; for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; if (nodeHasTokens(child)) { - if (position < child.end) { + if (position <= child.end) { if (child.getStart(sourceFile) >= position) { var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); @@ -28967,7 +28872,7 @@ var ts; } } } - ts.Debug.assert(startNode || n.kind === 184 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 193 /* SourceFile */); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -28983,30 +28888,30 @@ var ts; } ts.findPrecedingToken = findPrecedingToken; function nodeHasTokens(n) { - if (n.kind === 153 /* ExpressionStatement */) { + if (n.kind === 161 /* ExpressionStatement */) { return nodeHasTokens(n.expression); } - if (n.kind === 1 /* EndOfFileToken */ || n.kind === 149 /* OmittedExpression */ || n.kind === 115 /* Missing */) { + if (n.kind === 1 /* EndOfFileToken */ || n.kind === 157 /* OmittedExpression */ || n.kind === 120 /* Missing */) { return false; } - return n.kind !== 186 /* SyntaxList */ || n.getChildCount() !== 0; + return n.kind !== 195 /* SyntaxList */ || n.getChildCount() !== 0; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 127 /* TypeReference */ || node.kind === 139 /* CallExpression */) { + if (node.kind === 132 /* TypeReference */ || node.kind === 144 /* CallExpression */) { return node.typeArguments; } - if (ts.isAnyFunction(node) || node.kind === 176 /* ClassDeclaration */ || node.kind === 177 /* InterfaceDeclaration */) { + if (ts.isAnyFunction(node) || node.kind === 184 /* ClassDeclaration */ || node.kind === 185 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= ts.SyntaxKind.FirstToken && n.kind <= ts.SyntaxKind.LastToken; + return n.kind >= 1 /* FirstToken */ && n.kind <= 119 /* LastToken */; } ts.isToken = isToken; function isWord(n) { - return n.kind === 59 /* Identifier */ || ts.isKeyword(n.kind); + return n.kind === 63 /* Identifier */ || ts.isKeyword(n.kind); } function isPropertyName(n) { return n.kind === 7 /* StringLiteral */ || n.kind === 6 /* NumericLiteral */ || isWord(n); @@ -29016,7 +28921,7 @@ var ts; } ts.isComment = isComment; function isPunctuation(n) { - return ts.SyntaxKind.FirstPunctuation <= n.kind && n.kind <= ts.SyntaxKind.LastPunctuation; + return 13 /* FirstPunctuation */ <= n.kind && n.kind <= 62 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; })(ts || (ts = {})); @@ -29267,7 +29172,7 @@ var TypeScript; FormattingManager.prototype.formatOnSemicolon = function (caretPosition) { var sourceUnit = this.syntaxTree.sourceUnit(); var semicolonPositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (semicolonPositionedToken.kind() === 78 /* SemicolonToken */) { + if (semicolonPositionedToken.kind() === 80 /* SemicolonToken */) { var current = semicolonPositionedToken; while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(semicolonPositionedToken) && current.parent.kind() !== 1 /* List */) { current = current.parent; @@ -29280,7 +29185,7 @@ var TypeScript; FormattingManager.prototype.formatOnClosingCurlyBrace = function (caretPosition) { var sourceUnit = this.syntaxTree.sourceUnit(); var closeBracePositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (closeBracePositionedToken.kind() === 71 /* CloseBraceToken */) { + if (closeBracePositionedToken.kind() === 73 /* CloseBraceToken */) { var current = closeBracePositionedToken; while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(closeBracePositionedToken) && current.parent.kind() !== 1 /* List */) { current = current.parent; @@ -29494,71 +29399,71 @@ var TypeScript; var Rules = (function () { function Rules() { this.IgnoreBeforeComment = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.Comments), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.IgnoreAfterLineComment = new Formatting.Rule(Formatting.RuleDescriptor.create3(7 /* SingleLineCommentTrivia */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.NoSpaceBeforeSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeColon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 106 /* ColonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeQMark = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 105 /* QuestionToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterColon = new Formatting.Rule(Formatting.RuleDescriptor.create3(106 /* ColonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterQMark = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndElse = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 23 /* ElseKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 42 /* WhileKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 75 /* CloseBracketToken */, 79 /* CommaToken */, 78 /* SemicolonToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeDot = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 76 /* DotToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterDot = new Formatting.Rule(Formatting.RuleDescriptor.create3(76 /* DotToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(75 /* CloseBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.IgnoreAfterLineComment = new Formatting.Rule(Formatting.RuleDescriptor.create3(5 /* SingleLineCommentTrivia */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create1(0 /* Ignore */)); + this.NoSpaceBeforeSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 80 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeColon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 108 /* ColonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); + this.NoSpaceBeforeQMark = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 107 /* QuestionToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); + this.SpaceAfterColon = new Formatting.Rule(Formatting.RuleDescriptor.create3(108 /* ColonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); + this.SpaceAfterQMark = new Formatting.Rule(Formatting.RuleDescriptor.create3(107 /* QuestionToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); + this.SpaceAfterSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.SpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(73 /* CloseBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 1 /* Space */)); + this.SpaceBetweenCloseBraceAndElse = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseBraceToken */, 25 /* ElseKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.SpaceBetweenCloseBraceAndWhile = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseBraceToken */, 44 /* WhileKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.NoSpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(73 /* CloseBraceToken */, Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 77 /* CloseBracketToken */, 81 /* CommaToken */, 80 /* SemicolonToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeDot = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 78 /* DotToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterDot = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* DotToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 76 /* OpenBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(76 /* OpenBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 77 /* CloseBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(77 /* CloseBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); this.FunctionOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.AnyIncludingMultilineComments; - this.SpaceBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.TypeScriptOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([11 /* IdentifierName */, 6 /* MultiLineCommentTrivia */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.ControlOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 6 /* MultiLineCommentTrivia */, 22 /* DoKeyword */, 38 /* TryKeyword */, 25 /* FinallyKeyword */, 23 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.SpaceAfterOpenBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.SpaceBeforeCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.NoSpaceBetweenEmptyBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 3 /* Delete */)); - this.NewLineAfterOpenBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NewLineBeforeCloseBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.AnyIncludingMultilineComments, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); + this.SpaceBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); + this.TypeScriptOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([9 /* IdentifierName */, 4 /* MultiLineCommentTrivia */]); + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); + this.ControlOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 4 /* MultiLineCommentTrivia */, 24 /* DoKeyword */, 40 /* TryKeyword */, 27 /* FinallyKeyword */, 25 /* ElseKeyword */]); + this.SpaceBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); + this.SpaceAfterOpenBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); + this.SpaceBeforeCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); + this.NoSpaceBetweenEmptyBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenBraceToken */, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 3 /* Delete */)); + this.NewLineAfterOpenBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); + this.NewLineBeforeCloseBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.AnyIncludingMultilineComments, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); this.NoSpaceAfterUnaryPrefixOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.UnaryPrefixOperators, Formatting.Shared.TokenRange.UnaryPrefixExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPreincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(93 /* PlusPlusToken */, Formatting.Shared.TokenRange.UnaryPreincrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(94 /* MinusMinusToken */, Formatting.Shared.TokenRange.UnaryPredecrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostincrementExpressions, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new Formatting.Rule(Formatting.RuleDescriptor.create1(93 /* PlusPlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new Formatting.Rule(Formatting.RuleDescriptor.create1(94 /* MinusMinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeComma = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 79 /* CommaToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([40 /* VarKeyword */, 36 /* ThrowKeyword */, 31 /* NewKeyword */, 21 /* DeleteKeyword */, 33 /* ReturnKeyword */, 39 /* TypeOfKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncCall = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 3 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create3(27 /* FunctionKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 3 /* Delete */)); - this.SpaceAfterVoidOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(41 /* VoidKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 1 /* Space */)); - this.NoSpaceBetweenReturnAndSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create1(33 /* ReturnKeyword */, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBetweenStatements = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 22 /* DoKeyword */, 23 /* ElseKeyword */, 16 /* CaseKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 1 /* Space */)); - this.SpaceAfterTryFinally = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([38 /* TryKeyword */, 25 /* FinallyKeyword */]), 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterGetSetInMember = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([64 /* GetKeyword */, 68 /* SetKeyword */]), 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); + this.NoSpaceAfterUnaryPreincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(95 /* PlusPlusToken */, Formatting.Shared.TokenRange.UnaryPreincrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterUnaryPredecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(96 /* MinusMinusToken */, Formatting.Shared.TokenRange.UnaryPredecrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeUnaryPostincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostincrementExpressions, 95 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeUnaryPostdecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 96 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.SpaceAfterPostincrementWhenFollowedByAdd = new Formatting.Rule(Formatting.RuleDescriptor.create1(95 /* PlusPlusToken */, 91 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); + this.SpaceAfterAddWhenFollowedByUnaryPlus = new Formatting.Rule(Formatting.RuleDescriptor.create1(91 /* PlusToken */, 91 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); + this.SpaceAfterAddWhenFollowedByPreincrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(91 /* PlusToken */, 95 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); + this.SpaceAfterPostdecrementWhenFollowedBySubtract = new Formatting.Rule(Formatting.RuleDescriptor.create1(96 /* MinusMinusToken */, 92 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new Formatting.Rule(Formatting.RuleDescriptor.create1(92 /* MinusToken */, 92 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByPredecrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(92 /* MinusToken */, 96 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); + this.NoSpaceBeforeComma = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 81 /* CommaToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.SpaceAfterCertainKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([42 /* VarKeyword */, 38 /* ThrowKeyword */, 33 /* NewKeyword */, 23 /* DeleteKeyword */, 35 /* ReturnKeyword */, 41 /* TypeOfKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncCall = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 3 /* Delete */)); + this.SpaceAfterFunctionInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create3(29 /* FunctionKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 3 /* Delete */)); + this.SpaceAfterVoidOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(43 /* VoidKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 1 /* Space */)); + this.NoSpaceBetweenReturnAndSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create1(35 /* ReturnKeyword */, 80 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.SpaceBetweenStatements = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 24 /* DoKeyword */, 25 /* ElseKeyword */, 18 /* CaseKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 1 /* Space */)); + this.SpaceAfterTryFinally = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([40 /* TryKeyword */, 27 /* FinallyKeyword */]), 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.SpaceAfterGetSetInMember = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([66 /* GetKeyword */, 70 /* SetKeyword */]), 9 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); this.SpaceBeforeBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryKeywordOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); this.SpaceAfterBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryKeywordOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceAfterConstructor = new Formatting.Rule(Formatting.RuleDescriptor.create1(62 /* ConstructorKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterModuleImport = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([65 /* ModuleKeyword */, 66 /* RequireKeyword */]), 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([44 /* ClassKeyword */, 63 /* DeclareKeyword */, 46 /* EnumKeyword */, 47 /* ExportKeyword */, 48 /* ExtendsKeyword */, 64 /* GetKeyword */, 51 /* ImplementsKeyword */, 49 /* ImportKeyword */, 52 /* InterfaceKeyword */, 65 /* ModuleKeyword */, 55 /* PrivateKeyword */, 57 /* PublicKeyword */, 68 /* SetKeyword */, 58 /* StaticKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.FromTokens([48 /* ExtendsKeyword */, 51 /* ImplementsKeyword */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterModuleName = new Formatting.Rule(Formatting.RuleDescriptor.create1(14 /* StringLiteral */, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsModuleDeclContext), 1 /* Space */)); - this.SpaceAfterArrow = new Formatting.Rule(Formatting.RuleDescriptor.create3(85 /* EqualsGreaterThanToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterEllipsis = new Formatting.Rule(Formatting.RuleDescriptor.create1(77 /* DotDotDotToken */, 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.TypeNames, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseParenToken */, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* LessThanToken */, Formatting.Shared.TokenRange.TypeNames), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 81 /* GreaterThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* GreaterThanToken */, Formatting.Shared.TokenRange.FromTokens([72 /* OpenParenToken */, 74 /* OpenBracketToken */, 81 /* GreaterThanToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 3 /* Delete */)); + this.NoSpaceAfterConstructor = new Formatting.Rule(Formatting.RuleDescriptor.create1(64 /* ConstructorKeyword */, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterModuleImport = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([67 /* ModuleKeyword */, 68 /* RequireKeyword */]), 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.SpaceAfterCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([46 /* ClassKeyword */, 65 /* DeclareKeyword */, 48 /* EnumKeyword */, 49 /* ExportKeyword */, 50 /* ExtendsKeyword */, 66 /* GetKeyword */, 53 /* ImplementsKeyword */, 51 /* ImportKeyword */, 54 /* InterfaceKeyword */, 67 /* ModuleKeyword */, 57 /* PrivateKeyword */, 59 /* PublicKeyword */, 70 /* SetKeyword */, 60 /* StaticKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.FromTokens([50 /* ExtendsKeyword */, 53 /* ImplementsKeyword */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.SpaceAfterModuleName = new Formatting.Rule(Formatting.RuleDescriptor.create1(12 /* StringLiteral */, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsModuleDeclContext), 1 /* Space */)); + this.SpaceAfterArrow = new Formatting.Rule(Formatting.RuleDescriptor.create3(87 /* EqualsGreaterThanToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.NoSpaceAfterEllipsis = new Formatting.Rule(Formatting.RuleDescriptor.create1(79 /* DotDotDotToken */, 9 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterOptionalParameters = new Formatting.Rule(Formatting.RuleDescriptor.create3(107 /* QuestionToken */, Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 81 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); + this.NoSpaceBeforeOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.TypeNames, 82 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); + this.NoSpaceBetweenCloseParenAndAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create1(75 /* CloseParenToken */, 82 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); + this.NoSpaceAfterOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(82 /* LessThanToken */, Formatting.Shared.TokenRange.TypeNames), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); + this.NoSpaceBeforeCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 83 /* GreaterThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); + this.NoSpaceAfterCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(83 /* GreaterThanToken */, Formatting.Shared.TokenRange.FromTokens([74 /* OpenParenToken */, 76 /* OpenBracketToken */, 83 /* GreaterThanToken */, 81 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); + this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenBraceToken */, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 3 /* Delete */)); this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -29626,26 +29531,26 @@ var TypeScript; this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; - this.SpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.SpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.NoSpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); this.SpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); this.SpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); this.NoSpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); this.NoSpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 1 /* Space */)); - this.NoSpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 3 /* Delete */)); - this.NewLineBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.SpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 1 /* Space */)); - this.NoSpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 3 /* Delete */)); - this.SpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBetweenParens = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenParenToken */, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 3 /* Delete */)); + this.SpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 1 /* Space */)); + this.NoSpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 3 /* Delete */)); + this.NewLineBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); + this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); + this.NewLineBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); + this.SpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 1 /* Space */)); + this.NoSpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 3 /* Delete */)); + this.SpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.SpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); + this.NoSpaceBetweenParens = new Formatting.Rule(Formatting.RuleDescriptor.create1(74 /* OpenParenToken */, 75 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.NoSpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + this.SpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(29 /* FunctionKeyword */, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); + this.NoSpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(29 /* FunctionKeyword */, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 3 /* Delete */)); } Rules.prototype.getRuleName = function (rule) { var o = this; @@ -29657,56 +29562,22 @@ var TypeScript; throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); }; Rules.IsForContext = function (context) { - return context.contextNode.kind() === 155 /* ForStatement */; + return context.contextNode.kind() === 159 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind()) { - case 175 /* AssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 183 /* OrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* ConditionalExpression */: - case 188 /* LogicalOrExpression */: - case 189 /* LogicalAndExpression */: - case 190 /* BitwiseOrExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 192 /* BitwiseAndExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: + case 174 /* BinaryExpression */: + case 173 /* ConditionalExpression */: return true; - case 134 /* ImportDeclaration */: - case 226 /* VariableDeclarator */: - case 233 /* EqualsValueClause */: - return context.currentTokenSpan.kind === 107 /* EqualsToken */ || context.nextTokenSpan.kind === 107 /* EqualsToken */; - case 156 /* ForInStatement */: - return context.currentTokenSpan.kind === 29 /* InKeyword */ || context.nextTokenSpan.kind === 29 /* InKeyword */; + case 138 /* ImportDeclaration */: + case 191 /* VariableDeclarator */: + case 197 /* EqualsValueClause */: + return context.currentTokenSpan.kind === 109 /* EqualsToken */ || context.nextTokenSpan.kind === 109 /* EqualsToken */; + case 160 /* ForInStatement */: + return context.currentTokenSpan.kind === 31 /* InKeyword */ || context.nextTokenSpan.kind === 31 /* InKeyword */; } return false; }; @@ -29736,26 +29607,26 @@ var TypeScript; return true; } switch (node.kind()) { - case 147 /* Block */: - case 152 /* SwitchStatement */: - case 216 /* ObjectLiteralExpression */: + case 151 /* Block */: + case 156 /* SwitchStatement */: + case 179 /* ObjectLiteralExpression */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind()) { - case 130 /* FunctionDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 146 /* MethodSignature */: - case 143 /* CallSignature */: - case 223 /* FunctionExpression */: - case 138 /* ConstructorDeclaration */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 129 /* InterfaceDeclaration */: + case 134 /* FunctionDeclaration */: + case 140 /* MemberFunctionDeclaration */: + case 144 /* GetAccessor */: + case 145 /* SetAccessor */: + case 150 /* MethodSignature */: + case 147 /* CallSignature */: + case 186 /* FunctionExpression */: + case 142 /* ConstructorDeclaration */: + case 183 /* SimpleArrowFunctionExpression */: + case 182 /* ParenthesizedArrowFunctionExpression */: + case 133 /* InterfaceDeclaration */: return true; } return false; @@ -29765,51 +29636,51 @@ var TypeScript; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind()) { - case 132 /* ClassDeclaration */: - case 133 /* EnumDeclaration */: - case 122 /* ObjectType */: - case 131 /* ModuleDeclaration */: + case 136 /* ClassDeclaration */: + case 137 /* EnumDeclaration */: + case 124 /* ObjectType */: + case 135 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind()) { - case 132 /* ClassDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 147 /* Block */: - case 152 /* SwitchStatement */: + case 136 /* ClassDeclaration */: + case 135 /* ModuleDeclaration */: + case 137 /* EnumDeclaration */: + case 151 /* Block */: + case 156 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind()) { - case 148 /* IfStatement */: - case 152 /* SwitchStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 160 /* TryStatement */: - case 162 /* DoStatement */: - case 164 /* WithStatement */: - case 236 /* ElseClause */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: + case 152 /* IfStatement */: + case 156 /* SwitchStatement */: + case 159 /* ForStatement */: + case 160 /* ForInStatement */: + case 163 /* WhileStatement */: + case 164 /* TryStatement */: + case 166 /* DoStatement */: + case 168 /* WithStatement */: + case 200 /* ElseClause */: + case 201 /* CatchClause */: + case 202 /* FinallyClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind() === 216 /* ObjectLiteralExpression */; + return context.contextNode.kind() === 179 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind() === 214 /* InvocationExpression */; + return context.contextNode.kind() === 177 /* InvocationExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind() === 217 /* ObjectCreationExpression */; + return context.contextNode.kind() === 180 /* ObjectCreationExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -29821,19 +29692,19 @@ var TypeScript; return context.formattingRequestKind != 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind() === 131 /* ModuleDeclaration */; + return context.contextNode.kind() === 135 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind() === 122 /* ObjectType */ && context.contextNode.parent().kind() !== 129 /* InterfaceDeclaration */; + return context.contextNode.kind() === 124 /* ObjectType */ && context.contextNode.parent().kind() !== 133 /* InterfaceDeclaration */; }; Rules.IsTypeArgumentOrParameter = function (tokenKind, parentKind) { - return ((tokenKind === 80 /* LessThanToken */ || tokenKind === 81 /* GreaterThanToken */) && (parentKind === 230 /* TypeParameterList */ || parentKind === 229 /* TypeArgumentList */)); + return ((tokenKind === 82 /* LessThanToken */ || tokenKind === 83 /* GreaterThanToken */) && (parentKind === 195 /* TypeParameterList */ || parentKind === 194 /* TypeArgumentList */)); }; Rules.IsTypeArgumentOrParameterContext = function (context) { return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan.kind, context.currentTokenParent.kind()) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan.kind, context.nextTokenParent.kind()); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 41 /* VoidKeyword */ && context.currentTokenParent.kind() === 173 /* VoidExpression */; + return context.currentTokenSpan.kind === 43 /* VoidKeyword */ && context.currentTokenParent.kind() === 172 /* VoidExpression */; }; return Rules; })(); @@ -30186,20 +30057,20 @@ var TypeScript; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([6 /* MultiLineCommentTrivia */])); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([4 /* MultiLineCommentTrivia */])); TokenRange.Keywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstKeyword, TypeScript.SyntaxKind.LastKeyword); - TokenRange.Operators = TokenRange.FromRange(78 /* SemicolonToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryOperators = TokenRange.FromRange(80 /* LessThanToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([29 /* InKeyword */, 30 /* InstanceOfKeyword */]); + TokenRange.Operators = TokenRange.FromRange(80 /* SemicolonToken */, 121 /* SlashEqualsToken */); + TokenRange.BinaryOperators = TokenRange.FromRange(82 /* LessThanToken */, 121 /* SlashEqualsToken */); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([31 /* InKeyword */, 32 /* InstanceOfKeyword */]); TokenRange.ReservedKeywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword, TypeScript.SyntaxKind.LastFutureReservedStrictKeyword); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([93 /* PlusPlusToken */, 94 /* MinusMinusToken */, 102 /* TildeToken */, 101 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([13 /* NumericLiteral */, 11 /* IdentifierName */, 72 /* OpenParenToken */, 74 /* OpenBracketToken */, 70 /* OpenBraceToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.Comments = TokenRange.FromTokens([7 /* SingleLineCommentTrivia */, 6 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([11 /* IdentifierName */, 67 /* NumberKeyword */, 69 /* StringKeyword */, 61 /* BooleanKeyword */, 41 /* VoidKeyword */, 60 /* AnyKeyword */]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([95 /* PlusPlusToken */, 96 /* MinusMinusToken */, 104 /* TildeToken */, 103 /* ExclamationToken */]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([11 /* NumericLiteral */, 9 /* IdentifierName */, 74 /* OpenParenToken */, 76 /* OpenBracketToken */, 72 /* OpenBraceToken */, 37 /* ThisKeyword */, 33 /* NewKeyword */]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 74 /* OpenParenToken */, 37 /* ThisKeyword */, 33 /* NewKeyword */]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 75 /* CloseParenToken */, 77 /* CloseBracketToken */, 33 /* NewKeyword */]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 74 /* OpenParenToken */, 37 /* ThisKeyword */, 33 /* NewKeyword */]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 75 /* CloseParenToken */, 77 /* CloseBracketToken */, 33 /* NewKeyword */]); + TokenRange.Comments = TokenRange.FromTokens([5 /* SingleLineCommentTrivia */, 4 /* MultiLineCommentTrivia */]); + TokenRange.TypeNames = TokenRange.FromTokens([9 /* IdentifierName */, 69 /* NumberKeyword */, 71 /* StringKeyword */, 63 /* BooleanKeyword */, 43 /* VoidKeyword */, 62 /* AnyKeyword */]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -30338,10 +30209,8 @@ var TypeScript; (function (Services) { var Formatting; (function (Formatting) { - var IndentationTrackingWalker = (function (_super) { - __extends(IndentationTrackingWalker, _super); + var IndentationTrackingWalker = (function () { function IndentationTrackingWalker(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this); this.options = options; this._position = 0; this._parent = null; @@ -30390,17 +30259,34 @@ var TypeScript; if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { this.visitTokenInSpan(token); var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == 5 /* NewLineTrivia */; + this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == 3 /* NewLineTrivia */; } this._position += token.fullWidth(); }; + IndentationTrackingWalker.prototype.walk = function (element) { + if (element) { + if (TypeScript.isToken(element)) { + this.visitToken(element); + } + else if (element.kind() === 1 /* List */) { + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + this.walk(TypeScript.childAt(element, i)); + } + } + else { + this.visitNode(element); + } + } + }; IndentationTrackingWalker.prototype.visitNode = function (node) { var nodeSpan = new TypeScript.TextSpan(this._position, TypeScript.fullWidth(node)); if (nodeSpan.intersectsWithTextSpan(this._textSpan)) { var indentation = this.getNodeIndentation(node); var currentParent = this._parent; this._parent = this._indentationNodeContextPool.getNode(currentParent, node, this._position, indentation.indentationAmount, indentation.indentationAmountDelta); - TypeScript.visitNodeOrToken(this, node); + for (var i = 0, n = TypeScript.childCount(node); i < n; i++) { + this.walk(TypeScript.childAt(node, i)); + } this._indentationNodeContextPool.releaseNode(this._parent); this._parent = currentParent; } @@ -30409,13 +30295,13 @@ var TypeScript; } }; IndentationTrackingWalker.prototype.getTokenIndentationAmount = function (token) { - if (TypeScript.firstToken(this._parent.node()) === token || token.kind() === 70 /* OpenBraceToken */ || token.kind() === 71 /* CloseBraceToken */ || token.kind() === 74 /* OpenBracketToken */ || token.kind() === 75 /* CloseBracketToken */ || (token.kind() === 42 /* WhileKeyword */ && this._parent.node().kind() == 162 /* DoStatement */)) { + if (TypeScript.firstToken(this._parent.node()) === token || token.kind() === 72 /* OpenBraceToken */ || token.kind() === 73 /* CloseBraceToken */ || token.kind() === 76 /* OpenBracketToken */ || token.kind() === 77 /* CloseBracketToken */ || (token.kind() === 44 /* WhileKeyword */ && this._parent.node().kind() == 166 /* DoStatement */)) { return this._parent.indentationAmount(); } return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); }; IndentationTrackingWalker.prototype.getCommentIndentationAmount = function (token) { - if (token.kind() === 71 /* CloseBraceToken */ || token.kind() === 75 /* CloseBracketToken */) { + if (token.kind() === 73 /* CloseBraceToken */ || token.kind() === 77 /* CloseBracketToken */) { return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); } return this._parent.indentationAmount(); @@ -30427,7 +30313,7 @@ var TypeScript; parentIndentationAmount = parent.indentationAmount(); } else { - if (parent.kind() === 147 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { + if (parent.kind() === 151 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { parent = this._parent.parent(); } var line = this._snapshot.getLineFromPosition(parent.start()).getText(); @@ -30443,46 +30329,46 @@ var TypeScript; indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); indentationAmountDelta = 0; break; - case 132 /* ClassDeclaration */: - case 131 /* ModuleDeclaration */: - case 122 /* ObjectType */: - case 133 /* EnumDeclaration */: - case 152 /* SwitchStatement */: - case 216 /* ObjectLiteralExpression */: - case 138 /* ConstructorDeclaration */: - case 130 /* FunctionDeclaration */: - case 223 /* FunctionExpression */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 139 /* IndexMemberDeclaration */: - case 237 /* CatchClause */: - case 215 /* ArrayLiteralExpression */: - case 124 /* ArrayType */: - case 222 /* ElementAccessExpression */: - case 145 /* IndexSignature */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 164 /* WithStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 151 /* ReturnStatement */: - case 158 /* ThrowStatement */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 225 /* VariableDeclaration */: - case 135 /* ExportAssignment */: - case 214 /* InvocationExpression */: - case 217 /* ObjectCreationExpression */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: + case 136 /* ClassDeclaration */: + case 135 /* ModuleDeclaration */: + case 124 /* ObjectType */: + case 137 /* EnumDeclaration */: + case 156 /* SwitchStatement */: + case 179 /* ObjectLiteralExpression */: + case 142 /* ConstructorDeclaration */: + case 134 /* FunctionDeclaration */: + case 186 /* FunctionExpression */: + case 140 /* MemberFunctionDeclaration */: + case 144 /* GetAccessor */: + case 145 /* SetAccessor */: + case 143 /* IndexMemberDeclaration */: + case 201 /* CatchClause */: + case 178 /* ArrayLiteralExpression */: + case 126 /* ArrayType */: + case 185 /* ElementAccessExpression */: + case 149 /* IndexSignature */: + case 159 /* ForStatement */: + case 160 /* ForInStatement */: + case 163 /* WhileStatement */: + case 166 /* DoStatement */: + case 168 /* WithStatement */: + case 198 /* CaseSwitchClause */: + case 199 /* DefaultSwitchClause */: + case 155 /* ReturnStatement */: + case 162 /* ThrowStatement */: + case 183 /* SimpleArrowFunctionExpression */: + case 182 /* ParenthesizedArrowFunctionExpression */: + case 190 /* VariableDeclaration */: + case 139 /* ExportAssignment */: + case 177 /* InvocationExpression */: + case 180 /* ObjectCreationExpression */: + case 147 /* CallSignature */: + case 148 /* ConstructSignature */: indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); indentationAmountDelta = this.options.indentSpaces; break; - case 148 /* IfStatement */: - if (parent.kind() === 236 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { + case 152 /* IfStatement */: + if (parent.kind() === 200 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { indentationAmount = parentIndentationAmount; } else { @@ -30490,11 +30376,11 @@ var TypeScript; } indentationAmountDelta = this.options.indentSpaces; break; - case 236 /* ElseClause */: + case 200 /* ElseClause */: indentationAmount = parentIndentationAmount; indentationAmountDelta = this.options.indentSpaces; break; - case 147 /* Block */: + case 151 /* Block */: if (this.shouldIndentBlockInParent(parent)) { indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; } @@ -30521,11 +30407,11 @@ var TypeScript; }; IndentationTrackingWalker.prototype.shouldIndentBlockInParent = function (parent) { switch (parent.kind()) { - case 120 /* SourceUnit */: - case 131 /* ModuleDeclaration */: - case 147 /* Block */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: + case 122 /* SourceUnit */: + case 135 /* ModuleDeclaration */: + case 151 /* Block */: + case 198 /* CaseSwitchClause */: + case 199 /* DefaultSwitchClause */: return true; default: return false; @@ -30541,7 +30427,7 @@ var TypeScript; } }; return IndentationTrackingWalker; - })(TypeScript.SyntaxWalker); + })(); Formatting.IndentationTrackingWalker = IndentationTrackingWalker; })(Formatting = Services.Formatting || (Services.Formatting = {})); })(Services = TypeScript.Services || (TypeScript.Services = {})); @@ -30591,19 +30477,19 @@ var TypeScript; continue; } switch (trivia.kind()) { - case 6 /* MultiLineCommentTrivia */: + case 4 /* MultiLineCommentTrivia */: this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia); indentNextTokenOrTrivia = false; leadingWhiteSpace = ""; break; - case 7 /* SingleLineCommentTrivia */: - case 8 /* SkippedTokenTrivia */: + case 5 /* SingleLineCommentTrivia */: + case 6 /* SkippedTokenTrivia */: if (indentNextTokenOrTrivia) { this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); indentNextTokenOrTrivia = false; } break; - case 4 /* WhitespaceTrivia */: + case 2 /* WhitespaceTrivia */: var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; if (indentNextTokenOrTrivia) { @@ -30614,7 +30500,7 @@ var TypeScript; } leadingWhiteSpace += trivia.fullText(); break; - case 5 /* NewLineTrivia */: + case 3 /* NewLineTrivia */: indentNextTokenOrTrivia = true; leadingWhiteSpace = ""; break; @@ -30623,7 +30509,7 @@ var TypeScript; } } } - if (token.kind() !== 10 /* EndOfFileToken */ && indentNextTokenOrTrivia) { + if (token.kind() !== 8 /* EndOfFileToken */ && indentNextTokenOrTrivia) { if (indentationString.length > 0) { this.recordEdit(position, 0, indentationString); } @@ -30706,7 +30592,7 @@ var TypeScript; } Formatter.getEdits = function (textSpan, sourceUnit, options, indentFirstToken, snapshot, rulesProvider, formattingRequestKind) { var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - TypeScript.visitNodeOrToken(walker, sourceUnit); + walker.walk(sourceUnit); return walker.edits(); }; Formatter.prototype.visitTokenInSpan = function (token) { @@ -30830,7 +30716,7 @@ var TypeScript; } }; Formatter.prototype.trimWhitespace = function (line, token) { - if (token && (token.kind == 6 /* MultiLineCommentTrivia */ || token.kind == 7 /* SingleLineCommentTrivia */) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) + if (token && (token.kind == 4 /* MultiLineCommentTrivia */ || token.kind == 5 /* SingleLineCommentTrivia */) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) return; var text = line.getText(); var index = 0; @@ -30921,7 +30807,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; - if (precedingToken.kind === 18 /* CommaToken */ && precedingToken.parent.kind !== 147 /* BinaryExpression */) { + if (precedingToken.kind === 22 /* CommaToken */ && precedingToken.parent.kind !== 153 /* BinaryExpression */) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -30977,11 +30863,11 @@ var ts; SmartIndenter.getIndentation = getIndentation; function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { var commaItemInfo = ts.findListItemInfo(commaToken); - ts.Debug.assert(commaItemInfo.listItemIndex > 0); + ts.Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 184 /* SourceFile */ || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 193 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -30992,10 +30878,10 @@ var ts; if (!nextToken) { return false; } - if (nextToken.kind === 9 /* OpenBraceToken */) { + if (nextToken.kind === 13 /* OpenBraceToken */) { return true; } - else if (nextToken.kind === 10 /* CloseBraceToken */) { + else if (nextToken.kind === 14 /* CloseBraceToken */) { var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; return lineAtPosition === nextTokenStartLine; } @@ -31008,9 +30894,9 @@ var ts; return candidate.end > position || !isCompletedNode(candidate, sourceFile); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 154 /* IfStatement */ && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 70 /* ElseKeyword */, sourceFile); - ts.Debug.assert(elseKeyword); + if (parent.kind === 162 /* IfStatement */ && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 74 /* ElseKeyword */, sourceFile); + ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; } @@ -31018,29 +30904,29 @@ var ts; function getActualIndentationForListItem(node, sourceFile, options) { if (node.parent) { switch (node.parent.kind) { - case 127 /* TypeReference */: + case 132 /* TypeReference */: if (node.parent.typeArguments) { return getActualIndentationFromList(node.parent.typeArguments); } break; - case 135 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return getActualIndentationFromList(node.parent.properties); - case 129 /* TypeLiteral */: + case 134 /* TypeLiteral */: return getActualIndentationFromList(node.parent.members); - case 134 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return getActualIndentationFromList(node.parent.elements); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 120 /* Method */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: if (node.parent.typeParameters && node.end < node.parent.typeParameters.end) { return getActualIndentationFromList(node.parent.typeParameters); } return getActualIndentationFromList(node.parent.parameters); - case 140 /* NewExpression */: - case 139 /* CallExpression */: + case 145 /* NewExpression */: + case 144 /* CallExpression */: if (node.parent.typeArguments && node.end < node.parent.typeArguments.end) { return getActualIndentationFromList(node.parent.typeArguments); } @@ -31058,7 +30944,7 @@ var ts; var node = list[index]; var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); for (var i = index - 1; i >= 0; --i) { - if (list[i].kind === 18 /* CommaToken */) { + if (list[i].kind === 22 /* CommaToken */) { continue; } var prevEndLine = sourceFile.getLineAndCharacterFromPosition(list[i].end).line; @@ -31088,45 +30974,45 @@ var ts; } function nodeContentIsIndented(parent, child) { switch (parent.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return true; - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return false; - case 174 /* FunctionDeclaration */: - case 120 /* Method */: - case 143 /* FunctionExpression */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 149 /* FunctionExpression */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: return false; - case 155 /* DoStatement */: - case 156 /* WhileStatement */: - case 158 /* ForInStatement */: - case 157 /* ForStatement */: - return child && child.kind !== 150 /* Block */; - case 154 /* IfStatement */: - return child && child.kind !== 150 /* Block */; - case 168 /* TryStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: + case 166 /* ForInStatement */: + case 165 /* ForStatement */: + return child && child.kind !== 158 /* Block */; + case 162 /* IfStatement */: + return child && child.kind !== 158 /* Block */; + case 176 /* TryStatement */: return false; - case 134 /* ArrayLiteral */: - case 150 /* Block */: - case 175 /* FunctionBlock */: - case 169 /* TryBlock */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 180 /* ModuleBlock */: - case 135 /* ObjectLiteral */: - case 129 /* TypeLiteral */: - case 163 /* SwitchStatement */: - case 165 /* DefaultClause */: - case 164 /* CaseClause */: - case 142 /* ParenExpression */: - case 139 /* CallExpression */: - case 140 /* NewExpression */: - case 151 /* VariableStatement */: - case 173 /* VariableDeclaration */: + case 139 /* ArrayLiteral */: + case 158 /* Block */: + case 183 /* FunctionBlock */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 189 /* ModuleBlock */: + case 140 /* ObjectLiteral */: + case 134 /* TypeLiteral */: + case 171 /* SwitchStatement */: + case 173 /* DefaultClause */: + case 172 /* CaseClause */: + case 148 /* ParenExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + case 159 /* VariableStatement */: + case 181 /* VariableDeclaration */: return true; default: return false; @@ -31139,7 +31025,7 @@ var ts; if (last.kind === expectedLastToken) { return true; } - else if (last.kind === 17 /* SemicolonToken */ && children.length !== 1) { + else if (last.kind === 21 /* SemicolonToken */ && children.length !== 1) { return children[children.length - 2].kind === expectedLastToken; } } @@ -31147,49 +31033,49 @@ var ts; } function isCompletedNode(n, sourceFile) { switch (n.kind) { - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 135 /* ObjectLiteral */: - case 150 /* Block */: - case 170 /* CatchBlock */: - case 171 /* FinallyBlock */: - case 175 /* FunctionBlock */: - case 180 /* ModuleBlock */: - case 163 /* SwitchStatement */: - return nodeEndsWith(n, 10 /* CloseBraceToken */, sourceFile); - case 142 /* ParenExpression */: - case 124 /* CallSignature */: - case 139 /* CallExpression */: - case 125 /* ConstructSignature */: - return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 120 /* Method */: - case 144 /* ArrowFunction */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 140 /* ObjectLiteral */: + case 158 /* Block */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 171 /* SwitchStatement */: + return nodeEndsWith(n, 14 /* CloseBraceToken */, sourceFile); + case 148 /* ParenExpression */: + case 129 /* CallSignature */: + case 144 /* CallExpression */: + case 130 /* ConstructSignature */: + return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 125 /* Method */: + case 150 /* ArrowFunction */: return !n.body || isCompletedNode(n.body, sourceFile); - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 154 /* IfStatement */: + case 162 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 153 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 134 /* ArrayLiteral */: - return nodeEndsWith(n, 14 /* CloseBracketToken */, sourceFile); - case 115 /* Missing */: + case 139 /* ArrayLiteral */: + return nodeEndsWith(n, 18 /* CloseBracketToken */, sourceFile); + case 120 /* Missing */: return false; - case 164 /* CaseClause */: - case 165 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return false; - case 156 /* WhileStatement */: + case 164 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 155 /* DoStatement */: - var hasWhileKeyword = ts.findChildOfKind(n, 94 /* WhileKeyword */, sourceFile); + case 163 /* DoStatement */: + var hasWhileKeyword = ts.findChildOfKind(n, 98 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { - return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); + return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); default: @@ -31234,1203 +31120,6 @@ var TypeScript; TypeScript.createIntrinsicsObject = createIntrinsicsObject; })(TypeScript || (TypeScript = {})); var TypeScript; -(function (TypeScript) { - var Comment = (function () { - function Comment(_trivia, endsLine, _start, _end) { - this._trivia = _trivia; - this.endsLine = endsLine; - this._start = _start; - this._end = _end; - } - Comment.prototype.start = function () { - return this._start; - }; - Comment.prototype.end = function () { - return this._end; - }; - Comment.prototype.fullText = function () { - return this._trivia.fullText(); - }; - Comment.prototype.kind = function () { - return this._trivia.kind(); - }; - Comment.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - return this._trivia.fullText() === ast._trivia.fullText() && this.endsLine === ast.endsLine; - }; - return Comment; - })(); - TypeScript.Comment = Comment; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function walkListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkThrowStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkPrefixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkPostfixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkDeleteExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkTypeArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArguments); - } - function walkTupleTypeChildren(preAst, walker) { - walker.walk(preAst.types); - } - function walkTypeOfExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkVoidExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - function walkArrayLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.expressions); - } - function walkSimplePropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - function walkFunctionPropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkGetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkSeparatedListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkSetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkObjectLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.propertyAssignments); - } - function walkCastExpressionChildren(preAst, walker) { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - function walkParenthesizedExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkElementAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - function walkMemberAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - function walkQualifiedNameChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkBinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkEqualsValueClauseChildren(preAst, walker) { - walker.walk(preAst.value); - } - function walkTypeParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - function walkTypeParameterListChildren(preAst, walker) { - walker.walk(preAst.typeParameters); - } - function walkGenericTypeChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - function walkTypeAnnotationChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkTypeQueryChildren(preAst, walker) { - walker.walk(preAst.name); - } - function walkInvocationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkObjectCreationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkTrinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - function walkFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFunctionTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkParenthesizedArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkSimpleArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.parameter); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkMemberFunctionDeclarationChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFuncDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkIndexMemberDeclarationChildren(preAst, walker) { - walker.walk(preAst.indexSignature); - } - function walkIndexSignatureChildren(preAst, walker) { - walker.walk(preAst.parameters); - walker.walk(preAst.typeAnnotation); - } - function walkCallSignatureChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - function walkConstraintChildren(preAst, walker) { - walker.walk(preAst.typeOrExpression); - } - function walkConstructorDeclarationChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkConstructorTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkConstructSignatureChildren(preAst, walker) { - walker.walk(preAst.callSignature); - } - function walkParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkParameterListChildren(preAst, walker) { - walker.walk(preAst.parameters); - } - function walkPropertySignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - function walkVariableDeclaratorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkMemberVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarator); - } - function walkMethodSignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - function walkReturnStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkForStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - function walkForInStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - function walkIfStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - function walkElseClauseChildren(preAst, walker) { - walker.walk(preAst.statement); - } - function walkWhileStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkDoStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkBlockChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarators); - } - function walkCaseSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - function walkDefaultSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkSwitchStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - function walkTryStatementChildren(preAst, walker) { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - function walkCatchClauseChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - function walkExternalModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.stringLiteral); - } - function walkFinallyClauseChildren(preAst, walker) { - walker.walk(preAst.block); - } - function walkClassDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - function walkScriptChildren(preAst, walker) { - walker.walk(preAst.moduleElements); - } - function walkHeritageClauseChildren(preAst, walker) { - walker.walk(preAst.typeNames); - } - function walkInterfaceDeclerationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - function walkObjectTypeChildren(preAst, walker) { - walker.walk(preAst.typeMembers); - } - function walkArrayTypeChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkModuleDeclarationChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - function walkModuleNameModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.moduleName); - } - function walkEnumDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - function walkEnumElementChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - function walkImportDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - function walkExportAssignmentChildren(preAst, walker) { - walker.walk(preAst.identifier); - } - function walkWithStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkExpressionStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkLabeledStatementChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - function walkVariableStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - } - var childrenWalkers = new Array(TypeScript.SyntaxKind.LastNode + 1); - for (var i = TypeScript.SyntaxKind.FirstToken, n = TypeScript.SyntaxKind.LastToken; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = TypeScript.SyntaxKind.FirstTrivia, n = TypeScript.SyntaxKind.LastTrivia; i <= n; i++) { - childrenWalkers[i] = null; - } - childrenWalkers[176 /* AddAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[209 /* AddExpression */] = walkBinaryExpressionChildren; - childrenWalkers[181 /* AndAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[60 /* AnyKeyword */] = null; - childrenWalkers[227 /* ArgumentList */] = walkArgumentListChildren; - childrenWalkers[215 /* ArrayLiteralExpression */] = walkArrayLiteralExpressionChildren; - childrenWalkers[124 /* ArrayType */] = walkArrayTypeChildren; - childrenWalkers[220 /* SimpleArrowFunctionExpression */] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[219 /* ParenthesizedArrowFunctionExpression */] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[175 /* AssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[192 /* BitwiseAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[191 /* BitwiseExclusiveOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[167 /* BitwiseNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[190 /* BitwiseOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[147 /* Block */] = walkBlockChildren; - childrenWalkers[61 /* BooleanKeyword */] = null; - childrenWalkers[153 /* BreakStatement */] = null; - childrenWalkers[143 /* CallSignature */] = walkCallSignatureChildren; - childrenWalkers[234 /* CaseSwitchClause */] = walkCaseSwitchClauseChildren; - childrenWalkers[221 /* CastExpression */] = walkCastExpressionChildren; - childrenWalkers[237 /* CatchClause */] = walkCatchClauseChildren; - childrenWalkers[132 /* ClassDeclaration */] = walkClassDeclChildren; - childrenWalkers[174 /* CommaExpression */] = walkBinaryExpressionChildren; - childrenWalkers[187 /* ConditionalExpression */] = walkTrinaryExpressionChildren; - childrenWalkers[240 /* Constraint */] = walkConstraintChildren; - childrenWalkers[138 /* ConstructorDeclaration */] = walkConstructorDeclarationChildren; - childrenWalkers[144 /* ConstructSignature */] = walkConstructSignatureChildren; - childrenWalkers[154 /* ContinueStatement */] = null; - childrenWalkers[125 /* ConstructorType */] = walkConstructorTypeChildren; - childrenWalkers[163 /* DebuggerStatement */] = null; - childrenWalkers[235 /* DefaultSwitchClause */] = walkDefaultSwitchClauseChildren; - childrenWalkers[171 /* DeleteExpression */] = walkDeleteExpressionChildren; - childrenWalkers[179 /* DivideAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[207 /* DivideExpression */] = walkBinaryExpressionChildren; - childrenWalkers[162 /* DoStatement */] = walkDoStatementChildren; - childrenWalkers[222 /* ElementAccessExpression */] = walkElementAccessExpressionChildren; - childrenWalkers[236 /* ElseClause */] = walkElseClauseChildren; - childrenWalkers[157 /* EmptyStatement */] = null; - childrenWalkers[133 /* EnumDeclaration */] = walkEnumDeclarationChildren; - childrenWalkers[244 /* EnumElement */] = walkEnumElementChildren; - childrenWalkers[195 /* EqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[233 /* EqualsValueClause */] = walkEqualsValueClauseChildren; - childrenWalkers[193 /* EqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[182 /* ExclusiveOrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[135 /* ExportAssignment */] = walkExportAssignmentChildren; - childrenWalkers[150 /* ExpressionStatement */] = walkExpressionStatementChildren; - childrenWalkers[231 /* ExtendsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[246 /* ExternalModuleReference */] = walkExternalModuleReferenceChildren; - childrenWalkers[24 /* FalseKeyword */] = null; - childrenWalkers[238 /* FinallyClause */] = walkFinallyClauseChildren; - childrenWalkers[156 /* ForInStatement */] = walkForInStatementChildren; - childrenWalkers[155 /* ForStatement */] = walkForStatementChildren; - childrenWalkers[130 /* FunctionDeclaration */] = walkFuncDeclChildren; - childrenWalkers[223 /* FunctionExpression */] = walkFunctionExpressionChildren; - childrenWalkers[242 /* FunctionPropertyAssignment */] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[123 /* FunctionType */] = walkFunctionTypeChildren; - childrenWalkers[126 /* GenericType */] = walkGenericTypeChildren; - childrenWalkers[140 /* GetAccessor */] = walkGetAccessorChildren; - childrenWalkers[198 /* GreaterThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[200 /* GreaterThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[148 /* IfStatement */] = walkIfStatementChildren; - childrenWalkers[232 /* ImplementsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[134 /* ImportDeclaration */] = walkImportDeclarationChildren; - childrenWalkers[139 /* IndexMemberDeclaration */] = walkIndexMemberDeclarationChildren; - childrenWalkers[145 /* IndexSignature */] = walkIndexSignatureChildren; - childrenWalkers[202 /* InExpression */] = walkBinaryExpressionChildren; - childrenWalkers[201 /* InstanceOfExpression */] = walkBinaryExpressionChildren; - childrenWalkers[129 /* InterfaceDeclaration */] = walkInterfaceDeclerationChildren; - childrenWalkers[214 /* InvocationExpression */] = walkInvocationExpressionChildren; - childrenWalkers[161 /* LabeledStatement */] = walkLabeledStatementChildren; - childrenWalkers[184 /* LeftShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[203 /* LeftShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[197 /* LessThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[199 /* LessThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[1 /* List */] = walkListChildren; - childrenWalkers[189 /* LogicalAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[168 /* LogicalNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[188 /* LogicalOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[213 /* MemberAccessExpression */] = walkMemberAccessExpressionChildren; - childrenWalkers[136 /* MemberFunctionDeclaration */] = walkMemberFunctionDeclarationChildren; - childrenWalkers[137 /* MemberVariableDeclaration */] = walkMemberVariableDeclarationChildren; - childrenWalkers[146 /* MethodSignature */] = walkMethodSignatureChildren; - childrenWalkers[131 /* ModuleDeclaration */] = walkModuleDeclarationChildren; - childrenWalkers[247 /* ModuleNameModuleReference */] = walkModuleNameModuleReferenceChildren; - childrenWalkers[180 /* ModuloAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[208 /* ModuloExpression */] = walkBinaryExpressionChildren; - childrenWalkers[178 /* MultiplyAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[206 /* MultiplyExpression */] = walkBinaryExpressionChildren; - childrenWalkers[11 /* IdentifierName */] = null; - childrenWalkers[166 /* NegateExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[0 /* None */] = null; - childrenWalkers[196 /* NotEqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[194 /* NotEqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[32 /* NullKeyword */] = null; - childrenWalkers[67 /* NumberKeyword */] = null; - childrenWalkers[13 /* NumericLiteral */] = null; - childrenWalkers[217 /* ObjectCreationExpression */] = walkObjectCreationExpressionChildren; - childrenWalkers[216 /* ObjectLiteralExpression */] = walkObjectLiteralExpressionChildren; - childrenWalkers[122 /* ObjectType */] = walkObjectTypeChildren; - childrenWalkers[224 /* OmittedExpression */] = null; - childrenWalkers[183 /* OrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[243 /* Parameter */] = walkParameterChildren; - childrenWalkers[228 /* ParameterList */] = walkParameterListChildren; - childrenWalkers[218 /* ParenthesizedExpression */] = walkParenthesizedExpressionChildren; - childrenWalkers[165 /* PlusExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[212 /* PostDecrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[211 /* PostIncrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[170 /* PreDecrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[169 /* PreIncrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[142 /* PropertySignature */] = walkPropertySignatureChildren; - childrenWalkers[121 /* QualifiedName */] = walkQualifiedNameChildren; - childrenWalkers[12 /* RegularExpressionLiteral */] = null; - childrenWalkers[151 /* ReturnStatement */] = walkReturnStatementChildren; - childrenWalkers[120 /* SourceUnit */] = walkScriptChildren; - childrenWalkers[2 /* SeparatedList */] = walkSeparatedListChildren; - childrenWalkers[141 /* SetAccessor */] = walkSetAccessorChildren; - childrenWalkers[185 /* SignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[204 /* SignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[241 /* SimplePropertyAssignment */] = walkSimplePropertyAssignmentChildren; - childrenWalkers[14 /* StringLiteral */] = null; - childrenWalkers[69 /* StringKeyword */] = null; - childrenWalkers[177 /* SubtractAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[210 /* SubtractExpression */] = walkBinaryExpressionChildren; - childrenWalkers[50 /* SuperKeyword */] = null; - childrenWalkers[152 /* SwitchStatement */] = walkSwitchStatementChildren; - childrenWalkers[35 /* ThisKeyword */] = null; - childrenWalkers[158 /* ThrowStatement */] = walkThrowStatementChildren; - childrenWalkers[3 /* TriviaList */] = null; - childrenWalkers[37 /* TrueKeyword */] = null; - childrenWalkers[160 /* TryStatement */] = walkTryStatementChildren; - childrenWalkers[128 /* TupleType */] = walkTupleTypeChildren; - childrenWalkers[245 /* TypeAnnotation */] = walkTypeAnnotationChildren; - childrenWalkers[229 /* TypeArgumentList */] = walkTypeArgumentListChildren; - childrenWalkers[172 /* TypeOfExpression */] = walkTypeOfExpressionChildren; - childrenWalkers[239 /* TypeParameter */] = walkTypeParameterChildren; - childrenWalkers[230 /* TypeParameterList */] = walkTypeParameterListChildren; - childrenWalkers[127 /* TypeQuery */] = walkTypeQueryChildren; - childrenWalkers[186 /* UnsignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[205 /* UnsignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[225 /* VariableDeclaration */] = walkVariableDeclarationChildren; - childrenWalkers[226 /* VariableDeclarator */] = walkVariableDeclaratorChildren; - childrenWalkers[149 /* VariableStatement */] = walkVariableStatementChildren; - childrenWalkers[173 /* VoidExpression */] = walkVoidExpressionChildren; - childrenWalkers[41 /* VoidKeyword */] = null; - childrenWalkers[159 /* WhileStatement */] = walkWhileStatementChildren; - childrenWalkers[164 /* WithStatement */] = walkWithStatementChildren; - for (var e in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind.hasOwnProperty(e) && TypeScript.StringUtilities.isString(TypeScript.SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + TypeScript.SyntaxKind[e]); - } - } - var AstWalkOptions = (function () { - function AstWalkOptions() { - this.goChildren = true; - this.stopWalking = false; - } - return AstWalkOptions; - })(); - TypeScript.AstWalkOptions = AstWalkOptions; - var SimplePreAstWalker = (function () { - function SimplePreAstWalker(pre, state) { - this.pre = pre; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePreAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - }; - return SimplePreAstWalker; - })(); - var SimplePrePostAstWalker = (function () { - function SimplePrePostAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePrePostAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - this.post(ast, this.state); - }; - return SimplePrePostAstWalker; - })(); - var NormalAstWalker = (function () { - function NormalAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - NormalAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - if (this.options.stopWalking) { - return; - } - this.pre(ast, this); - if (this.options.stopWalking) { - return; - } - if (this.options.goChildren) { - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - else { - this.options.goChildren = true; - } - if (this.post) { - this.post(ast, this); - } - }; - return NormalAstWalker; - })(); - var AstWalkerFactory = (function () { - function AstWalkerFactory() { - } - AstWalkerFactory.prototype.walk = function (ast, pre, post, state) { - new NormalAstWalker(pre, post, state).walk(ast); - }; - AstWalkerFactory.prototype.simpleWalk = function (ast, pre, post, state) { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } - else { - new SimplePreAstWalker(pre, state).walk(ast); - } - }; - return AstWalkerFactory; - })(); - TypeScript.AstWalkerFactory = AstWalkerFactory; - var globalAstWalkerFactory = new AstWalkerFactory(); - function getAstWalkerFactory() { - return globalAstWalkerFactory; - } - TypeScript.getAstWalkerFactory = getAstWalkerFactory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ASTHelpers; - (function (ASTHelpers) { - var sentinelEmptyArray = []; - function isValidAstNode(ast) { - return ast && !TypeScript.isShared(ast) && TypeScript.start(ast) !== -1 && TypeScript.end(ast) !== -1; - } - ASTHelpers.isValidAstNode = isValidAstNode; - function isValidSpan(ast) { - if (!ast) - return false; - if (ast.start() === -1 || ast.end() === -1) - return false; - return true; - } - ASTHelpers.isValidSpan = isValidSpan; - function getAstAtPosition(script, pos, useTrailingTriviaAsLimChar, forceInclusive) { - if (useTrailingTriviaAsLimChar === void 0) { useTrailingTriviaAsLimChar = true; } - if (forceInclusive === void 0) { forceInclusive = false; } - var top = null; - var pre = function (cur, walker) { - if (!TypeScript.isShared(cur) && isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === 150 /* ExpressionStatement */ && TypeScript.width(cur) === 0; - if (isInvalid1) { - walker.options.goChildren = false; - } - else { - var inclusive = forceInclusive || cur.kind() === 11 /* IdentifierName */ || cur.kind() === 213 /* MemberAccessExpression */ || cur.kind() === 121 /* QualifiedName */ || cur.kind() === 225 /* VariableDeclaration */ || cur.kind() === 226 /* VariableDeclarator */ || cur.kind() === 214 /* InvocationExpression */ || pos === TypeScript.end(script) + TypeScript.lastToken(script).trailingTriviaWidth(); - var minChar = TypeScript.start(cur); - var limChar = TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - if ((cur.kind() !== 1 /* List */ && cur.kind() !== 2 /* SeparatedList */) || TypeScript.end(cur) > TypeScript.start(cur)) { - if (top === null) { - top = cur; - } - else if (TypeScript.start(cur) >= TypeScript.start(top) && (TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0)) <= (TypeScript.end(top) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(top) : 0))) { - if (TypeScript.width(top) !== 0 || TypeScript.width(cur) !== 0) { - top = cur; - } - } - } - } - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - TypeScript.getAstWalkerFactory().walk(script, pre); - return top; - } - ASTHelpers.getAstAtPosition = getAstAtPosition; - function getExtendsHeritageClause(clauses) { - return getHeritageClause(clauses, 231 /* ExtendsHeritageClause */); - } - ASTHelpers.getExtendsHeritageClause = getExtendsHeritageClause; - function getImplementsHeritageClause(clauses) { - return getHeritageClause(clauses, 232 /* ImplementsHeritageClause */); - } - ASTHelpers.getImplementsHeritageClause = getImplementsHeritageClause; - function getHeritageClause(clauses, kind) { - if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - var child = clauses[i]; - if (child.typeNames.length > 0 && child.kind() === kind) { - return child; - } - } - } - return null; - } - function isCallExpression(ast) { - return (ast && ast.kind() === 214 /* InvocationExpression */) || (ast && ast.kind() === 217 /* ObjectCreationExpression */); - } - ASTHelpers.isCallExpression = isCallExpression; - function isCallExpressionTarget(ast) { - return !!getCallExpressionTarget(ast); - } - ASTHelpers.isCallExpressionTarget = isCallExpressionTarget; - function getCallExpressionTarget(ast) { - if (!ast) { - return null; - } - var current = ast; - while (current && current.parent) { - if (current.parent.kind() === 213 /* MemberAccessExpression */ && current.parent.name === current) { - current = current.parent; - continue; - } - break; - } - if (current && current.parent) { - if (current.parent.kind() === 214 /* InvocationExpression */ || current.parent.kind() === 217 /* ObjectCreationExpression */) { - return current === current.parent.expression ? current : null; - } - } - return null; - } - ASTHelpers.getCallExpressionTarget = getCallExpressionTarget; - function isNameOfSomeDeclaration(ast) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== 11 /* IdentifierName */) { - return false; - } - switch (ast.parent.kind()) { - case 132 /* ClassDeclaration */: - return ast.parent.identifier === ast; - case 129 /* InterfaceDeclaration */: - return ast.parent.identifier === ast; - case 133 /* EnumDeclaration */: - return ast.parent.identifier === ast; - case 131 /* ModuleDeclaration */: - return ast.parent.name === ast || ast.parent.stringLiteral === ast; - case 226 /* VariableDeclarator */: - return ast.parent.propertyName === ast; - case 130 /* FunctionDeclaration */: - return ast.parent.identifier === ast; - case 136 /* MemberFunctionDeclaration */: - return ast.parent.propertyName === ast; - case 243 /* Parameter */: - return ast.parent.identifier === ast; - case 239 /* TypeParameter */: - return ast.parent.identifier === ast; - case 241 /* SimplePropertyAssignment */: - return ast.parent.propertyName === ast; - case 242 /* FunctionPropertyAssignment */: - return ast.parent.propertyName === ast; - case 244 /* EnumElement */: - return ast.parent.propertyName === ast; - case 134 /* ImportDeclaration */: - return ast.parent.identifier === ast; - case 146 /* MethodSignature */: - return ast.parent.propertyName === ast; - case 142 /* PropertySignature */: - return ast.parent.propertyName === ast; - } - return false; - } - function isDeclarationASTOrDeclarationNameAST(ast) { - return isNameOfSomeDeclaration(ast) || ASTHelpers.isDeclarationAST(ast); - } - ASTHelpers.isDeclarationASTOrDeclarationNameAST = isDeclarationASTOrDeclarationNameAST; - function getEnclosingParameterForInitializer(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 233 /* EqualsValueClause */: - if (current.parent && current.parent.kind() === 243 /* Parameter */) { - return current.parent; - } - break; - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingParameterForInitializer = getEnclosingParameterForInitializer; - function getEnclosingMemberDeclaration(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 137 /* MemberVariableDeclaration */: - case 146 /* MethodSignature */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - return current; - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingMemberDeclaration = getEnclosingMemberDeclaration; - function isNameOfFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 130 /* FunctionDeclaration */ && ast.parent.identifier === ast; - } - ASTHelpers.isNameOfFunction = isNameOfFunction; - function isNameOfMemberFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 136 /* MemberFunctionDeclaration */ && ast.parent.propertyName === ast; - } - ASTHelpers.isNameOfMemberFunction = isNameOfMemberFunction; - function isNameOfMemberAccessExpression(ast) { - if (ast && ast.parent && ast.parent.kind() === 213 /* MemberAccessExpression */ && ast.parent.name === ast) { - return true; - } - return false; - } - ASTHelpers.isNameOfMemberAccessExpression = isNameOfMemberAccessExpression; - function isRightSideOfQualifiedName(ast) { - if (ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast) { - return true; - } - return false; - } - ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName; - function parentIsModuleDeclaration(ast) { - return ast.parent && ast.parent.kind() === 131 /* ModuleDeclaration */; - } - ASTHelpers.parentIsModuleDeclaration = parentIsModuleDeclaration; - function isDeclarationAST(ast) { - switch (ast.kind()) { - case 226 /* VariableDeclarator */: - return getVariableStatement(ast) !== null; - case 134 /* ImportDeclaration */: - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 243 /* Parameter */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 145 /* IndexSignature */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 124 /* ArrayType */: - case 122 /* ObjectType */: - case 239 /* TypeParameter */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 137 /* MemberVariableDeclaration */: - case 139 /* IndexMemberDeclaration */: - case 133 /* EnumDeclaration */: - case 244 /* EnumElement */: - case 241 /* SimplePropertyAssignment */: - case 242 /* FunctionPropertyAssignment */: - case 223 /* FunctionExpression */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 146 /* MethodSignature */: - case 142 /* PropertySignature */: - return true; - default: - return false; - } - } - ASTHelpers.isDeclarationAST = isDeclarationAST; - function preComments(element, text) { - if (element) { - switch (element.kind()) { - case 149 /* VariableStatement */: - case 150 /* ExpressionStatement */: - case 132 /* ClassDeclaration */: - case 134 /* ImportDeclaration */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 148 /* IfStatement */: - case 241 /* SimplePropertyAssignment */: - case 136 /* MemberFunctionDeclaration */: - case 129 /* InterfaceDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 151 /* ReturnStatement */: - case 138 /* ConstructorDeclaration */: - case 137 /* MemberVariableDeclaration */: - case 244 /* EnumElement */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 146 /* MethodSignature */: - case 242 /* FunctionPropertyAssignment */: - case 243 /* Parameter */: - return convertNodeLeadingComments(element, text); - } - } - return null; - } - ASTHelpers.preComments = preComments; - function postComments(element, text) { - if (element) { - switch (element.kind()) { - case 150 /* ExpressionStatement */: - return convertNodeTrailingComments(element, text, true); - case 149 /* VariableStatement */: - case 132 /* ClassDeclaration */: - case 134 /* ImportDeclaration */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 148 /* IfStatement */: - case 241 /* SimplePropertyAssignment */: - case 136 /* MemberFunctionDeclaration */: - case 129 /* InterfaceDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 151 /* ReturnStatement */: - case 138 /* ConstructorDeclaration */: - case 137 /* MemberVariableDeclaration */: - case 244 /* EnumElement */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 146 /* MethodSignature */: - case 242 /* FunctionPropertyAssignment */: - case 243 /* Parameter */: - return convertNodeTrailingComments(element, text); - } - } - return null; - } - ASTHelpers.postComments = postComments; - function convertNodeTrailingComments(node, text, allowWithNewLine) { - if (allowWithNewLine === void 0) { allowWithNewLine = false; } - var _lastToken = TypeScript.lastToken(node); - if (_lastToken === null || !_lastToken.hasTrailingTrivia()) { - return null; - } - if (!allowWithNewLine && TypeScript.SyntaxUtilities.isLastTokenOnLine(_lastToken, text)) { - return null; - } - return convertComments(_lastToken.trailingTrivia(text), TypeScript.fullStart(node) + TypeScript.fullWidth(node) - _lastToken.trailingTriviaWidth(text)); - } - function convertNodeLeadingComments(element, text) { - if (element) { - return convertTokenLeadingComments(TypeScript.firstToken(element), text); - } - return null; - } - function convertTokenLeadingComments(token, text) { - if (token === null) { - return null; - } - return token.hasLeadingTrivia() ? convertComments(token.leadingTrivia(text), token.fullStart()) : null; - } - ASTHelpers.convertTokenLeadingComments = convertTokenLeadingComments; - function convertTokenTrailingComments(token, text) { - if (token === null) { - return null; - } - return token.hasTrailingTrivia() ? convertComments(token.trailingTrivia(text), TypeScript.fullEnd(token) - token.trailingTriviaWidth(text)) : null; - } - ASTHelpers.convertTokenTrailingComments = convertTokenTrailingComments; - function convertComments(triviaList, commentStartPosition) { - var result = null; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result = result || []; - result.push(convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - commentStartPosition += trivia.fullWidth(); - } - return result; - } - function convertComment(trivia, commentStartPosition, hasTrailingNewLine) { - var comment = new TypeScript.Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - return comment; - } - function docComments(ast, text) { - if (isDeclarationAST(ast)) { - var comments = null; - if (ast.kind() === 226 /* VariableDeclarator */) { - comments = TypeScript.ASTHelpers.preComments(getVariableStatement(ast), text); - } - else if (ast.kind() === 243 /* Parameter */) { - comments = TypeScript.ASTHelpers.preComments(ast, text); - if (!comments) { - var previousToken = TypeScript.findToken(TypeScript.syntaxTree(ast).sourceUnit(), TypeScript.firstToken(ast).fullStart() - 1); - if (previousToken && (previousToken.kind() === 72 /* OpenParenToken */ || previousToken.kind() === 79 /* CommaToken */)) { - comments = convertTokenTrailingComments(previousToken, text); - } - } - } - else { - comments = TypeScript.ASTHelpers.preComments(ast, text); - } - if (comments && comments.length > 0) { - return comments.filter(function (c) { return isDocComment(c); }); - } - } - return sentinelEmptyArray; - } - ASTHelpers.docComments = docComments; - function isDocComment(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - return false; - } - ASTHelpers.isDocComment = isDocComment; - function getParameterList(ast) { - if (ast) { - switch (ast.kind()) { - case 138 /* ConstructorDeclaration */: - return getParameterList(ast.callSignature); - case 130 /* FunctionDeclaration */: - return getParameterList(ast.callSignature); - case 219 /* ParenthesizedArrowFunctionExpression */: - return getParameterList(ast.callSignature); - case 144 /* ConstructSignature */: - return getParameterList(ast.callSignature); - case 136 /* MemberFunctionDeclaration */: - return getParameterList(ast.callSignature); - case 242 /* FunctionPropertyAssignment */: - return getParameterList(ast.callSignature); - case 223 /* FunctionExpression */: - return getParameterList(ast.callSignature); - case 146 /* MethodSignature */: - return getParameterList(ast.callSignature); - case 125 /* ConstructorType */: - return ast.parameterList; - case 123 /* FunctionType */: - return ast.parameterList; - case 143 /* CallSignature */: - return ast.parameterList; - case 140 /* GetAccessor */: - return getParameterList(ast.callSignature); - case 141 /* SetAccessor */: - return getParameterList(ast.callSignature); - } - } - return null; - } - ASTHelpers.getParameterList = getParameterList; - function getType(ast) { - if (ast) { - switch (ast.kind()) { - case 130 /* FunctionDeclaration */: - return getType(ast.callSignature); - case 219 /* ParenthesizedArrowFunctionExpression */: - return getType(ast.callSignature); - case 144 /* ConstructSignature */: - return getType(ast.callSignature); - case 136 /* MemberFunctionDeclaration */: - return getType(ast.callSignature); - case 242 /* FunctionPropertyAssignment */: - return getType(ast.callSignature); - case 223 /* FunctionExpression */: - return getType(ast.callSignature); - case 146 /* MethodSignature */: - return getType(ast.callSignature); - case 143 /* CallSignature */: - return getType(ast.typeAnnotation); - case 145 /* IndexSignature */: - return getType(ast.typeAnnotation); - case 142 /* PropertySignature */: - return getType(ast.typeAnnotation); - case 140 /* GetAccessor */: - return getType(ast.callSignature); - case 243 /* Parameter */: - return getType(ast.typeAnnotation); - case 137 /* MemberVariableDeclaration */: - return getType(ast.variableDeclarator); - case 226 /* VariableDeclarator */: - return getType(ast.typeAnnotation); - case 237 /* CatchClause */: - return getType(ast.typeAnnotation); - case 125 /* ConstructorType */: - return ast.type; - case 123 /* FunctionType */: - return ast.type; - case 245 /* TypeAnnotation */: - return ast.type; - } - } - return null; - } - ASTHelpers.getType = getType; - function getVariableStatement(variableDeclarator) { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && variableDeclarator.parent.kind() === 2 /* SeparatedList */ && variableDeclarator.parent.parent.kind() === 225 /* VariableDeclaration */ && variableDeclarator.parent.parent.parent.kind() === 149 /* VariableStatement */) { - return variableDeclarator.parent.parent.parent; - } - return null; - } - function getVariableDeclaratorModifiers(variableDeclarator) { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : TypeScript.Syntax.emptyList(); - } - ASTHelpers.getVariableDeclaratorModifiers = getVariableDeclaratorModifiers; - function isIntegerLiteralAST(expression) { - if (expression) { - switch (expression.kind()) { - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - expression = expression.operand; - return expression.kind() === 13 /* NumericLiteral */ && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - ASTHelpers.isIntegerLiteralAST = isIntegerLiteralAST; - function getEnclosingModuleDeclaration(ast) { - while (ast) { - if (ast.kind() === 131 /* ModuleDeclaration */) { - return ast; - } - ast = ast.parent; - } - return null; - } - ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration; - function isEntireNameOfModuleDeclaration(nameAST) { - return parentIsModuleDeclaration(nameAST) && nameAST.parent.name === nameAST; - } - function getModuleDeclarationFromNameAST(ast) { - if (ast) { - switch (ast.kind()) { - case 14 /* StringLiteral */: - if (parentIsModuleDeclaration(ast) && ast.parent.stringLiteral === ast) { - return ast.parent; - } - return null; - case 11 /* IdentifierName */: - case 121 /* QualifiedName */: - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - break; - default: - return null; - } - for (ast = ast.parent; ast && ast.kind() === 121 /* QualifiedName */; ast = ast.parent) { - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - } - } - return null; - } - ASTHelpers.getModuleDeclarationFromNameAST = getModuleDeclarationFromNameAST; - function isLastNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } - else if (ast.name.kind() === 121 /* QualifiedName */) { - return astName === ast.name.right; - } - else { - return astName === ast.name; - } - } - return false; - } - ASTHelpers.isLastNameOfModule = isLastNameOfModule; - function getNameOfIdentifierOrQualifiedName(name) { - if (name.kind() === 11 /* IdentifierName */) { - return name.text(); - } - else { - TypeScript.Debug.assert(name.kind() == 121 /* QualifiedName */); - var dotExpr = name; - return getNameOfIdentifierOrQualifiedName(dotExpr.left) + "." + getNameOfIdentifierOrQualifiedName(dotExpr.right); - } - } - ASTHelpers.getNameOfIdentifierOrQualifiedName = getNameOfIdentifierOrQualifiedName; - function getModuleNames(name, result) { - result = result || []; - if (name.kind() === 121 /* QualifiedName */) { - getModuleNames(name.left, result); - result.push(name.right); - } - else { - result.push(name); - } - return result; - } - ASTHelpers.getModuleNames = getModuleNames; - })(ASTHelpers = TypeScript.ASTHelpers || (TypeScript.ASTHelpers = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { function stripStartAndEndQuotes(str) { var firstCharCode = str && str.charCodeAt(0); @@ -32440,143 +31129,31 @@ var TypeScript; return str; } TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - function isSingleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 39 /* singleQuote */; - } - TypeScript.isSingleQuoted = isSingleQuoted; - function isDoubleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 34 /* doubleQuote */; - } - TypeScript.isDoubleQuoted = isDoubleQuoted; - function isQuoted(str) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - TypeScript.isQuoted = isQuoted; - function quoteStr(str) { - return "\"" + str + "\""; - } - TypeScript.quoteStr = quoteStr; var switchToForwardSlashesRegEx = /\\/g; function switchToForwardSlashes(path) { return path.replace(switchToForwardSlashesRegEx, "/"); } TypeScript.switchToForwardSlashes = switchToForwardSlashes; - function trimModName(modName) { - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - return modName; - } - TypeScript.trimModName = trimModName; - function getDeclareFilePath(fname) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - TypeScript.getDeclareFilePath = getDeclareFilePath; function isFileOfExtension(fname, ext) { var invariantFname = fname.toLocaleUpperCase(); var invariantExt = ext.toLocaleUpperCase(); var extLength = invariantExt.length; return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; } - function isTSFile(fname) { - return isFileOfExtension(fname, ".ts"); - } - TypeScript.isTSFile = isTSFile; function isDTSFile(fname) { return isFileOfExtension(fname, ".d.ts"); } TypeScript.isDTSFile = isDTSFile; - function getPrettyName(modPath, quote, treatAsFileName) { - if (quote === void 0) { quote = true; } - if (treatAsFileName === void 0) { treatAsFileName = false; } - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - TypeScript.getPrettyName = getPrettyName; function getPathComponents(path) { return path.split("/"); } TypeScript.getPathComponents = getPathComponents; - function getRelativePathToFixedPath(fixedModFilePath, absoluteModPath, isAbsoultePathURL) { - if (isAbsoultePathURL === void 0) { isAbsoultePathURL = true; } - absoluteModPath = switchToForwardSlashes(absoluteModPath); - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - return relativePath + relativePathComponents.join("/"); - } - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - return absoluteModPath; - } - TypeScript.getRelativePathToFixedPath = getRelativePathToFixedPath; - function changePathToDTS(modPath) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - TypeScript.changePathToDTS = changePathToDTS; - function isRelative(path) { - return path.length > 0 && path.charAt(0) === "."; - } - TypeScript.isRelative = isRelative; - function isRooted(path) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - TypeScript.isRooted = isRooted; - function getRootFilePath(outFname) { - if (outFname === "") { - return outFname; - } - else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - TypeScript.getRootFilePath = getRootFilePath; - function filePathComponents(fullPath) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - TypeScript.filePathComponents = filePathComponents; - function filePath(fullPath) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - TypeScript.filePath = filePath; - function convertToDirectoryPath(dirPath) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - return dirPath; - } - TypeScript.convertToDirectoryPath = convertToDirectoryPath; var normalizePathRegEx = /^\\\\[^\\]/; function normalizePath(path) { if (normalizePathRegEx.test(path)) { path = "file:" + path; } - var parts = this.getPathComponents(switchToForwardSlashes(path)); + var parts = getPathComponents(switchToForwardSlashes(path)); var normalizedParts = []; for (var i = 0; i < parts.length; i++) { var part = parts[i]; @@ -32595,7 +31172,7 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var ts; (function (ts) { - var scanner = ts.createScanner(1 /* ES5 */, true); + var scanner = ts.createScanner(2 /* Latest */, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { var node = new (ts.getNodeConstructor(kind))(); @@ -32632,6 +31209,9 @@ var ts; NodeObject.prototype.getFullText = function (sourceFile) { return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); }; + NodeObject.prototype.getText = function (sourceFile) { + return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); + }; NodeObject.prototype.addSyntheticNodes = function (nodes, pos, end) { scanner.setTextPos(pos); while (pos < end) { @@ -32643,7 +31223,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(186 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); + var list = createNode(195 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -32661,7 +31241,7 @@ var ts; }; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; - if (this.kind > 115 /* Missing */) { + if (this.kind > 120 /* Missing */) { scanner.setText((sourceFile || this.getSourceFile()).text); var children = []; var pos = this.pos; @@ -32706,9 +31286,9 @@ var ts; var children = this.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - if (child.kind < 115 /* Missing */) + if (child.kind < 120 /* Missing */) return child; - if (child.kind > 115 /* Missing */) + if (child.kind > 120 /* Missing */) return child.getFirstToken(sourceFile); } }; @@ -32716,9 +31296,9 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 115 /* Missing */) + if (child.kind < 120 /* Missing */) return child; - if (child.kind > 115 /* Missing */) + if (child.kind > 120 /* Missing */) return child.getLastToken(sourceFile); } }; @@ -32740,7 +31320,7 @@ var ts; }; SymbolObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 2 /* Property */)); + this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */)); } return this.documentationComment; }; @@ -32761,7 +31341,7 @@ var ts; var jsDocCommentParts = []; ts.forEach(declarations, function (declaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 118 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 123 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -32769,13 +31349,13 @@ var ts; } }); } - if (declaration.kind === 179 /* ModuleDeclaration */ && declaration.body.kind === 179 /* ModuleDeclaration */) { + if (declaration.kind === 188 /* ModuleDeclaration */ && declaration.body.kind === 188 /* ModuleDeclaration */) { return; } - while (declaration.kind === 179 /* ModuleDeclaration */ && declaration.parent.kind === 179 /* ModuleDeclaration */) { + while (declaration.kind === 188 /* ModuleDeclaration */ && declaration.parent.kind === 188 /* ModuleDeclaration */) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 173 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 181 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -33027,25 +31607,19 @@ var ts; SourceFileObject.prototype.getPositionFromLineAndCharacter = function (line, character) { return -1; }; - SourceFileObject.prototype.getSourceUnit = function () { - return this.getSyntaxTree().sourceUnit(); - }; SourceFileObject.prototype.getScriptSnapshot = function () { return this.scriptSnapshot; }; - SourceFileObject.prototype.getLineMap = function () { - return this.getSyntaxTree().lineMap(); - }; SourceFileObject.prototype.getNamedDeclarations = function () { if (!this.namedDeclarations) { var sourceFile = this; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 174 /* FunctionDeclaration */: - case 120 /* Method */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.kind !== 115 /* Missing */) { + if (functionDeclaration.name && functionDeclaration.name.kind !== 120 /* Missing */) { var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { if (functionDeclaration.body && !lastDeclaration.body) { @@ -33058,30 +31632,31 @@ var ts; ts.forEachChild(node, visit); } break; - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: - case 181 /* ImportDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 129 /* TypeLiteral */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 134 /* TypeLiteral */: if (node.name) { namedDeclarations.push(node); } - case 121 /* Constructor */: - case 151 /* VariableStatement */: - case 180 /* ModuleBlock */: - case 175 /* FunctionBlock */: + case 126 /* Constructor */: + case 159 /* VariableStatement */: + case 189 /* ModuleBlock */: + case 183 /* FunctionBlock */: ts.forEachChild(node, visit); break; - case 118 /* Parameter */: - if (!(node.flags & ts.NodeFlags.AccessibilityModifier)) { + case 123 /* Parameter */: + if (!(node.flags & 112 /* AccessibilityModifier */)) { break; } - case 173 /* VariableDeclaration */: - case 183 /* EnumMember */: - case 119 /* Property */: + case 181 /* VariableDeclaration */: + case 192 /* EnumMember */: + case 124 /* Property */: namedDeclarations.push(node); break; } @@ -33090,19 +31665,10 @@ var ts; } return this.namedDeclarations; }; - SourceFileObject.prototype.getSyntaxTree = function () { - if (!this.syntaxTree) { - var start = new Date().getTime(); - this.syntaxTree = TypeScript.Parser.parse(this.filename, TypeScript.SimpleText.fromScriptSnapshot(this.scriptSnapshot), this.languageVersion, this.isDeclareFile()); - var time = new Date().getTime() - start; - } - return this.syntaxTree; - }; SourceFileObject.prototype.isDeclareFile = function () { return TypeScript.isDTSFile(this.filename); }; SourceFileObject.prototype.update = function (scriptSnapshot, version, isOpen, textChangeRange) { - var oldSyntaxTree = this.syntaxTree; if (textChangeRange && ts.Debug.shouldAssert(1 /* Normal */)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; @@ -33116,14 +31682,11 @@ var ts; TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); } } - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var newSyntaxTree = !textChangeRange || !oldSyntaxTree ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); + return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); }; - SourceFileObject.createSourceFileObject = function (filename, scriptSnapshot, languageVersion, version, isOpen, syntaxTree) { + SourceFileObject.createSourceFileObject = function (filename, scriptSnapshot, languageVersion, version, isOpen) { var newSourceFile = ts.createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; - newSourceFile.syntaxTree = syntaxTree; return newSourceFile; }; return SourceFileObject; @@ -33159,19 +31722,6 @@ var ts; SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; })(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); var SymbolDisplayPartKind = ts.SymbolDisplayPartKind; - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(ts.OutputFileType || (ts.OutputFileType = {})); - var OutputFileType = ts.OutputFileType; - (function (EndOfLineState) { - EndOfLineState[EndOfLineState["Start"] = 0] = "Start"; - EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - })(ts.EndOfLineState || (ts.EndOfLineState = {})); - var EndOfLineState = ts.EndOfLineState; (function (TokenClass) { TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; TokenClass[TokenClass["Keyword"] = 1] = "Keyword"; @@ -33193,6 +31743,7 @@ var ts; ScriptElementKind.moduleElement = "module"; ScriptElementKind.classElement = "class"; ScriptElementKind.interfaceElement = "interface"; + ScriptElementKind.typeElement = "type"; ScriptElementKind.enumElement = "enum"; ScriptElementKind.variableElement = "var"; ScriptElementKind.localVariableElement = "local var"; @@ -33211,6 +31762,7 @@ var ts; ScriptElementKind.primitiveType = "primitive type"; ScriptElementKind.label = "label"; ScriptElementKind.alias = "alias"; + ScriptElementKind.constantElement = "constant"; return ScriptElementKind; })(); ts.ScriptElementKind = ScriptElementKind; @@ -33342,21 +31894,21 @@ var ts; } ts.lineBreakPart = lineBreakPart; function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 118 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 123 /* Parameter */; } function isLocalVariableOrFunction(symbol) { if (symbol.parent) { return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 143 /* FunctionExpression */) { + if (declaration.kind === 149 /* FunctionExpression */) { return true; } - if (declaration.kind !== 173 /* VariableDeclaration */ && declaration.kind !== 174 /* FunctionDeclaration */) { + if (declaration.kind !== 181 /* VariableDeclaration */ && declaration.kind !== 182 /* FunctionDeclaration */) { return false; } - for (var parent = declaration.parent; parent.kind !== 175 /* FunctionBlock */; parent = parent.parent) { - if (parent.kind === 184 /* SourceFile */ || parent.kind === 180 /* ModuleBlock */) { + for (var parent = declaration.parent; parent.kind !== 183 /* FunctionBlock */; parent = parent.parent) { + if (parent.kind === 193 /* SourceFile */ || parent.kind === 189 /* ModuleBlock */) { return false; } } @@ -33367,34 +31919,34 @@ var ts; return displayPart(text, displayPartKind(symbol), symbol); function displayPartKind(symbol) { var flags = symbol.flags; - if (flags & 1 /* Variable */) { + if (flags & 3 /* Variable */) { return isFirstDeclarationOfSymbolParameter(symbol) ? 13 /* parameterName */ : 9 /* localName */; } - else if (flags & 2 /* Property */) { + else if (flags & 4 /* Property */) { return 14 /* propertyName */; } - else if (flags & 4 /* EnumMember */) { + else if (flags & 8 /* EnumMember */) { return 19 /* enumMemberName */; } - else if (flags & 8 /* Function */) { + else if (flags & 16 /* Function */) { return 20 /* functionName */; } - else if (flags & 16 /* Class */) { + else if (flags & 32 /* Class */) { return 1 /* className */; } - else if (flags & 32 /* Interface */) { + else if (flags & 64 /* Interface */) { return 4 /* interfaceName */; } - else if (flags & 64 /* Enum */) { + else if (flags & 384 /* Enum */) { return 2 /* enumName */; } - else if (flags & ts.SymbolFlags.Module) { + else if (flags & 1536 /* Module */) { return 11 /* moduleName */; } - else if (flags & 2048 /* Method */) { + else if (flags & 8192 /* Method */) { return 10 /* methodName */; } - else if (flags & 262144 /* TypeParameter */) { + else if (flags & 1048576 /* TypeParameter */) { return 18 /* typeParameterName */; } return 17 /* text */; @@ -33427,7 +31979,7 @@ var ts; } function getDefaultCompilerOptions() { return { - target: 1 /* ES5 */, + target: 2 /* Latest */, module: 0 /* None */ }; } @@ -33543,25 +32095,39 @@ var ts; } SyntaxTreeCache.prototype.initialize = function (filename) { ts.Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); + var start = new Date().getTime(); this.hostCache = new HostCache(this.host); + this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); var syntaxTree = null; var sourceFile; if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); + var start = new Date().getTime(); syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); + this.host.log("SyntaxTreeCache.Initialize: createSyntaxTree: " + (new Date().getTime() - start)); + var start = new Date().getTime(); sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true); + this.host.log("SyntaxTreeCache.Initialize: createSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); + var start = new Date().getTime(); syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); + this.host.log("SyntaxTreeCache.Initialize: updateSyntaxTree: " + (new Date().getTime() - start)); var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); + var start = new Date().getTime(); sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true) : this.currentSourceFile.update(scriptSnapshot, version, true, editRange); + this.host.log("SyntaxTreeCache.Initialize: updateSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } if (syntaxTree !== null) { - ts.Debug.assert(sourceFile); + ts.Debug.assert(sourceFile !== undefined); this.currentFileVersion = version; this.currentFilename = filename; this.currentFileSyntaxTree = syntaxTree; @@ -33642,7 +32208,7 @@ var ts; function createDocumentRegistry() { var buckets = {}; function getKeyFromCompilationSettings(settings) { - return "_" + ts.ScriptTarget[settings.target]; + return "_" + settings.target; } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -33688,9 +32254,9 @@ var ts; } function updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange) { var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); + ts.Debug.assert(bucket !== undefined); var entry = ts.lookUp(bucket, filename); - ts.Debug.assert(entry); + ts.Debug.assert(entry !== undefined); if (entry.sourceFile.isOpen === isOpen && entry.sourceFile.version === version) { return entry.sourceFile; } @@ -33699,7 +32265,7 @@ var ts; } function releaseDocument(filename, compilationSettings) { var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); + ts.Debug.assert(bucket !== undefined); var entry = ts.lookUp(bucket, filename); entry.refCount--; ts.Debug.assert(entry.refCount >= 0); @@ -33735,7 +32301,7 @@ var ts; ts.getNodeModifiers = getNodeModifiers; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 166 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 174 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -33743,13 +32309,13 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 59 /* Identifier */ && (node.parent.kind === 160 /* BreakStatement */ || node.parent.kind === 159 /* ContinueStatement */) && node.parent.label === node; + return node.kind === 63 /* Identifier */ && (node.parent.kind === 168 /* BreakStatement */ || node.parent.kind === 167 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 59 /* Identifier */ && node.parent.kind === 166 /* LabeledStatement */ && node.parent.label === node; + return node.kind === 63 /* Identifier */ && node.parent.kind === 174 /* LabeledStatement */ && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 166 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 174 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -33759,59 +32325,76 @@ var ts; function isLabelName(node) { return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } + function isRightSideOfQualifiedName(node) { + return node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node; + } + function isRightSideOfPropertyAccess(node) { + return node && node.parent && node.parent.kind === 142 /* PropertyAccess */ && node.parent.right === node; + } function isCallExpressionTarget(node) { - if (node.parent.kind === 137 /* PropertyAccess */ && node.parent.right === node) + if (isRightSideOfPropertyAccess(node)) { node = node.parent; - return node.parent.kind === 139 /* CallExpression */ && node.parent.func === node; + } + return node && node.parent && node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; } function isNewExpressionTarget(node) { - if (node.parent.kind === 137 /* PropertyAccess */ && node.parent.right === node) + if (isRightSideOfPropertyAccess(node)) { node = node.parent; - return node.parent.kind === 140 /* NewExpression */ && node.parent.func === node; + } + return node && node.parent && node.parent.kind === 145 /* NewExpression */ && node.parent.func === node; + } + function isNameOfModuleDeclaration(node) { + return node.parent.kind === 188 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 59 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; + return node.kind === 63 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 59 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 136 /* PropertyAssignment */ && node.parent.name === node; + return (node.kind === 63 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 141 /* PropertyAssignment */ && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) { switch (node.parent.kind) { - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 179 /* ModuleDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 188 /* ModuleDeclaration */: return node.parent.name === node; - case 138 /* IndexedAccess */: + case 143 /* IndexedAccess */: return node.parent.index === node; } } return false; } function isNameOfExternalModuleImportOrDeclaration(node) { - return node.kind === 7 /* StringLiteral */ && ((node.parent.kind === 179 /* ModuleDeclaration */ && node.parent.name === node) || (node.parent.kind === 181 /* ImportDeclaration */ && node.parent.externalModuleName === node)); + return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 190 /* ImportDeclaration */ && node.parent.externalModuleName === node)); + } + function isInsideComment(sourceFile, token, position) { + return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + function isInsideCommentRange(comments) { + return ts.forEach(comments, function (comment) { + if (comment.pos < position && position < comment.end) { + return true; + } + else if (position === comment.end) { + var text = sourceFile.text; + var width = comment.end - comment.pos; + if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47 /* slash */) { + return true; + } + else { + return !(text.charCodeAt(comment.end - 1) === 47 /* slash */ && text.charCodeAt(comment.end - 2) === 42 /* asterisk */); + } + } + return false; + }); + } } - var SemanticMeaning; - (function (SemanticMeaning) { - SemanticMeaning[SemanticMeaning["None"] = 0x0] = "None"; - SemanticMeaning[SemanticMeaning["Value"] = 0x1] = "Value"; - SemanticMeaning[SemanticMeaning["Type"] = 0x2] = "Type"; - SemanticMeaning[SemanticMeaning["Namespace"] = 0x4] = "Namespace"; - SemanticMeaning[SemanticMeaning["All"] = SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace] = "All"; - })(SemanticMeaning || (SemanticMeaning = {})); - var BreakContinueSearchType; - (function (BreakContinueSearchType) { - BreakContinueSearchType[BreakContinueSearchType["None"] = 0x0] = "None"; - BreakContinueSearchType[BreakContinueSearchType["Unlabeled"] = 0x1] = "Unlabeled"; - BreakContinueSearchType[BreakContinueSearchType["Labeled"] = 0x2] = "Labeled"; - BreakContinueSearchType[BreakContinueSearchType["All"] = BreakContinueSearchType.Unlabeled | BreakContinueSearchType.Labeled] = "All"; - })(BreakContinueSearchType || (BreakContinueSearchType = {})); var keywordCompletions = []; - for (var i = ts.SyntaxKind.FirstKeyword; i <= ts.SyntaxKind.LastKeyword; i++) { + for (var i = 64 /* FirstKeyword */; i <= 119 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -33968,7 +32551,7 @@ var ts; var displayName = symbol.getName(); if (displayName && displayName.length > 0) { var firstCharCode = displayName.charCodeAt(0); - if ((symbol.flags & ts.SymbolFlags.Namespace) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { + if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { return undefined; } if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { @@ -33996,7 +32579,108 @@ var ts; }; } function getCompletionsAtPosition(filename, position, isMemberCompletion) { + synchronizeHostData(); + filename = TypeScript.switchToForwardSlashes(filename); + var syntacticStart = new Date().getTime(); + var sourceFile = getSourceFile(filename); + var start = new Date().getTime(); + var currentToken = ts.getTokenAtPosition(sourceFile, position); + host.log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + var insideComment = isInsideComment(sourceFile, currentToken, position); + host.log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + if (insideComment) { + host.log("Returning an empty list because completion was inside a comment."); + return undefined; + } + var start = new Date().getTime(); + var previousToken = ts.findPrecedingToken(position, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); + if (previousToken && position <= previousToken.end && previousToken.kind === 63 /* Identifier */) { + var start = new Date().getTime(); + previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); + } + if (previousToken && isCompletionListBlocker(previousToken)) { + host.log("Returning an empty list because completion was requested in an invalid position."); + return undefined; + } + var node; + var isRightOfDot; + if (previousToken && previousToken.kind === 19 /* DotToken */ && (previousToken.parent.kind === 142 /* PropertyAccess */ || previousToken.parent.kind === 121 /* QualifiedName */)) { + node = previousToken.parent.left; + isRightOfDot = true; + } + else { + node = currentToken; + isRightOfDot = false; + } + activeCompletionSession = { + filename: filename, + position: position, + entries: [], + symbols: {}, + typeChecker: typeInfoResolver + }; + host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); + var semanticStart = new Date().getTime(); + if (isRightOfDot) { + var symbols = []; + isMemberCompletion = true; + if (node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */ || node.kind === 142 /* PropertyAccess */) { + var symbol = typeInfoResolver.getSymbolInfo(node); + if (symbol && symbol.flags & 33554432 /* Import */) { + symbol = typeInfoResolver.getAliasedSymbol(symbol); + } + if (symbol && symbol.flags & 1952 /* HasExports */) { + ts.forEachValue(symbol.exports, function (symbol) { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + } + var type = typeInfoResolver.getTypeOfNode(node); + if (type) { + ts.forEach(type.getApparentProperties(), function (symbol) { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + } + else { + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); + if (containingObjectLiteral) { + isMemberCompletion = true; + var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + if (!contextualType) { + return undefined; + } + var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + if (contextualTypeMembers && contextualTypeMembers.length > 0) { + var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); + getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + } + } + else { + isMemberCompletion = false; + var symbolMeanings = 3152352 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 33554432 /* Import */; + var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); + getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + } + } + if (!isMemberCompletion) { + Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); + } + host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); + return { + isMemberCompletion: isMemberCompletion, + entries: activeCompletionSession.entries + }; function getCompletionEntriesFromSymbols(symbols, session) { + var start = new Date().getTime(); ts.forEach(symbols, function (symbol) { var entry = createCompletionEntry(symbol, session.typeChecker); if (entry && !ts.lookUp(session.symbols, entry.name)) { @@ -34004,24 +32688,52 @@ var ts; session.symbols[entry.name] = symbol; } }); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - semanticStart)); } - function isCompletionListBlocker(sourceUnit, position) { - if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) { - return true; + function isCompletionListBlocker(previousToken) { + var start = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - semanticStart)); + return result; + } + function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { + if (previousToken.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(previousToken.kind)) { + var start = previousToken.getStart(); + var end = previousToken.getEnd(); + if (start < position && position < end) { + return true; + } + else if (position === end) { + var width = end - start; + var text = previousToken.getSourceFile().text; + if (width <= 1 || text.charCodeAt(end - 2) === 92 /* backslash */) { + return true; + } + switch (previousToken.kind) { + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + return text.charCodeAt(start) !== text.charCodeAt(end - 1); + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + return text.charCodeAt(end - 1) !== 123 /* openBrace */ || text.charCodeAt(end - 2) !== 36 /* $ */; + case 12 /* TemplateTail */: + return text.charCodeAt(end - 1) !== 96 /* backtick */; + } + return false; + } } - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) || TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) || isIdentifierDefinitionLocation(sourceUnit, position) || isRightOfIllegalDot(sourceUnit, position); + else if (previousToken.kind === 8 /* RegularExpressionLiteral */) { + return previousToken.getStart() < position && position < previousToken.getEnd(); + } + return false; } - function getContainingObjectLiteralApplicableForCompletion(sourceUnit, position) { - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + function getContainingObjectLiteralApplicableForCompletion(previousToken) { if (previousToken) { var parent = previousToken.parent; - switch (previousToken.kind()) { - case 70 /* OpenBraceToken */: - case 79 /* CommaToken */: - if (parent && parent.kind() === 2 /* SeparatedList */) { - parent = parent.parent; - } - if (parent && parent.kind() === 216 /* ObjectLiteralExpression */) { + switch (previousToken.kind) { + case 13 /* OpenBraceToken */: + case 22 /* CommaToken */: + if (parent && parent.kind === 140 /* ObjectLiteral */) { return parent; } break; @@ -34029,76 +32741,75 @@ var ts; } return undefined; } - function isIdentifierDefinitionLocation(sourceUnit, position) { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (positionedToken) { - var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind(); - switch (positionedToken.kind()) { - case 79 /* CommaToken */: - return containingNodeKind === 228 /* ParameterList */ || containingNodeKind === 225 /* VariableDeclaration */ || containingNodeKind === 133 /* EnumDeclaration */; - case 72 /* OpenParenToken */: - return containingNodeKind === 228 /* ParameterList */ || containingNodeKind === 237 /* CatchClause */; - case 70 /* OpenBraceToken */: - return containingNodeKind === 133 /* EnumDeclaration */; - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - case 77 /* DotDotDotToken */: - return containingNodeKind === 243 /* Parameter */; - case 44 /* ClassKeyword */: - case 65 /* ModuleKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - case 27 /* FunctionKeyword */: - case 40 /* VarKeyword */: - case 64 /* GetKeyword */: - case 68 /* SetKeyword */: + function isFunction(kind) { + switch (kind) { + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + return true; + } + return false; + } + function isIdentifierDefinitionLocation(previousToken) { + if (previousToken) { + var containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case 22 /* CommaToken */: + return containingNodeKind === 181 /* VariableDeclaration */ || containingNodeKind === 159 /* VariableStatement */ || containingNodeKind === 187 /* EnumDeclaration */ || isFunction(containingNodeKind); + case 15 /* OpenParenToken */: + return containingNodeKind === 178 /* CatchBlock */ || isFunction(containingNodeKind); + case 13 /* OpenBraceToken */: + return containingNodeKind === 187 /* EnumDeclaration */ || containingNodeKind === 185 /* InterfaceDeclaration */; + case 21 /* SemicolonToken */: + return containingNodeKind === 124 /* Property */ && previousToken.parent.parent.kind === 185 /* InterfaceDeclaration */; + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 107 /* StaticKeyword */: + case 20 /* DotDotDotToken */: + return containingNodeKind === 123 /* Parameter */; + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 101 /* InterfaceKeyword */: + case 81 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 113 /* GetKeyword */: + case 117 /* SetKeyword */: return true; } - switch (positionedToken.text()) { + switch (previousToken.getText()) { case "class": case "interface": case "enum": case "module": + case "function": + case "var": return true; } } return false; } - function getNonIdentifierCompleteTokenOnLeft(sourceUnit, position) { - var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, true); - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == 10 /* EndOfFileToken */) { - positionedToken = TypeScript.previousToken(positionedToken, true); - } - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === 11 /* IdentifierName */) { - positionedToken = TypeScript.previousToken(positionedToken, true); - } - return positionedToken; - } - function isRightOfIllegalDot(sourceUnit, position) { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (positionedToken) { - switch (positionedToken.kind()) { - case 76 /* DotToken */: - var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, true); - return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === 13 /* NumericLiteral */; - case 13 /* NumericLiteral */: - var text = positionedToken.text(); - return text.charAt(text.length - 1) === "."; - } + function isRightOfIllegalDot(previousToken) { + if (previousToken && previousToken.kind === 6 /* NumericLiteral */) { + var text = previousToken.getFullText(); + return text.charAt(text.length - 1) === "."; } return false; } - function isPunctuation(kind) { - return (ts.SyntaxKind.FirstPunctuation <= kind && kind <= ts.SyntaxKind.LastPunctuation); - } function filterContextualMembersList(contextualMemberSymbols, existingMembers) { if (!existingMembers || existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 136 /* PropertyAssignment */) { + if (m.kind !== 141 /* PropertyAssignment */) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -34114,114 +32825,10 @@ var ts; }); return filteredMembers; } - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getSourceFile(filename); - var sourceUnit = sourceFile.getSourceUnit(); - if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) { - host.log("Returning an empty list because completion was blocked."); - return null; - } - var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, true, true); - if (node && node.kind() === 11 /* IdentifierName */ && TypeScript.start(node) === TypeScript.end(node)) { - node = node.parent; - } - var isRightOfDot = false; - if (node && node.kind() === 213 /* MemberAccessExpression */ && TypeScript.end(node.expression) < position) { - isRightOfDot = true; - node = node.expression; - } - else if (node && node.kind() === 121 /* QualifiedName */ && TypeScript.end(node.left) < position) { - isRightOfDot = true; - node = node.left; - } - else if (node && node.parent && node.kind() === 11 /* IdentifierName */ && node.parent.kind() === 213 /* MemberAccessExpression */ && node.parent.name === node) { - isRightOfDot = true; - node = node.parent.expression; - } - else if (node && node.parent && node.kind() === 11 /* IdentifierName */ && node.parent.kind() === 121 /* QualifiedName */ && node.parent.right === node) { - isRightOfDot = true; - node = node.parent.left; - } - var precedingToken = ts.findTokenOnLeftOfPosition(sourceFile, TypeScript.end(node)); - var mappedNode; - if (!precedingToken) { - mappedNode = sourceFile; - } - else if (isPunctuation(precedingToken.kind)) { - mappedNode = precedingToken.parent; - } - else { - mappedNode = precedingToken; - } - ts.Debug.assert(mappedNode, "Could not map a Fidelity node to an AST node"); - activeCompletionSession = { - filename: filename, - position: position, - entries: [], - symbols: {}, - location: mappedNode, - typeChecker: typeInfoResolver - }; - if (isRightOfDot) { - var symbols = []; - isMemberCompletion = true; - if (mappedNode.kind === 59 /* Identifier */ || mappedNode.kind === 116 /* QualifiedName */ || mappedNode.kind === 137 /* PropertyAccess */) { - var symbol = typeInfoResolver.getSymbolInfo(mappedNode); - if (symbol && symbol.flags & 4194304 /* Import */) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); - } - if (symbol && symbol.flags & ts.SymbolFlags.HasExports) { - ts.forEachValue(symbol.exports, function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - } - var type = typeInfoResolver.getTypeOfNode(mappedNode); - if (type) { - ts.forEach(type.getApparentProperties(), function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); - if (containingObjectLiteral) { - var objectLiteral = (mappedNode.kind === 135 /* ObjectLiteral */ ? mappedNode : ts.getAncestor(mappedNode, 135 /* ObjectLiteral */)); - ts.Debug.assert(objectLiteral); - isMemberCompletion = true; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - if (!contextualType) { - return undefined; - } - var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); - if (contextualTypeMembers && contextualTypeMembers.length > 0) { - var filteredMembers = filterContextualMembersList(contextualTypeMembers, objectLiteral.properties); - getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); - } - } - else { - isMemberCompletion = false; - var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace | 4194304 /* Import */; - var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - } - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - return { - isMemberCompletion: isMemberCompletion, - entries: activeCompletionSession.entries - }; } function getCompletionEntryDetails(filename, position, entryName) { filename = TypeScript.switchToForwardSlashes(filename); + var sourceFile = getSourceFile(filename); var session = activeCompletionSession; if (!session || session.filename !== filename || session.position !== position) { return undefined; @@ -34229,9 +32836,10 @@ var ts; var symbol = ts.lookUp(activeCompletionSession.symbols, entryName); if (symbol) { var type = session.typeChecker.getTypeOfSymbol(symbol); - ts.Debug.assert(type, "Could not find type for symbol"); + ts.Debug.assert(type !== undefined, "Could not find type for symbol"); var completionEntry = createCompletionEntry(symbol, session.typeChecker); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), session.location, session.typeChecker, session.location, SemanticMeaning.All); + var location = ts.getTouchingPropertyName(sourceFile, position); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, 7 /* All */); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -34257,37 +32865,39 @@ var ts; return node; } switch (node.kind) { - case 184 /* SourceFile */: - case 120 /* Method */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* ClassDeclaration */: - case 177 /* InterfaceDeclaration */: - case 178 /* EnumDeclaration */: - case 179 /* ModuleDeclaration */: + case 193 /* SourceFile */: + case 125 /* Method */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: return node; } } } function getSymbolKind(symbol, typeResolver) { var flags = symbol.getFlags(); - if (flags & 16 /* Class */) + if (flags & 32 /* Class */) return ScriptElementKind.classElement; - if (flags & 64 /* Enum */) + if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 32 /* Interface */) + if (flags & 2097152 /* TypeAlias */) + return ScriptElementKind.typeElement; + if (flags & 64 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 262144 /* TypeParameter */) + if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver); if (result === ScriptElementKind.unknown) { - if (flags & 262144 /* TypeParameter */) + if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 4 /* EnumMember */) + if (flags & 8 /* EnumMember */) return ScriptElementKind.variableElement; - if (flags & 4194304 /* Import */) + if (flags & 33554432 /* Import */) return ScriptElementKind.alias; } return result; @@ -34299,34 +32909,37 @@ var ts; if (typeResolver.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } - if (flags & 1 /* Variable */) { + if (flags & 3 /* Variable */) { if (isFirstDeclarationOfSymbolParameter(symbol)) { return ScriptElementKind.parameterElement; } + else if (symbol.valueDeclaration && symbol.valueDeclaration.flags & 4096 /* Const */) { + return ScriptElementKind.constantElement; + } return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; } - if (flags & 8 /* Function */) + if (flags & 16 /* Function */) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 8192 /* GetAccessor */) + if (flags & 32768 /* GetAccessor */) return ScriptElementKind.memberGetAccessorElement; - if (flags & 16384 /* SetAccessor */) + if (flags & 65536 /* SetAccessor */) return ScriptElementKind.memberSetAccessorElement; - if (flags & 2048 /* Method */) + if (flags & 8192 /* Method */) return ScriptElementKind.memberFunctionElement; - if (flags & 4096 /* Constructor */) + if (flags & 16384 /* Constructor */) return ScriptElementKind.constructorImplementationElement; - if (flags & 2 /* Property */) { - if (flags & 134217728 /* UnionProperty */) { + if (flags & 4 /* Property */) { + if (flags & 1073741824 /* UnionProperty */) { return ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & 2 /* Property */) { + if (rootSymbolFlags & 4 /* Property */) { return ScriptElementKind.memberVariableElement; } - if (rootSymbolFlags & 8192 /* GetAccessor */) + if (rootSymbolFlags & 32768 /* GetAccessor */) return ScriptElementKind.memberVariableElement; - if (rootSymbolFlags & 16384 /* SetAccessor */) + if (rootSymbolFlags & 65536 /* SetAccessor */) return ScriptElementKind.memberVariableElement; - ts.Debug.assert(rootSymbolFlags & 2048 /* Method */); + ts.Debug.assert((rootSymbolFlags & 8192 /* Method */) !== undefined); }) || ScriptElementKind.memberFunctionElement; } return ScriptElementKind.memberVariableElement; @@ -34343,7 +32956,7 @@ var ts; return ScriptElementKind.interfaceElement; if (flags & 512 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & ts.TypeFlags.Intrinsic) + if (flags & 127 /* Intrinsic */) return ScriptElementKind.primitiveType; if (flags & 256 /* StringLiteral */) return ScriptElementKind.primitiveType; @@ -34351,42 +32964,26 @@ var ts; } function getNodeKind(node) { switch (node.kind) { - case 179 /* ModuleDeclaration */: - return ScriptElementKind.moduleElement; - case 176 /* ClassDeclaration */: - return ScriptElementKind.classElement; - case 177 /* InterfaceDeclaration */: - return ScriptElementKind.interfaceElement; - case 178 /* EnumDeclaration */: - return ScriptElementKind.enumElement; - case 173 /* VariableDeclaration */: - return ScriptElementKind.variableElement; - case 174 /* FunctionDeclaration */: - return ScriptElementKind.functionElement; - case 122 /* GetAccessor */: - return ScriptElementKind.memberGetAccessorElement; - case 123 /* SetAccessor */: - return ScriptElementKind.memberSetAccessorElement; - case 120 /* Method */: - return ScriptElementKind.memberFunctionElement; - case 119 /* Property */: - return ScriptElementKind.memberVariableElement; - case 126 /* IndexSignature */: - return ScriptElementKind.indexSignatureElement; - case 125 /* ConstructSignature */: - return ScriptElementKind.constructSignatureElement; - case 124 /* CallSignature */: - return ScriptElementKind.callSignatureElement; - case 121 /* Constructor */: - return ScriptElementKind.constructorImplementationElement; - case 117 /* TypeParameter */: - return ScriptElementKind.typeParameterElement; - case 183 /* EnumMember */: - return ScriptElementKind.variableElement; - case 118 /* Parameter */: - return (node.flags & ts.NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - return ScriptElementKind.unknown; + case 188 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 184 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 185 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 186 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 187 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 181 /* VariableDeclaration */: return node.flags & 4096 /* Const */ ? ScriptElementKind.constantElement : ScriptElementKind.variableElement; + case 182 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 127 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 128 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 125 /* Method */: return ScriptElementKind.memberFunctionElement; + case 124 /* Property */: return ScriptElementKind.memberVariableElement; + case 131 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 130 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 129 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 126 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 122 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 192 /* EnumMember */: return ScriptElementKind.variableElement; + case 123 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; } + return ScriptElementKind.unknown; } function getSymbolModifiers(symbol) { return symbol && symbol.declarations && symbol.declarations.length > 0 ? getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; @@ -34398,41 +32995,49 @@ var ts; var symbolFlags = symbol.flags; var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver); var hasAddedSymbolInfo; - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 16 /* Class */ || symbolFlags & 4194304 /* Import */) { + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 33554432 /* Import */) { if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } var type = typeResolver.getTypeOfSymbol(symbol); if (type) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - var callExpression; - if (location.parent.kind === 137 /* PropertyAccess */ && location.parent.right === location) { + if (location.parent && location.parent.kind === 142 /* PropertyAccess */) { + var right = location.parent.right; + if (right === location || (right && right.kind === 120 /* Missing */)) { location = location.parent; } + } + var callExpression; + if (location.kind === 144 /* CallExpression */ || location.kind === 145 /* NewExpression */) { + callExpression = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { callExpression = location.parent; + } + if (callExpression) { var candidateSignatures = []; signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 140 /* NewExpression */ || callExpression.func.kind === 85 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 145 /* NewExpression */ || callExpression.func.kind === 89 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; } if (signature) { - if (useConstructSignatures && (symbolFlags & 16 /* Class */)) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - else if (symbolFlags & 4194304 /* Import */) { + else if (symbolFlags & 33554432 /* Import */) { symbolKind = ScriptElementKind.alias; - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(textPart(symbolKind)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); displayParts.push(spacePart()); if (useConstructSignatures) { - displayParts.push(keywordPart(82 /* NewKeyword */)); + displayParts.push(keywordPart(86 /* NewKeyword */)); displayParts.push(spacePart()); } addFullSymbolName(symbol); @@ -34443,12 +33048,13 @@ var ts; switch (symbolKind) { case ScriptElementKind.memberVariableElement: case ScriptElementKind.variableElement: + case ScriptElementKind.constantElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: - displayParts.push(punctuationPart(46 /* ColonToken */)); + displayParts.push(punctuationPart(50 /* ColonToken */)); displayParts.push(spacePart()); if (useConstructSignatures) { - displayParts.push(keywordPart(82 /* NewKeyword */)); + displayParts.push(keywordPart(86 /* NewKeyword */)); displayParts.push(spacePart()); } if (!(type.flags & 32768 /* Anonymous */)) { @@ -34462,108 +33068,118 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & ts.SymbolFlags.Accessor)) || (location.kind === 107 /* ConstructorKeyword */ && location.parent.kind === 121 /* Constructor */)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || (location.kind === 111 /* ConstructorKeyword */ && location.parent.kind === 126 /* Constructor */)) { var signature; var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 121 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 126 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 121 /* Constructor */) { + if (functionDeclaration.kind === 126 /* Constructor */) { addPrefixForAnyFunctionOrVar(type.symbol, ScriptElementKind.constructorImplementationElement); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 124 /* CallSignature */ && !(type.symbol.flags & 512 /* TypeLiteral */ || type.symbol.flags & 1024 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 129 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } - if (symbolFlags & 16 /* Class */ && !hasAddedSymbolInfo) { - displayParts.push(keywordPart(63 /* ClassKeyword */)); + if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { + displayParts.push(keywordPart(67 /* ClassKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if ((symbolFlags & 32 /* Interface */) && (semanticMeaning & 2 /* Type */)) { + if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(97 /* InterfaceKeyword */)); + displayParts.push(keywordPart(101 /* InterfaceKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if (symbolFlags & 64 /* Enum */) { + if (symbolFlags & 2097152 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(71 /* EnumKeyword */)); + displayParts.push(keywordPart(119 /* TypeKeyword */)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(punctuationPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + } + if (symbolFlags & 384 /* Enum */) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(75 /* EnumKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); } - if (symbolFlags & ts.SymbolFlags.Module) { + if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(110 /* ModuleKeyword */)); + displayParts.push(keywordPart(114 /* ModuleKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); } - if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { + if ((symbolFlags & 1048576 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(textPart("type parameter")); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); displayParts.push(spacePart()); addFullSymbolName(symbol); displayParts.push(spacePart()); - displayParts.push(keywordPart(80 /* InKeyword */)); + displayParts.push(keywordPart(84 /* InKeyword */)); displayParts.push(spacePart()); if (symbol.parent) { addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 117 /* TypeParameter */).parent; + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 122 /* TypeParameter */).parent; var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 125 /* ConstructSignature */) { - displayParts.push(keywordPart(82 /* NewKeyword */)); + if (signatureDeclaration.kind === 130 /* ConstructSignature */) { + displayParts.push(keywordPart(86 /* NewKeyword */)); displayParts.push(spacePart()); } - else if (signatureDeclaration.kind !== 124 /* CallSignature */ && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 129 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } } - if (symbolFlags & 4 /* EnumMember */) { + if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 183 /* EnumMember */) { + if (declaration.kind === 192 /* EnumMember */) { var constantValue = typeResolver.getEnumMemberValue(declaration); if (constantValue !== undefined) { displayParts.push(spacePart()); - displayParts.push(operatorPart(47 /* EqualsToken */)); + displayParts.push(operatorPart(51 /* EqualsToken */)); displayParts.push(spacePart()); displayParts.push(displayPart(constantValue.toString(), 7 /* numericLiteral */)); } } } - if (symbolFlags & 4194304 /* Import */) { + if (symbolFlags & 33554432 /* Import */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(79 /* ImportKeyword */)); + displayParts.push(keywordPart(83 /* ImportKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); displayParts.push(spacePart()); - displayParts.push(punctuationPart(47 /* EqualsToken */)); + displayParts.push(punctuationPart(51 /* EqualsToken */)); displayParts.push(spacePart()); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 181 /* ImportDeclaration */) { + if (declaration.kind === 190 /* ImportDeclaration */) { var importDeclaration = declaration; if (importDeclaration.externalModuleName) { - displayParts.push(keywordPart(111 /* RequireKeyword */)); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(keywordPart(115 /* RequireKeyword */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(displayPart(ts.getTextOfNode(importDeclaration.externalModuleName), 8 /* stringLiteral */)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); } else { var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); @@ -34577,10 +33193,10 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 1 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { - displayParts.push(punctuationPart(46 /* ColonToken */)); + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 3 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { + displayParts.push(punctuationPart(50 /* ColonToken */)); displayParts.push(spacePart()); - if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { + if (type.symbol && type.symbol.flags & 1048576 /* TypeParameter */) { var typeParameterParts = mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); @@ -34590,7 +33206,7 @@ var ts; displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); } } - else if (symbolFlags & 8 /* Function */ || symbolFlags & 2048 /* Method */ || symbolFlags & 4096 /* Constructor */ || symbolFlags & ts.SymbolFlags.Signature || symbolFlags & ts.SymbolFlags.Accessor || symbolKind === ScriptElementKind.memberFunctionElement) { + else if (symbolFlags & 16 /* Function */ || symbolFlags & 8192 /* Method */ || symbolFlags & 16384 /* Constructor */ || symbolFlags & 917504 /* Signature */ || symbolFlags & 98304 /* Accessor */ || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); } @@ -34616,9 +33232,9 @@ var ts; function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { addNewLineIfDisplayPartsExist(); if (symbolKind) { - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(textPart(symbolKind)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); displayParts.push(spacePart()); addFullSymbolName(symbol); } @@ -34627,12 +33243,12 @@ var ts; displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(spacePart()); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(operatorPart(28 /* PlusToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(operatorPart(32 /* PlusToken */)); displayParts.push(displayPart((allSignatures.length - 1).toString(), 7 /* numericLiteral */)); displayParts.push(spacePart()); displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); } @@ -34654,11 +33270,11 @@ var ts; var symbol = typeInfoResolver.getSymbolInfo(node); if (!symbol) { switch (node.kind) { - case 59 /* Identifier */: - case 137 /* PropertyAccess */: - case 116 /* QualifiedName */: - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = typeInfoResolver.getTypeOfNode(node); if (type) { return { @@ -34696,7 +33312,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 121 /* Constructor */) || (!selectConstructors && (d.kind === 174 /* FunctionDeclaration */ || d.kind === 120 /* Method */))) { + if ((selectConstructors && d.kind === 126 /* Constructor */) || (!selectConstructors && (d.kind === 182 /* FunctionDeclaration */ || d.kind === 125 /* Method */))) { declarations.push(d); if (d.body) definition = d; @@ -34713,10 +33329,10 @@ var ts; return false; } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 107 /* ConstructorKeyword */) { - if (symbol.flags & 16 /* Class */) { + if (isNewExpressionTarget(location) || location.kind === 111 /* ConstructorKeyword */) { + if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 176 /* ClassDeclaration */); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 184 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -34781,94 +33397,94 @@ var ts; if (!node) { return undefined; } - if (node.kind === 59 /* Identifier */ || node.kind === 87 /* ThisKeyword */ || node.kind === 85 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind === 63 /* Identifier */ || node.kind === 91 /* ThisKeyword */ || node.kind === 89 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { return getReferencesForNode(node, [sourceFile], false, false); } switch (node.kind) { - case 78 /* IfKeyword */: - case 70 /* ElseKeyword */: - if (hasKind(node.parent, 154 /* IfStatement */)) { + case 82 /* IfKeyword */: + case 74 /* ElseKeyword */: + if (hasKind(node.parent, 162 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; - case 84 /* ReturnKeyword */: - if (hasKind(node.parent, 161 /* ReturnStatement */)) { + case 88 /* ReturnKeyword */: + if (hasKind(node.parent, 169 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; - case 88 /* ThrowKeyword */: - if (hasKind(node.parent, 167 /* ThrowStatement */)) { + case 92 /* ThrowKeyword */: + if (hasKind(node.parent, 175 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - if (hasKind(parent(parent(node)), 168 /* TryStatement */)) { + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: + if (hasKind(parent(parent(node)), 176 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; - case 86 /* SwitchKeyword */: - if (hasKind(node.parent, 163 /* SwitchStatement */)) { + case 90 /* SwitchKeyword */: + if (hasKind(node.parent, 171 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; - case 61 /* CaseKeyword */: - case 67 /* DefaultKeyword */: - if (hasKind(parent(parent(node)), 163 /* SwitchStatement */)) { + case 65 /* CaseKeyword */: + case 71 /* DefaultKeyword */: + if (hasKind(parent(parent(node)), 171 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent); } break; - case 60 /* BreakKeyword */: - case 65 /* ContinueKeyword */: - if (hasKind(node.parent, 160 /* BreakStatement */) || hasKind(node.parent, 159 /* ContinueStatement */)) { + case 64 /* BreakKeyword */: + case 69 /* ContinueKeyword */: + if (hasKind(node.parent, 168 /* BreakStatement */) || hasKind(node.parent, 167 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurences(node.parent); } break; - case 76 /* ForKeyword */: - if (hasKind(node.parent, 157 /* ForStatement */) || hasKind(node.parent, 158 /* ForInStatement */)) { + case 80 /* ForKeyword */: + if (hasKind(node.parent, 165 /* ForStatement */) || hasKind(node.parent, 166 /* ForInStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 94 /* WhileKeyword */: - case 69 /* DoKeyword */: - if (hasKind(node.parent, 156 /* WhileStatement */) || hasKind(node.parent, 155 /* DoStatement */)) { + case 98 /* WhileKeyword */: + case 73 /* DoKeyword */: + if (hasKind(node.parent, 164 /* WhileStatement */) || hasKind(node.parent, 163 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 107 /* ConstructorKeyword */: - if (hasKind(node.parent, 121 /* Constructor */)) { + case 111 /* ConstructorKeyword */: + if (hasKind(node.parent, 126 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; - case 109 /* GetKeyword */: - case 113 /* SetKeyword */: - if (hasKind(node.parent, 122 /* GetAccessor */) || hasKind(node.parent, 123 /* SetAccessor */)) { + case 113 /* GetKeyword */: + case 117 /* SetKeyword */: + if (hasKind(node.parent, 127 /* GetAccessor */) || hasKind(node.parent, 128 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } } return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 154 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 162 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 78 /* IfKeyword */); + pushKeywordIf(keywords, children[0], 82 /* IfKeyword */); for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 70 /* ElseKeyword */)) { + if (pushKeywordIf(keywords, children[i], 74 /* ElseKeyword */)) { break; } } - if (!hasKind(ifStatement.elseStatement, 154 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 162 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; } var result = []; for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 70 /* ElseKeyword */ && i < keywords.length - 1) { + if (keywords[i].kind === 74 /* ElseKeyword */ && i < keywords.length - 1) { var elseKeyword = keywords[i]; var ifKeyword = keywords[i + 1]; var shouldHighlightNextKeyword = true; @@ -34894,15 +33510,15 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 175 /* FunctionBlock */))) { + if (!(func && hasKind(func.body, 183 /* FunctionBlock */))) { return undefined; } var keywords = []; ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); }); ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); }); return ts.map(keywords, getReferenceEntryFromNode); } @@ -34913,11 +33529,11 @@ var ts; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); }); - if (owner.kind === 175 /* FunctionBlock */) { + if (owner.kind === 183 /* FunctionBlock */) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); }); } return ts.map(keywords, getReferenceEntryFromNode); @@ -34927,10 +33543,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 167 /* ThrowStatement */) { + if (node.kind === 175 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 168 /* TryStatement */) { + else if (node.kind === 176 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchBlock) { aggregate(tryStatement.catchBlock); @@ -34952,10 +33568,10 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (parent.kind === 175 /* FunctionBlock */ || parent.kind === 184 /* SourceFile */) { + if (parent.kind === 183 /* FunctionBlock */ || parent.kind === 193 /* SourceFile */) { return parent; } - if (parent.kind === 168 /* TryStatement */) { + if (parent.kind === 176 /* TryStatement */) { var tryStatement = parent; if (tryStatement.tryBlock === child && tryStatement.catchBlock) { return child; @@ -34967,22 +33583,22 @@ var ts; } function getTryCatchFinallyOccurrences(tryStatement) { var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 90 /* TryKeyword */); + pushKeywordIf(keywords, tryStatement.getFirstToken(), 94 /* TryKeyword */); if (tryStatement.catchBlock) { - pushKeywordIf(keywords, tryStatement.catchBlock.getFirstToken(), 62 /* CatchKeyword */); + pushKeywordIf(keywords, tryStatement.catchBlock.getFirstToken(), 66 /* CatchKeyword */); } if (tryStatement.finallyBlock) { - pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), 75 /* FinallyKeyword */); + pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), 79 /* FinallyKeyword */); } return ts.map(keywords, getReferenceEntryFromNode); } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 76 /* ForKeyword */, 94 /* WhileKeyword */, 69 /* DoKeyword */)) { - if (loopNode.kind === 155 /* DoStatement */) { + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 80 /* ForKeyword */, 98 /* WhileKeyword */, 73 /* DoKeyword */)) { + if (loopNode.kind === 163 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 94 /* WhileKeyword */)) { + if (pushKeywordIf(keywords, loopTokens[i], 98 /* WhileKeyword */)) { break; } } @@ -34991,21 +33607,21 @@ var ts; var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 60 /* BreakKeyword */, 65 /* ContinueKeyword */); + pushKeywordIf(keywords, statement.getFirstToken(), 64 /* BreakKeyword */, 69 /* ContinueKeyword */); } }); return ts.map(keywords, getReferenceEntryFromNode); } function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 86 /* SwitchKeyword */); - var breakSearchType = BreakContinueSearchType.All; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 90 /* SwitchKeyword */); + var breakSearchType = 3 /* All */; ts.forEach(switchStatement.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 61 /* CaseKeyword */, 67 /* DefaultKeyword */); + pushKeywordIf(keywords, clause.getFirstToken(), 65 /* CaseKeyword */, 71 /* DefaultKeyword */); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 60 /* BreakKeyword */); + pushKeywordIf(keywords, statement.getFirstToken(), 64 /* BreakKeyword */); } }); }); @@ -35015,12 +33631,12 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 155 /* DoStatement */: - case 156 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 163 /* SwitchStatement */: + case 171 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -35031,7 +33647,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 160 /* BreakStatement */ || node.kind === 159 /* ContinueStatement */) { + if (node.kind === 168 /* BreakStatement */ || node.kind === 167 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isAnyFunction(node)) { @@ -35047,14 +33663,14 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node = statement.parent; node; node = node.parent) { switch (node.kind) { - case 163 /* SwitchStatement */: - if (statement.kind === 159 /* ContinueStatement */) { + case 171 /* SwitchStatement */: + if (statement.kind === 167 /* ContinueStatement */) { continue; } - case 157 /* ForStatement */: - case 158 /* ForInStatement */: - case 156 /* WhileStatement */: - case 155 /* DoStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 164 /* WhileStatement */: + case 163 /* DoStatement */: if (!statement.label || isLabeledBy(node, statement.label.text)) { return node; } @@ -35073,20 +33689,20 @@ var ts; var keywords = []; ts.forEach(declarations, function (declaration) { ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 107 /* ConstructorKeyword */); + return pushKeywordIf(keywords, token, 111 /* ConstructorKeyword */); }); }); return ts.map(keywords, getReferenceEntryFromNode); } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 122 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 123 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 127 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 128 /* SetAccessor */); return ts.map(keywords, getReferenceEntryFromNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 109 /* GetKeyword */, 113 /* SetKeyword */); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 113 /* GetKeyword */, 117 /* SetKeyword */); }); } } } @@ -35122,10 +33738,10 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 59 /* Identifier */ && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind !== 63 /* Identifier */ && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 6 /* NumericLiteral */ || node.kind === 7 /* StringLiteral */); + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 6 /* NumericLiteral */ || node.kind === 7 /* StringLiteral */); return getReferencesForNode(node, program.getSourceFiles(), findInStrings, findInComments); } function getReferencesForNode(node, sourceFiles, findInStrings, findInComments) { @@ -35138,10 +33754,10 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 87 /* ThisKeyword */) { + if (node.kind === 91 /* ThisKeyword */) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 85 /* SuperKeyword */) { + if (node.kind === 89 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } var symbol = typeInfoResolver.getSymbolInfo(node); @@ -35171,7 +33787,7 @@ var ts; } return result; function getNormalizedSymbolName(symbolName, declarations) { - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 143 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 149 /* FunctionExpression */ ? d : undefined; }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -35186,10 +33802,10 @@ var ts; return name; } function getSymbolScope(symbol) { - if (symbol.getFlags() && (2 /* Property */ | 2048 /* Method */)) { + if (symbol.getFlags() && (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return privateDeclaration.parent; + return ts.getAncestor(privateDeclaration, 184 /* ClassDeclaration */); } } if (symbol.parent) { @@ -35203,7 +33819,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 184 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 193 /* SourceFile */ && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -35225,7 +33841,7 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 1 /* ES5 */)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 1 /* ES5 */))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -35252,7 +33868,7 @@ var ts; function isValidReferencePosition(node, searchSymbolName) { if (node) { switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return node.getWidth() === searchSymbolName.length; case 7 /* StringLiteral */: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -35323,11 +33939,11 @@ var ts; } var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; @@ -35340,7 +33956,7 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 85 /* SuperKeyword */) { + if (!node || node.kind !== 89 /* SuperKeyword */) { return; } var container = ts.getSuperContainer(node); @@ -35354,26 +33970,26 @@ var ts; var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 184 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: break; default: return undefined; } var result = []; - if (searchSpaceNode.kind === 184 /* SourceFile */) { + if (searchSpaceNode.kind === 193 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -35389,24 +34005,24 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 87 /* ThisKeyword */) { + if (!node || node.kind !== 91 /* ThisKeyword */) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 143 /* FunctionExpression */: - case 174 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 184 /* SourceFile */: - if (container.kind === 184 /* SourceFile */ && !ts.isExternalModule(container)) { + case 193 /* SourceFile */: + if (container.kind === 193 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -35425,20 +34041,20 @@ var ts; if (rootSymbol !== symbol) { result.push(rootSymbol); } - if (rootSymbol.parent && rootSymbol.parent.flags & (16 /* Class */ | 32 /* Interface */)) { + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (16 /* Class */ | 32 /* Interface */)) { + if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 176 /* ClassDeclaration */) { + if (declaration.kind === 184 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(declaration.baseType); ts.forEach(declaration.implementedTypes, getPropertySymbolFromTypeReference); } - else if (declaration.kind === 177 /* InterfaceDeclaration */) { + else if (declaration.kind === 185 /* InterfaceDeclaration */) { ts.forEach(declaration.baseTypes, getPropertySymbolFromTypeReference); } }); @@ -35470,7 +34086,7 @@ var ts; if (searchSymbols.indexOf(rootSymbol) >= 0) { return true; } - if (rootSymbol.parent && rootSymbol.parent.flags & (16 /* Class */ | 32 /* Interface */)) { + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { var result = []; getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); @@ -35539,17 +34155,17 @@ var ts; }; } function isWriteAccess(node) { - if (node.kind === 59 /* Identifier */ && ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (node.kind === 63 /* Identifier */ && ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { return true; } var parent = node.parent; if (parent) { - if (parent.kind === 146 /* PostfixOperator */ || parent.kind === 145 /* PrefixOperator */) { + if (parent.kind === 152 /* PostfixOperator */ || parent.kind === 151 /* PrefixOperator */) { return true; } - else if (parent.kind === 147 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 153 /* BinaryExpression */ && parent.left === node) { var operator = parent.operator; - return ts.SyntaxKind.FirstAssignment <= operator && operator <= ts.SyntaxKind.LastAssignment; + return 51 /* FirstAssignment */ <= operator && operator <= 62 /* LastAssignment */; } } return false; @@ -35661,73 +34277,75 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 118 /* Parameter */: - case 173 /* VariableDeclaration */: - case 119 /* Property */: - case 136 /* PropertyAssignment */: - case 183 /* EnumMember */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* FunctionDeclaration */: - case 143 /* FunctionExpression */: - case 144 /* ArrowFunction */: - case 170 /* CatchBlock */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 178 /* CatchBlock */: return 1 /* Value */; - case 117 /* TypeParameter */: - case 177 /* InterfaceDeclaration */: - case 129 /* TypeLiteral */: + case 122 /* TypeParameter */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 134 /* TypeLiteral */: return 2 /* Type */; - case 176 /* ClassDeclaration */: - case 178 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (node.name.kind === 7 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } - else if (ts.isInstantiated(node)) { + else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { return 4 /* Namespace */ | 1 /* Value */; } else { return 4 /* Namespace */; } break; - case 181 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { - if (node.parent.kind === 116 /* QualifiedName */ && node.parent.right === node) + if (isRightSideOfQualifiedName(node)) { node = node.parent; - return node.parent.kind === 127 /* TypeReference */; + } + return node.parent.kind === 132 /* TypeReference */; } function isNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 116 /* QualifiedName */) { - while (root.parent && root.parent.kind === 116 /* QualifiedName */) + if (root.parent.kind === 121 /* QualifiedName */) { + while (root.parent && root.parent.kind === 121 /* QualifiedName */) root = root.parent; isLastClause = root.right === node; } - return root.parent.kind === 127 /* TypeReference */ && !isLastClause; + return root.parent.kind === 132 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 116 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 181 /* ImportDeclaration */ && node.parent.entityName === node; + return node.parent.kind === 190 /* ImportDeclaration */ && node.parent.entityName === node; } function getMeaningFromRightHandSideOfImport(node) { - ts.Debug.assert(node.kind === 59 /* Identifier */); - if (node.parent.kind === 116 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 181 /* ImportDeclaration */) { + ts.Debug.assert(node.kind === 63 /* Identifier */); + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 190 /* ImportDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 182 /* ExportAssignment */) { + if (node.parent.kind === 191 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -35810,55 +34428,47 @@ var ts; return currentSourceFile; } function getNameOrDottedNameSpan(filename, startPos, endPos) { - function getTypeInfoEligiblePath(filename, position, isConstructorValidPosition) { - var sourceUnit = syntaxTreeCache.getCurrentFileSyntaxTree(filename).sourceUnit(); - var ast = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, false, true); - if (ast === null) { - return null; - } - if (ast.kind() === 228 /* ParameterList */ && ast.parent.kind() === 143 /* CallSignature */ && ast.parent.parent.kind() === 138 /* ConstructorDeclaration */) { - ast = ast.parent.parent; - } - switch (ast.kind()) { - default: - return null; - case 138 /* ConstructorDeclaration */: - var constructorAST = ast; - if (!isConstructorValidPosition || !(position >= TypeScript.start(constructorAST) && position <= TypeScript.start(constructorAST) + "constructor".length)) { - return null; - } - else { - return ast; - } - case 130 /* FunctionDeclaration */: - return null; - case 213 /* MemberAccessExpression */: - case 121 /* QualifiedName */: - case 50 /* SuperKeyword */: - case 14 /* StringLiteral */: - case 35 /* ThisKeyword */: - case 11 /* IdentifierName */: - return ast; - } + filename = ts.normalizeSlashes(filename); + var node = ts.getTouchingPropertyName(getCurrentSourceFile(filename), startPos); + if (!node) { + return; } - filename = TypeScript.switchToForwardSlashes(filename); - var node = getTypeInfoEligiblePath(filename, startPos, false); - if (!node) - return null; - while (node) { - if (TypeScript.ASTHelpers.isNameOfMemberAccessExpression(node) || TypeScript.ASTHelpers.isRightSideOfQualifiedName(node)) { - node = node.parent; + switch (node.kind) { + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: + case 7 /* StringLiteral */: + case 78 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 87 /* NullKeyword */: + case 89 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 63 /* Identifier */: + break; + default: + return; + } + var nodeForStartPos = node; + while (true) { + if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + nodeForStartPos = nodeForStartPos.parent; + } + else if (isNameOfModuleDeclaration(nodeForStartPos)) { + if (nodeForStartPos.parent.parent.kind === 188 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + nodeForStartPos = nodeForStartPos.parent.parent.name; + } + else { + break; + } } else { break; } } - return TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node)); + return TypeScript.TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(filename, position) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxtree = getSyntaxTree(filename); - return TypeScript.Services.Breakpoints.getBreakpointLocation(syntaxtree, position); + filename = ts.normalizeSlashes(filename); + return ts.BreakpointResolver.spanInSourceFileAtLocation(getCurrentSourceFile(filename), position); } function getNavigationBarItems(filename) { filename = TypeScript.switchToForwardSlashes(filename); @@ -35873,21 +34483,21 @@ var ts; return result; function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); - if (flags & 16 /* Class */) { + if (flags & 32 /* Class */) { return ClassificationTypeNames.className; } - else if (flags & 64 /* Enum */) { + else if (flags & 384 /* Enum */) { return ClassificationTypeNames.enumName; } else if (meaningAtPosition & 2 /* Type */) { - if (flags & 32 /* Interface */) { + if (flags & 64 /* Interface */) { return ClassificationTypeNames.interfaceName; } - else if (flags & 262144 /* TypeParameter */) { + else if (flags & 1048576 /* TypeParameter */) { return ClassificationTypeNames.typeParameterName; } } - else if (flags & ts.SymbolFlags.Module) { + else if (flags & 1536 /* Module */) { if (meaningAtPosition & 4 /* Namespace */ || (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } @@ -35895,13 +34505,13 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 179 /* ModuleDeclaration */ && ts.isInstantiated(declaration); + return declaration.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } function processNode(node) { if (node && span.intersectsWith(node.getStart(), node.getWidth())) { - if (node.kind === 59 /* Identifier */ && node.getWidth() > 0) { + if (node.kind === 63 /* Identifier */ && node.getWidth() > 0) { var symbol = typeInfoResolver.getSymbolInfo(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); @@ -35950,13 +34560,13 @@ var ts; if (ts.isKeyword(tokenKind)) { return ClassificationTypeNames.keyword; } - if (tokenKind === 19 /* LessThanToken */ || tokenKind === 20 /* GreaterThanToken */) { + if (tokenKind === 23 /* LessThanToken */ || tokenKind === 24 /* GreaterThanToken */) { if (ts.getTypeArgumentOrTypeParameterList(token.parent)) { return ClassificationTypeNames.punctuation; } } if (ts.isPunctuation(token)) { - if (token.parent.kind === 147 /* BinaryExpression */ || token.parent.kind === 173 /* VariableDeclaration */ || token.parent.kind === 145 /* PrefixOperator */ || token.parent.kind === 146 /* PostfixOperator */ || token.parent.kind === 148 /* ConditionalExpression */) { + if (token.parent.kind === 153 /* BinaryExpression */ || token.parent.kind === 181 /* VariableDeclaration */ || token.parent.kind === 151 /* PrefixOperator */ || token.parent.kind === 152 /* PostfixOperator */ || token.parent.kind === 154 /* ConditionalExpression */) { return ClassificationTypeNames.operator; } else { @@ -35972,29 +34582,32 @@ var ts; else if (tokenKind === 8 /* RegularExpressionLiteral */) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 59 /* Identifier */) { + else if (ts.isTemplateLiteralKind(tokenKind)) { + return ClassificationTypeNames.stringLiteral; + } + else if (tokenKind === 63 /* Identifier */) { switch (token.parent.kind) { - case 176 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 117 /* TypeParameter */: + case 122 /* TypeParameter */: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 177 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 178 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 179 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -36052,31 +34665,28 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 9 /* OpenBraceToken */: - return 10 /* CloseBraceToken */; - case 11 /* OpenParenToken */: - return 12 /* CloseParenToken */; - case 13 /* OpenBracketToken */: - return 14 /* CloseBracketToken */; - case 19 /* LessThanToken */: - return 20 /* GreaterThanToken */; - case 10 /* CloseBraceToken */: - return 9 /* OpenBraceToken */; - case 12 /* CloseParenToken */: - return 11 /* OpenParenToken */; - case 14 /* CloseBracketToken */: - return 13 /* OpenBracketToken */; - case 20 /* GreaterThanToken */: - return 19 /* LessThanToken */; + case 13 /* OpenBraceToken */: return 14 /* CloseBraceToken */; + case 15 /* OpenParenToken */: return 16 /* CloseParenToken */; + case 17 /* OpenBracketToken */: return 18 /* CloseBracketToken */; + case 23 /* LessThanToken */: return 24 /* GreaterThanToken */; + case 14 /* CloseBraceToken */: return 13 /* OpenBraceToken */; + case 16 /* CloseParenToken */: return 15 /* OpenParenToken */; + case 18 /* CloseBracketToken */: return 17 /* OpenBracketToken */; + case 24 /* GreaterThanToken */: return 23 /* LessThanToken */; } return undefined; } } function getIndentationAtPosition(filename, position, editorOptions) { filename = TypeScript.switchToForwardSlashes(filename); + var start = new Date().getTime(); var sourceFile = getCurrentSourceFile(filename); + host.log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - return ts.formatting.SmartIndenter.getIndentation(position, sourceFile, options); + var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, options); + host.log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); + return result; } function getFormattingManager(filename, options) { if (formattingRulesProvider == null) { @@ -36115,8 +34725,9 @@ var ts; return []; } function getTodoComments(filename, descriptors) { + synchronizeHostData(); filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getCurrentSourceFile(filename); + var sourceFile = getSourceFile(filename); cancellationToken.throwIfCancellationRequested(); var fileContents = sourceFile.text; cancellationToken.throwIfCancellationRequested(); @@ -36131,10 +34742,7 @@ var ts; var preamble = matchArray[1]; var matchPosition = matchArray.index + preamble.length; var token = ts.getTokenAtPosition(sourceFile, matchPosition); - if (token.getStart() <= matchPosition && matchPosition < token.getEnd()) { - continue; - } - if (!getContainingComment(ts.getTrailingCommentRanges(fileContents, token.getFullStart()), matchPosition) && !getContainingComment(ts.getLeadingCommentRanges(fileContents, token.getFullStart()), matchPosition)) { + if (!isInsideComment(sourceFile, token, matchPosition)) { continue; } var descriptor = undefined; @@ -36143,7 +34751,7 @@ var ts; descriptor = descriptors[i]; } } - ts.Debug.assert(descriptor); + ts.Debug.assert(descriptor !== undefined); if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { continue; } @@ -36191,7 +34799,7 @@ var ts; fileName = TypeScript.switchToForwardSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 59 /* Identifier */) { + if (node && node.kind === 63 /* Identifier */) { var symbol = typeInfoResolver.getSymbolInfo(node); if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) { var kind = getSymbolKind(symbol, typeInfoResolver); @@ -36259,32 +34867,32 @@ var ts; } ts.createLanguageService = createLanguageService; function createClassifier(host) { - var scanner = ts.createScanner(1 /* ES5 */, false); + var scanner = ts.createScanner(2 /* Latest */, false); var noRegexTable = []; - noRegexTable[59 /* Identifier */] = true; + noRegexTable[63 /* Identifier */] = true; noRegexTable[7 /* StringLiteral */] = true; noRegexTable[6 /* NumericLiteral */] = true; noRegexTable[8 /* RegularExpressionLiteral */] = true; - noRegexTable[87 /* ThisKeyword */] = true; - noRegexTable[33 /* PlusPlusToken */] = true; - noRegexTable[34 /* MinusMinusToken */] = true; - noRegexTable[12 /* CloseParenToken */] = true; - noRegexTable[14 /* CloseBracketToken */] = true; - noRegexTable[10 /* CloseBraceToken */] = true; - noRegexTable[89 /* TrueKeyword */] = true; - noRegexTable[74 /* FalseKeyword */] = true; + noRegexTable[91 /* ThisKeyword */] = true; + noRegexTable[37 /* PlusPlusToken */] = true; + noRegexTable[38 /* MinusMinusToken */] = true; + noRegexTable[16 /* CloseParenToken */] = true; + noRegexTable[18 /* CloseBracketToken */] = true; + noRegexTable[14 /* CloseBraceToken */] = true; + noRegexTable[93 /* TrueKeyword */] = true; + noRegexTable[78 /* FalseKeyword */] = true; function isAccessibilityModifier(kind) { switch (kind) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: return true; } return false; } function canFollow(keyword1, keyword2) { if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 109 /* GetKeyword */ || keyword2 === 113 /* SetKeyword */ || keyword2 === 107 /* ConstructorKeyword */ || keyword2 === 103 /* StaticKeyword */) { + if (keyword2 === 113 /* GetKeyword */ || keyword2 === 117 /* SetKeyword */ || keyword2 === 111 /* ConstructorKeyword */ || keyword2 === 107 /* StaticKeyword */) { return true; } return false; @@ -36319,26 +34927,26 @@ var ts; do { token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { + if ((token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { if (scanner.reScanSlashToken() === 8 /* RegularExpressionLiteral */) { token = 8 /* RegularExpressionLiteral */; } } - else if (lastNonTriviaToken === 15 /* DotToken */ && isKeyword(token)) { - token = 59 /* Identifier */; + else if (lastNonTriviaToken === 19 /* DotToken */ && isKeyword(token)) { + token = 63 /* Identifier */; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 59 /* Identifier */; + token = 63 /* Identifier */; } - else if (lastNonTriviaToken === 59 /* Identifier */ && token === 19 /* LessThanToken */) { + else if (lastNonTriviaToken === 63 /* Identifier */ && token === 23 /* LessThanToken */) { angleBracketStack++; } - else if (token === 20 /* GreaterThanToken */ && angleBracketStack > 0) { + else if (token === 24 /* GreaterThanToken */ && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 105 /* AnyKeyword */ || token === 114 /* StringKeyword */ || token === 112 /* NumberKeyword */ || token === 106 /* BooleanKeyword */) { + else if (token === 109 /* AnyKeyword */ || token === 118 /* StringKeyword */ || token === 116 /* NumberKeyword */ || token === 110 /* BooleanKeyword */) { if (angleBracketStack > 0) { - token = 59 /* Identifier */; + token = 63 /* Identifier */; } } lastNonTriviaToken = token; @@ -36377,62 +34985,61 @@ var ts; } function isBinaryExpressionOperatorToken(token) { switch (token) { - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 38 /* AmpersandToken */: - case 40 /* CaretToken */: - case 39 /* BarToken */: - case 43 /* AmpersandAmpersandToken */: - case 44 /* BarBarToken */: - case 57 /* BarEqualsToken */: - case 56 /* AmpersandEqualsToken */: - case 58 /* CaretEqualsToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 48 /* PlusEqualsToken */: - case 49 /* MinusEqualsToken */: - case 50 /* AsteriskEqualsToken */: - case 51 /* SlashEqualsToken */: - case 52 /* PercentEqualsToken */: - case 47 /* EqualsToken */: - case 18 /* CommaToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 42 /* AmpersandToken */: + case 44 /* CaretToken */: + case 43 /* BarToken */: + case 47 /* AmpersandAmpersandToken */: + case 48 /* BarBarToken */: + case 61 /* BarEqualsToken */: + case 60 /* AmpersandEqualsToken */: + case 62 /* CaretEqualsToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 52 /* PlusEqualsToken */: + case 53 /* MinusEqualsToken */: + case 54 /* AsteriskEqualsToken */: + case 55 /* SlashEqualsToken */: + case 56 /* PercentEqualsToken */: + case 51 /* EqualsToken */: + case 22 /* CommaToken */: return true; - default: - return false; + default: return false; } } function isPrefixUnaryExpressionOperatorToken(token) { switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: return true; default: return false; } } function isKeyword(token) { - return token >= ts.SyntaxKind.FirstKeyword && token <= ts.SyntaxKind.LastKeyword; + return token >= 64 /* FirstKeyword */ && token <= 119 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -36441,7 +35048,7 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return 2 /* Operator */; } - else if (token >= ts.SyntaxKind.FirstPunctuation && token <= ts.SyntaxKind.LastPunctuation) { + else if (token >= 13 /* FirstPunctuation */ && token <= 62 /* LastPunctuation */) { return 0 /* Punctuation */; } switch (token) { @@ -36456,7 +35063,7 @@ var ts; return 3 /* Comment */; case 5 /* WhitespaceTrivia */: return 4 /* Whitespace */; - case 59 /* Identifier */: + case 63 /* Identifier */: default: return 5 /* Identifier */; } @@ -36471,7 +35078,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 184 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 193 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -36487,6 +35094,345 @@ var ts; } initializeServices(); })(ts || (ts = {})); +var ts; +(function (ts) { + var BreakpointResolver; + (function (BreakpointResolver) { + function spanInSourceFileAtLocation(sourceFile, position) { + if (sourceFile.flags & 1024 /* DeclarationFile */) { + return undefined; + } + var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); + var lineOfPosition = sourceFile.getLineAndCharacterFromPosition(position).line; + if (sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); + if (!tokenAtLocation || sourceFile.getLineAndCharacterFromPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { + return undefined; + } + } + if (ts.isInAmbientContext(tokenAtLocation)) { + return undefined; + } + return spanInNode(tokenAtLocation); + function textSpan(startNode, endNode) { + return TypeScript.TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + } + function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterFromPosition(node.getStart()).line) { + return spanInNode(node); + } + return spanInNode(otherwiseOnNode); + } + function spanInPreviousNode(node) { + return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); + } + function spanInNextNode(node) { + return spanInNode(ts.findNextToken(node, node.parent)); + } + function spanInNode(node) { + if (node) { + if (ts.isExpression(node)) { + if (node.parent.kind === 163 /* DoStatement */) { + return spanInPreviousNode(node); + } + if (node.parent.kind === 165 /* ForStatement */) { + return textSpan(node); + } + if (node.parent.kind === 153 /* BinaryExpression */ && node.parent.operator === 22 /* CommaToken */) { + return textSpan(node); + } + if (node.parent.kind == 150 /* ArrowFunction */ && node.parent.body == node) { + return textSpan(node); + } + } + switch (node.kind) { + case 159 /* VariableStatement */: + return spanInVariableDeclaration(node.declarations[0]); + case 181 /* VariableDeclaration */: + case 124 /* Property */: + return spanInVariableDeclaration(node); + case 123 /* Parameter */: + return spanInParameterDeclaration(node); + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + return spanInFunctionDeclaration(node); + case 183 /* FunctionBlock */: + return spanInFunctionBlock(node); + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 189 /* ModuleBlock */: + return spanInBlock(node); + case 161 /* ExpressionStatement */: + return textSpan(node.expression); + case 169 /* ReturnStatement */: + return textSpan(node.getChildAt(0), node.expression); + case 164 /* WhileStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 163 /* DoStatement */: + return spanInNode(node.statement); + case 180 /* DebuggerStatement */: + return textSpan(node.getChildAt(0)); + case 162 /* IfStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 174 /* LabeledStatement */: + return spanInNode(node.statement); + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + return textSpan(node.getChildAt(0), node.label); + case 165 /* ForStatement */: + return spanInForStatement(node); + case 166 /* ForInStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 171 /* SwitchStatement */: + return textSpan(node, ts.findNextToken(node.expression, node)); + case 172 /* CaseClause */: + case 173 /* DefaultClause */: + return spanInNode(node.statements[0]); + case 176 /* TryStatement */: + return spanInBlock(node.tryBlock); + case 175 /* ThrowStatement */: + return textSpan(node, node.expression); + case 191 /* ExportAssignment */: + return textSpan(node, node.exportName); + case 190 /* ImportDeclaration */: + return textSpan(node, node.entityName || node.externalModuleName); + case 188 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + return undefined; + } + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: + return textSpan(node); + case 170 /* WithStatement */: + return spanInNode(node.statement); + case 185 /* InterfaceDeclaration */: + return undefined; + case 21 /* SemicolonToken */: + case 1 /* EndOfFileToken */: + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); + case 22 /* CommaToken */: + return spanInPreviousNode(node); + case 13 /* OpenBraceToken */: + return spanInOpenBraceToken(node); + case 14 /* CloseBraceToken */: + return spanInCloseBraceToken(node); + case 15 /* OpenParenToken */: + return spanInOpenParenToken(node); + case 16 /* CloseParenToken */: + return spanInCloseParenToken(node); + case 50 /* ColonToken */: + return spanInColonToken(node); + case 24 /* GreaterThanToken */: + case 23 /* LessThanToken */: + return spanInGreaterThanOrLessThanToken(node); + case 98 /* WhileKeyword */: + return spanInWhileKeyword(node); + case 74 /* ElseKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: + return spanInNextNode(node); + default: + if (node.parent.kind === 141 /* PropertyAssignment */ && node.parent.name === node) { + return spanInNode(node.parent.initializer); + } + if (node.parent.kind === 147 /* TypeAssertion */ && node.parent.type === node) { + return spanInNode(node.parent.operand); + } + if (ts.isAnyFunction(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + } + function spanInVariableDeclaration(variableDeclaration) { + if (variableDeclaration.parent.kind === 166 /* ForInStatement */) { + return spanInNode(variableDeclaration.parent); + } + var isParentVariableStatement = variableDeclaration.parent.kind === 159 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.kind === 165 /* ForStatement */ && ts.contains(variableDeclaration.parent.declarations, variableDeclaration); + var declarations = isParentVariableStatement ? variableDeclaration.parent.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.declarations : undefined; + if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { + if (declarations && declarations[0] === variableDeclaration) { + if (isParentVariableStatement) { + return textSpan(variableDeclaration.parent, variableDeclaration); + } + else { + ts.Debug.assert(isDeclarationOfForStatement); + return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } + } + else { + return textSpan(variableDeclaration); + } + } + else if (declarations && declarations[0] !== variableDeclaration) { + var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); + return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); + } + } + function canHaveSpanInParameterDeclaration(parameter) { + return !!parameter.initializer || !!(parameter.flags & 8 /* Rest */) || !!(parameter.flags & 16 /* Public */) || !!(parameter.flags & 32 /* Private */); + } + function spanInParameterDeclaration(parameter) { + if (canHaveSpanInParameterDeclaration(parameter)) { + return textSpan(parameter); + } + else { + var functionDeclaration = parameter.parent; + var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); + if (indexOfParameter) { + return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); + } + else { + return spanInNode(functionDeclaration.body); + } + } + } + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { + return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 184 /* ClassDeclaration */ && functionDeclaration.kind !== 126 /* Constructor */); + } + function spanInFunctionDeclaration(functionDeclaration) { + if (!functionDeclaration.body) { + return undefined; + } + if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + return textSpan(functionDeclaration); + } + return spanInNode(functionDeclaration.body); + } + function spanInFunctionBlock(block) { + var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); + } + return spanInNode(nodeForSpanInBlock); + } + function spanInBlock(block) { + switch (block.parent.kind) { + case 188 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { + return undefined; + } + case 164 /* WhileStatement */: + case 162 /* IfStatement */: + case 166 /* ForInStatement */: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 165 /* ForStatement */: + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); + } + return spanInNode(block.statements[0]); + } + function spanInForStatement(forStatement) { + if (forStatement.declarations) { + return spanInNode(forStatement.declarations[0]); + } + if (forStatement.initializer) { + return spanInNode(forStatement.initializer); + } + if (forStatement.condition) { + return textSpan(forStatement.condition); + } + if (forStatement.iterator) { + return textSpan(forStatement.iterator); + } + } + function spanInOpenBraceToken(node) { + switch (node.parent.kind) { + case 187 /* EnumDeclaration */: + var enumDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); + case 184 /* ClassDeclaration */: + var classDeclaration = node.parent; + return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); + case 171 /* SwitchStatement */: + return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); + } + return spanInNode(node.parent); + } + function spanInCloseBraceToken(node) { + switch (node.parent.kind) { + case 189 /* ModuleBlock */: + if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { + return undefined; + } + case 183 /* FunctionBlock */: + case 187 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + return textSpan(node); + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + return spanInNode(node.parent.statements[node.parent.statements.length - 1]); + ; + case 171 /* SwitchStatement */: + var switchStatement = node.parent; + var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + if (lastClause) { + return spanInNode(lastClause.statements[lastClause.statements.length - 1]); + } + return undefined; + default: + return spanInNode(node.parent); + } + } + function spanInOpenParenToken(node) { + if (node.parent.kind === 163 /* DoStatement */) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + function spanInCloseParenToken(node) { + switch (node.parent.kind) { + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 164 /* WhileStatement */: + case 163 /* DoStatement */: + case 165 /* ForStatement */: + return spanInPreviousNode(node); + default: + return spanInNode(node.parent); + } + return spanInNode(node.parent); + } + function spanInColonToken(node) { + if (ts.isAnyFunction(node.parent) || node.parent.kind === 141 /* PropertyAssignment */) { + return spanInPreviousNode(node); + } + return spanInNode(node.parent); + } + function spanInGreaterThanOrLessThanToken(node) { + if (node.parent.kind === 147 /* TypeAssertion */) { + return spanInNode(node.parent.operand); + } + return spanInNode(node.parent); + } + function spanInWhileKeyword(node) { + if (node.parent.kind === 163 /* DoStatement */) { + return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); + } + return spanInNode(node.parent); + } + } + } + BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; + })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); +})(ts || (ts = {})); var TypeScript; (function (TypeScript) { function isNoDefaultLibMatch(comment) { @@ -36528,20 +35474,20 @@ var TypeScript; var lineChar = { line: -1, character: -1 }; var lineMap = text.lineMap(); var start = new Date().getTime(); - while (token.kind() !== 10 /* EndOfFileToken */) { - if (token.kind() === 49 /* ImportKeyword */) { + while (token.kind() !== 8 /* EndOfFileToken */) { + if (token.kind() === 51 /* ImportKeyword */) { var importToken = token; token = scanner.scan(false); if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { token = scanner.scan(false); - if (token.kind() === 107 /* EqualsToken */) { + if (token.kind() === 109 /* EqualsToken */) { token = scanner.scan(false); - if (token.kind() === 65 /* ModuleKeyword */ || token.kind() === 66 /* RequireKeyword */) { + if (token.kind() === 67 /* ModuleKeyword */ || token.kind() === 68 /* RequireKeyword */) { token = scanner.scan(false); - if (token.kind() === 72 /* OpenParenToken */) { + if (token.kind() === 74 /* OpenParenToken */) { token = scanner.scan(false); lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - if (token.kind() === 14 /* StringLiteral */) { + if (token.kind() === 12 /* StringLiteral */) { var ref = { line: lineChar.line, character: lineChar.character, @@ -36571,7 +35517,7 @@ var TypeScript; var lineMap = text.lineMap(); for (var i = 0, n = leadingTrivia.count(); i < n; i++) { var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 7 /* SingleLineCommentTrivia */) { + if (trivia.kind() === 5 /* SingleLineCommentTrivia */) { var triviaText = trivia.fullText(); var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); if (referencedCode) { @@ -36594,7 +35540,7 @@ var TypeScript; function preProcessFile(fileName, sourceText, readImportFiles) { if (readImportFiles === void 0) { readImportFiles = true; } var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = TypeScript.Scanner.createScanner(1 /* ES5 */, text, reportDiagnostic); + var scanner = TypeScript.Scanner.createScanner(2 /* Latest */, text, reportDiagnostic); var firstToken = scanner.scan(false); var importedFiles = []; if (readImportFiles) { @@ -36612,67 +35558,44 @@ var TypeScript; var debugObjectHost = this; var ts; (function (ts) { - (function (LanguageVersion) { - LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; - LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; - })(ts.LanguageVersion || (ts.LanguageVersion = {})); - var LanguageVersion = ts.LanguageVersion; - (function (ModuleGenTarget) { - ModuleGenTarget[ModuleGenTarget["Unspecified"] = 0] = "Unspecified"; - ModuleGenTarget[ModuleGenTarget["Synchronous"] = 1] = "Synchronous"; - ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 2] = "Asynchronous"; - })(ts.ModuleGenTarget || (ts.ModuleGenTarget = {})); - var ModuleGenTarget = ts.ModuleGenTarget; function languageVersionToScriptTarget(languageVersion) { if (typeof languageVersion === "undefined") return undefined; switch (languageVersion) { - case 0 /* EcmaScript3 */: - return 0 /* ES3 */; - case 1 /* EcmaScript5 */: - return 1 /* ES5 */; - default: - throw Error("unsupported LanguageVersion value: " + languageVersion); + case 0 /* EcmaScript3 */: return 0 /* ES3 */; + case 1 /* EcmaScript5 */: return 1 /* ES5 */; + case 2 /* EcmaScript6 */: return 2 /* ES6 */; + default: throw Error("unsupported LanguageVersion value: " + languageVersion); } } function moduleGenTargetToModuleKind(moduleGenTarget) { if (typeof moduleGenTarget === "undefined") return undefined; switch (moduleGenTarget) { - case 2 /* Asynchronous */: - return 2 /* AMD */; - case 1 /* Synchronous */: - return 1 /* CommonJS */; - case 0 /* Unspecified */: - return 0 /* None */; - default: - throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); + case 2 /* Asynchronous */: return 2 /* AMD */; + case 1 /* Synchronous */: return 1 /* CommonJS */; + case 0 /* Unspecified */: return 0 /* None */; + default: throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); } } function scriptTargetTolanguageVersion(scriptTarget) { if (typeof scriptTarget === "undefined") return undefined; switch (scriptTarget) { - case 0 /* ES3 */: - return 0 /* EcmaScript3 */; - case 1 /* ES5 */: - return 1 /* EcmaScript5 */; - default: - throw Error("unsupported ScriptTarget value: " + scriptTarget); + case 0 /* ES3 */: return 0 /* EcmaScript3 */; + case 1 /* ES5 */: return 1 /* EcmaScript5 */; + case 2 /* ES6 */: return 2 /* EcmaScript6 */; + default: throw Error("unsupported ScriptTarget value: " + scriptTarget); } } function moduleKindToModuleGenTarget(moduleKind) { if (typeof moduleKind === "undefined") return undefined; switch (moduleKind) { - case 2 /* AMD */: - return 2 /* Asynchronous */; - case 1 /* CommonJS */: - return 1 /* Synchronous */; - case 0 /* None */: - return 0 /* Unspecified */; - default: - throw Error("unsupported ModuleKind value: " + moduleKind); + case 2 /* AMD */: return 2 /* Asynchronous */; + case 1 /* CommonJS */: return 1 /* Synchronous */; + case 0 /* None */: return 0 /* Unspecified */; + default: throw Error("unsupported ModuleKind value: " + moduleKind); } } function compilationSettingsToCompilerOptions(settings) { diff --git a/doc/TypeScript Language Specification (Change Markup).docx b/doc/TypeScript Language Specification (Change Markup).docx index bb4be4fac1c..7846303e15b 100644 Binary files a/doc/TypeScript Language Specification (Change Markup).docx and b/doc/TypeScript Language Specification (Change Markup).docx differ diff --git a/doc/TypeScript Language Specification (Change Markup).pdf b/doc/TypeScript Language Specification (Change Markup).pdf index 0cffd20b7c7..ea7cede20f8 100644 Binary files a/doc/TypeScript Language Specification (Change Markup).pdf and b/doc/TypeScript Language Specification (Change Markup).pdf differ diff --git a/doc/TypeScript Language Specification.docx b/doc/TypeScript Language Specification.docx index 3d2014252f2..c7b95764525 100644 Binary files a/doc/TypeScript Language Specification.docx and b/doc/TypeScript Language Specification.docx differ diff --git a/doc/TypeScript Language Specification.pdf b/doc/TypeScript Language Specification.pdf index 203269c3f24..9a165b56df6 100644 Binary files a/doc/TypeScript Language Specification.pdf and b/doc/TypeScript Language Specification.pdf differ diff --git a/doc/spec.md b/doc/spec.md index 158c431c229..62d27e0a808 100644 --- a/doc/spec.md +++ b/doc/spec.md @@ -45,40 +45,42 @@ TypeScript is a trademark of Microsoft Corporation. * [3.3.1 Named Type References](#3.3.1) * [3.3.2 Array Types](#3.3.2) * [3.3.3 Tuple Types](#3.3.3) - * [3.3.4 Union Types](#3.3.4) - * [3.3.5 Function Types](#3.3.5) - * [3.3.6 Constructor Types](#3.3.6) - * [3.3.7 Members](#3.3.7) - * [3.4 Type Parameters](#3.4) - * [3.4.1 Type Parameter Lists](#3.4.1) - * [3.4.2 Type Argument Lists](#3.4.2) - * [3.5 Named Types](#3.5) - * [3.5.1 Instance Types](#3.5.1) - * [3.6 Specifying Types](#3.6) - * [3.6.1 Predefined Types](#3.6.1) - * [3.6.2 Type References](#3.6.2) - * [3.6.3 Object Type Literals](#3.6.3) - * [3.6.4 Array Type Literals](#3.6.4) - * [3.6.5 Tuple Type Literals](#3.6.5) - * [3.6.6 Union Type Literals](#3.6.6) - * [3.6.7 Function Type Literals](#3.6.7) - * [3.6.8 Constructor Type Literals](#3.6.8) - * [3.6.9 Type Queries](#3.6.9) - * [3.7 Specifying Members](#3.7) - * [3.7.1 Property Signatures](#3.7.1) - * [3.7.2 Call Signatures](#3.7.2) - * [3.7.3 Construct Signatures](#3.7.3) - * [3.7.4 Index Signatures](#3.7.4) - * [3.7.5 Method Signatures](#3.7.5) - * [3.8 Type Relationships](#3.8) - * [3.8.1 Apparent Type](#3.8.1) - * [3.8.2 Type and Member Identity](#3.8.2) - * [3.8.3 Subtypes and Supertypes](#3.8.3) - * [3.8.4 Assignment Compatibility](#3.8.4) - * [3.8.5 Contextual Signature Instantiation](#3.8.5) - * [3.8.6 Type Inference](#3.8.6) - * [3.8.7 Recursive Types](#3.8.7) - * [3.9 Widened Types](#3.9) + * [3.3.4 Function Types](#3.3.4) + * [3.3.5 Constructor Types](#3.3.5) + * [3.3.6 Members](#3.3.6) + * [3.4 Union Types](#3.4) + * [3.4.1 Contextual Union Types](#3.4.1) + * [3.5 Type Parameters](#3.5) + * [3.5.1 Type Parameter Lists](#3.5.1) + * [3.5.2 Type Argument Lists](#3.5.2) + * [3.6 Named Types](#3.6) + * [3.6.1 Instance Types](#3.6.1) + * [3.7 Specifying Types](#3.7) + * [3.7.1 Predefined Types](#3.7.1) + * [3.7.2 Type References](#3.7.2) + * [3.7.3 Object Type Literals](#3.7.3) + * [3.7.4 Array Type Literals](#3.7.4) + * [3.7.5 Tuple Type Literals](#3.7.5) + * [3.7.6 Union Type Literals](#3.7.6) + * [3.7.7 Function Type Literals](#3.7.7) + * [3.7.8 Constructor Type Literals](#3.7.8) + * [3.7.9 Type Queries](#3.7.9) + * [3.8 Specifying Members](#3.8) + * [3.8.1 Property Signatures](#3.8.1) + * [3.8.2 Call Signatures](#3.8.2) + * [3.8.3 Construct Signatures](#3.8.3) + * [3.8.4 Index Signatures](#3.8.4) + * [3.8.5 Method Signatures](#3.8.5) + * [3.9 Type Aliases](#3.9) + * [3.10 Type Relationships](#3.10) + * [3.10.1 Apparent Members](#3.10.1) + * [3.10.2 Type and Member Identity](#3.10.2) + * [3.10.3 Subtypes and Supertypes](#3.10.3) + * [3.10.4 Assignment Compatibility](#3.10.4) + * [3.10.5 Contextual Signature Instantiation](#3.10.5) + * [3.10.6 Type Inference](#3.10.6) + * [3.10.7 Recursive Types](#3.10.7) + * [3.11 Widened Types](#3.11) * [4 Expressions](#4) * [4.1 Values and References](#4.1) * [4.2 The this Keyword](#4.2) @@ -306,7 +308,7 @@ In this example, the second parameter to 'vote' has the function type which means the second parameter is a function returning type 'any' that has a single parameter of type 'string' named 'result'. -Section [3.7.2](#3.7.2) provides additional information about function types. +Section [3.8.2](#3.8.2) provides additional information about function types. ## 1.3 Object Types @@ -418,7 +420,7 @@ getX({ x: 0, y: 0, color: "red" }); // Extra fields Ok getX({ x: 0 }); // Error: supplied parameter does not match ``` -See section [3.8](#3.8) for more information about type comparisons. +See section [0](#0) for more information about type comparisons. ## 1.5 Contextual Typing @@ -614,7 +616,7 @@ In the following screen shot, a programming tool combines information from overl / -Section [3.7.2.4](#3.7.2.4) provides details on how to use string literals in function signatures. +Section [3.8.2.4](#3.8.2.4) provides details on how to use string literals in function signatures. ## 1.9 Generic Types and Functions @@ -678,7 +680,7 @@ class List { } ``` -Section [3.5](#3.5) provides further information about generic types. +Section [3.6](#3.6) provides further information about generic types. ## 1.10 Modules @@ -870,9 +872,9 @@ The ***scope*** of a name is the region of program text within which it is possi Scopes may overlap, for example through nesting of modules and functions. When the scopes of two entities with the same name overlap, the entity with the innermost declaration takes precedence and access to the outer entity is either not possible or only possible by qualifying its name. -When an identifier is resolved as a *TypeName* (section [3.6.2](#3.6.2)), only classes, interfaces, enums, and type parameters are considered and other entities in scope are ignored. +When an identifier is resolved as a *TypeName* (section [3.7.2](#3.7.2)), only classes, interfaces, enums, and type parameters are considered and other entities in scope are ignored. -When an identifier is resolved as a *ModuleName* (section [3.6.2](#3.6.2)), only modules are considered and other entities in scope are ignored. +When an identifier is resolved as a *ModuleName* (section [3.7.2](#3.7.2)), only modules are considered and other entities in scope are ignored. When an identifier is resolved as a *PrimaryExpression* (section [4.3](#4.3)), only instantiated modules (section [10.1](#10.1)), classes, enums, functions, variables, and parameters are considered and other entities in scope are ignored. @@ -901,11 +903,13 @@ module M { TypeScript adds optional static types to JavaScript. Types are used to place static constraints on program entities such as functions, variables, and properties so that compilers and development tools can offer better verification and assistance during software development. TypeScript's *static* compile-time type system closely models the *dynamic* run-time type system of JavaScript, allowing programmers to accurately express the type relationships that are expected to exist when their programs run and have those assumptions pre-validated by the TypeScript compiler. TypeScript's type analysis occurs entirely at compile-time and adds no run-time overhead to program execution. -All types in TypeScript are subtypes of a single top type called the Any type. The `any` keyword references this type. The Any type is the one type that can represent *any* JavaScript value with no constraints. All other types are categorized as ***primitive types***, ***object types***, or ***type parameters***. These types introduce various static constraints on their values. +All types in TypeScript are subtypes of a single top type called the Any type. The `any` keyword references this type. The Any type is the one type that can represent *any* JavaScript value with no constraints. All other types are categorized as ***primitive types***, ***object types***, ***union types***, or ***type parameters***. These types introduce various static constraints on their values. The primitive types are the Number, Boolean, String, Void, Null, and Undefined types along with user defined enum types. The `number`, `boolean`, `string`, and `void` keywords reference the Number, Boolean, String, and Void primitive types respectively. The Void type exists purely to indicate the absence of a value, such as in a function with no return value. It is not possible to explicitly reference the Null and Undefined types—only *values* of those types can be referenced, using the `null` and `undefined` literals. -The object types are all class, interface, array, and literal types. Class and interface types are introduced through class and interface declarations and are referenced by the name given to them in their declarations. Class and interface types may be ***generic types*** which have one or more type parameters. Literal types are written as object, array, function, or constructor type literals and are used to compose new types from other types. +The object types are all class, interface, array, tuple, function, and constructor types. Class and interface types are introduced through class and interface declarations and are referenced by the name given to them in their declarations. Class and interface types may be ***generic types*** which have one or more type parameters. + +Union types represent values that can have one of multiple types. Declarations of modules, classes, properties, functions, variables and other language entities associate types with those entities. The mechanism by which a type is formed and associated with a language entity depends on the particular kind of entity. For example, a module declaration associates the module with an anonymous type containing a set of properties corresponding to the exported variables and functions in the module, and a function declaration associates the function with an anonymous type containing a call signature corresponding to the parameters and return type of the function. Types can be associated with variables through explicit ***type annotations***, such as @@ -951,7 +955,7 @@ The Number primitive type corresponds to the similarly named JavaScript primitiv The `number` keyword references the Number primitive type and numeric literals may be used to write values of the Number primitive type. -For purposes of determining type relationships (section [3.8](#3.8)) and accessing properties (section [4.10](#4.10)), the Number primitive type behaves as an object type with the same properties as the global interface type 'Number'. +For purposes of determining type relationships (section [0](#0)) and accessing properties (section [4.10](#4.10)), the Number primitive type behaves as an object type with the same properties as the global interface type 'Number'. Some examples: @@ -968,7 +972,7 @@ The Boolean primitive type corresponds to the similarly named JavaScript primiti The `boolean` keyword references the Boolean primitive type and the `true` and `false` literals reference the two Boolean truth values. -For purposes of determining type relationships (section [3.8](#3.8)) and accessing properties (section [4.10](#4.10)), the Boolean primitive type behaves as an object type with the same properties as the global interface type 'Boolean'. +For purposes of determining type relationships (section [0](#0)) and accessing properties (section [4.10](#4.10)), the Boolean primitive type behaves as an object type with the same properties as the global interface type 'Boolean'. Some examples: @@ -984,7 +988,7 @@ The String primitive type corresponds to the similarly named JavaScript primitiv The `string` keyword references the String primitive type and string literals may be used to write values of the String primitive type. -For purposes of determining type relationships (section [3.8](#3.8)) and accessing properties (section [4.10](#4.10)), the String primitive type behaves as an object type with the same properties as the global interface type 'String'. +For purposes of determining type relationships (section [0](#0)) and accessing properties (section [4.10](#4.10)), the String primitive type behaves as an object type with the same properties as the global interface type 'String'. Some examples: @@ -1009,7 +1013,7 @@ The Null type corresponds to the similarly named JavaScript primitive type and i The `null` literal references the one and only value of the Null type. It is not possible to directly reference the Null type itself. -The Null type is a subtype of all types, except the Undefined type. This means that `null` is considered a valid value for all primitive types, object types, and type parameters, including even the Number and Boolean primitive types. +The Null type is a subtype of all types, except the Undefined type. This means that `null` is considered a valid value for all primitive types, object types, union types, and type parameters, including even the Number and Boolean primitive types. Some examples: @@ -1025,7 +1029,7 @@ The Undefined type corresponds to the similarly named JavaScript primitive type The `undefined` literal denotes the value given to all uninitialized variables and is the one and only value of the Undefined type. It is not possible to directly reference the Undefined type itself. -The undefined type is a subtype of all types. This means that `undefined` is considered a valid value for all primitive types, object types, and type parameters. +The undefined type is a subtype of all types. This means that `undefined` is considered a valid value for all primitive types, object types, union types, and type parameters. Some examples: @@ -1037,13 +1041,13 @@ var e: Undefined; // Error, can't reference Undefined type ### 3.2.7 Enum Types -Enum types are distinct user defined subtypes of the Number primitive type. Enum types are declared using enum declarations (section [9.1](#9.1)) and referenced using type references (section [3.6.2](#3.6.2)). +Enum types are distinct user defined subtypes of the Number primitive type. Enum types are declared using enum declarations (section [9.1](#9.1)) and referenced using type references (section [3.7.2](#3.7.2)). Enum types are assignable to the Number primitive type, and vice versa, but different enum types are not assignable to each other. ### 3.2.8 String Literal Types -Specialized signatures (section [3.7.2.4](#3.7.2.4)) permit string literals to be used as types in parameter type annotations. String literal types are permitted only in that context and nowhere else. +Specialized signatures (section [3.8.2.4](#3.8.2.4)) permit string literals to be used as types in parameter type annotations. String literal types are permitted only in that context and nowhere else. All string literal types are subtypes of the String primitive type. @@ -1053,12 +1057,11 @@ Object types are composed from properties, call signatures, construct signatures Class and interface type references, array types, tuple types, union types, function types, and constructor types are all classified as object types. Multiple constructs in the TypeScript language create object types, including: -* Object type literals (section [3.6.3](#3.6.3)). -* Array type literals (section [3.6.4](#3.6.4)). -* Tuple type literals (section [3.6.5](#3.6.5)). -* Union type literals (section [3.6.6](#3.6.6)). -* Function type literals (section [3.6.7](#3.6.7)). -* Constructor type literals (section [3.6.8](#3.6.8)). +* Object type literals (section [3.7.3](#3.7.3)). +* Array type literals (section [3.7.4](#3.7.4)). +* Tuple type literals (section [3.7.5](#3.7.5)). +* Function type literals (section [3.7.7](#3.7.7)). +* Constructor type literals (section [3.7.8](#3.7.8)). * Object literals (section [4.5](#4.5)). * Array literals (section [4.6](#4.6)). * Function expressions (section [4.9](#4.9)) and function declarations ([6.1](#6.1)). @@ -1067,11 +1070,11 @@ Class and interface type references, array types, tuple types, union types, func ### 3.3.1 Named Type References -Type references (section [3.6.2](#3.6.2)) to class and interface types are classified as object types. Type references to generic class and interface types include type arguments that are substituted for the type parameters of the class or interface to produce an actual object type. +Type references (section [3.7.2](#3.7.2)) to class and interface types are classified as object types. Type references to generic class and interface types include type arguments that are substituted for the type parameters of the class or interface to produce an actual object type. ### 3.3.2 Array Types -***Array types*** represent JavaScript arrays with a common element type. Array types are named type references created from the generic interface type 'Array' in the global module with the array element type as a type argument. Array type literals (section [3.6.4](#3.6.4)) provide a shorthand notation for creating such references. +***Array types*** represent JavaScript arrays with a common element type. Array types are named type references created from the generic interface type 'Array' in the global module with the array element type as a type argument. Array type literals (section [3.7.4](#3.7.4)) provide a shorthand notation for creating such references. The declaration of the 'Array' interface includes a property 'length' and a numeric index signature for the element type, along with other members: @@ -1091,7 +1094,7 @@ var a: string[] = ["hello", "world"]; ### 3.3.3 Tuple Types -***Tuple types*** represent JavaScript arrays with individually tracked element types. Tuple types are written using tuple type literals (section [3.6.5](#3.6.5)). A tuple type combines a set of numerically named properties with the members of an array type. Specifically, a tuple type +***Tuple types*** represent JavaScript arrays with individually tracked element types. Tuple types are written using tuple type literals (section [3.7.5](#3.7.5)). A tuple type combines a set of numerically named properties with the members of an array type. Specifically, a tuple type ```TypeScript [ T0, T1, ..., Tn ] @@ -1108,11 +1111,9 @@ combines the set of properties } ``` -with the members of an array type whose element type is the union type (section [3.3.4](#3.3.4)) of the tuple element types. +with the members of an array type whose element type is the union type (section [3.4](#3.4)) of the tuple element types. -Array literals (section [4.6](#4.6)) may be used to create values of tuple types. - -An example: +Array literals (section [4.6](#4.6)) may be used to create values of tuple types. For example: ```TypeScript var t: [number, string] = [3, "three"]; @@ -1122,9 +1123,41 @@ var i: number; var x = t[i]; // Type of x is number | string ``` -### 3.3.4 Union Types +Named tuple types can be created by declaring interfaces that derive from Array<T> and introduce numerically named properties. For example: -***Union types*** represent values that may have one of several disjoint representations. A value of a union type *A* | *B* is a value that is *either* of type *A* or type *B*. Union types are written using union type literals (section [3.6.6](#3.6.6)). +```TypeScript +interface KeyValuePair extends Array { 0: K; 1: V; } + +var x: KeyValuePair = [10, "ten"]; +``` + +### 3.3.4 Function Types + +An object type containing one or more call signatures is said to be a ***function type***. Function types may be written using function type literals (section [3.7.7](#3.7.7)) or by including call signatures in object type literals. + +### 3.3.5 Constructor Types + +An object type containing one or more construct signatures is said to be a ***constructor type***. Constructor types may be written using constructor type literals (section [3.7.8](#3.7.8)) or by including construct signatures in object type literals. + +### 3.3.6 Members + +Every object type is composed from zero or more of the following kinds of members: + +* ***Properties***, which define the names and types of the properties of objects of the given type. Property names are unique within their type. +* ***Call signatures***, which define the possible parameter lists and return types associated with applying call operations to objects of the given type. +* ***Construct signatures***, which define the possible parameter lists and return types associated with applying the `new` operator to objects of the given type. +* ***Index signatures***, which define type constraints for properties in the given type. An object type can have at most one string index signature and one numeric index signature. + +Properties are either ***public***, ***private***, or ***protected*** and are either ***required*** or ***optional***: + +* Properties in a class declaration may be designated public, private, or protected, while properties declared in other contexts are always considered public. Private members are only accessible within their declaring class, as described in section [8.2.2](#8.2.2), and private properties match only themselves in subtype and assignment compatibility checks, as described in section [0](#0). Protected members are only accessible within their declaring class and classes derived from it, as described in section [8.2.2](#8.2.2), and protected properties match only themselves and overrides in subtype and assignment compatibility checks, as described in section [0](#0). +* Properties in an object type literal or interface declaration may be designated required or optional, while properties declared in other contexts are always considered required. Properties that are optional in the target type of an assignment may be omitted from source objects, as described in section [3.10.4](#3.10.4). + +Call and construct signatures may be ***specialized*** (section [3.8.2.4](#3.8.2.4)) by including parameters with string literal types. Specialized signatures are used to express patterns where specific string values for some parameters cause the types of other parameters or the function result to become further specialized. + +## 3.4 Union Types + +***Union types*** represent values that may have one of several disjoint representations. A value of a union type *A* | *B* is a value that is *either* of type *A* or type *B*. Union types are written using union type literals (section [3.7.6](#3.7.6)). A union type encompasses an unordered set of unrelated types (that is, types that aren't subtypes of each other). The following rules govern union types: @@ -1144,22 +1177,6 @@ Similarly, union types have the following assignability relationships: * A union type *U* is assignable to a type *T* if each type in *U* is assignable to *T*. * A type *T* is assignable to a union type *U* if *T* is assignable to any type in *U*. -For purposes of property access (section [4.10](#4.10)) and function calls ([4.12](#4.12)), a union type *U* has those members that are present in every one of its constituent types, with types that are unions of the respective members in the constituent types. Specifically: - -* If each type in *U* has a property *P*, *U* has a property *P* of a union type of the types of *P* from each type in *U*. -* If each type in *U* has call signatures and the sets of call signatures are identical ignoring return types, *U* has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in *U*. -* If each type in *U* has construct signatures and the sets of construct signatures are identical ignoring return types, *U* has the same set of construct signatures, but with return types that are unions of the return types of the respective construct signatures from each type in *U*. -* If each type in *U* has a string index signature, *U* has a string index signature of a union type of the types of the string index signatures from each type in *U*. -* If each type in *U* has a numeric index signature, *U* has a numeric index signature of a union type of the types of the numeric index signatures from each type in *U*. - -When used as a contextual type (section [4.19](#4.19)), a union type *U* has those members that are present in any of its constituent types, with types that are unions of the respective members in the constituent types. Specifically: - -* Let *S* be the set of types in *U* that has a property *P*. If *S* is not empty, *U* has a property *P* of a union type of the types of *P* from each type in *S*. -* Let *S* be the set of types in *U* that have call signatures. If *S* is not empty and the sets of call signatures of the types in *S* are identical ignoring return types, *U* has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in *S*. -* Let *S* be the set of types in *U* that have construct signatures. If *S* is not empty and the sets of construct signatures of the types in *S* are identical ignoring return types, *U* has the same set of construct signatures, but with return types that are unions of the return types of the respective construct signatures from each type in *S*. -* Let *S* be the set of types in *U* that has a string index signature. If *S* is not empty, *U* has a string index signature of a union type of the types of the string index signatures from each type in *S*. -* Let *S* be the set of types in *U* that has a numeric index signature. If *S* is not empty, *U* has a numeric index signature of a union type of the types of the numeric index signatures from each type in *S*. - The || and conditional operators (section [4.15.7](#4.15.7) and [4.16](#4.16)) may produce values of union types, and array literals (section [4.6](#4.6)) may produce array values that have union types as their element types. Type guards (section [4.20](#4.20)) may be used to narrow a union type to a more specific type. In particular, type guards are useful for narrowing union type values to a non-union type values. @@ -1182,7 +1199,7 @@ it is possible to assign 'x' a value of type string, number, or the union type s var n = typeof x === "string" ? x.length : x; // Type of n is number ``` -The following example illustrates the merging of member types that occurs when union types are created from object types. +For purposes of property access and function calls, the apparent members (section [3.10.1](#3.10.1)) of a union type *U* are those that are present in every one of its constituent types, with types that are unions of the respective apparent members in the constituent types. The following example illustrates the merging of member types that occurs when union types are created from object types. ```TypeScript interface A { @@ -1204,37 +1221,23 @@ var c = x.c; // Error, no property c in union type Note that 'x.a' has a union type because the type of 'a' is different in 'A' and 'B', whereas 'x.b' simply has type number because that is the type of 'b' in both 'A' and 'B'. Also note that there is no property 'x.c' because only 'A' has a property 'c'. -### 3.3.5 Function Types +### 3.4.1 Contextual Union Types -An object type containing one or more call signatures is said to be a ***function type***. Function types may be written using function type literals (section [3.6.7](#3.6.7)) or by including call signatures in object type literals. +When used as a contextual type (section [4.19](#4.19)), a union type *U* has those members that are present in any of its constituent types, with types that are unions of the respective members in the constituent types. Specifically: -### 3.3.6 Constructor Types +* Let *S* be the set of types in *U* that has a property *P*. If *S* is not empty, *U* has a property *P* of a union type of the types of *P* from each type in *S*. +* Let *S* be the set of types in *U* that have call signatures. If *S* is not empty and the sets of call signatures of the types in *S* are identical ignoring return types, *U* has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in *S*. +* Let *S* be the set of types in *U* that have construct signatures. If *S* is not empty and the sets of construct signatures of the types in *S* are identical ignoring return types, *U* has the same set of construct signatures, but with return types that are unions of the return types of the respective construct signatures from each type in *S*. +* Let *S* be the set of types in *U* that has a string index signature. If *S* is not empty, *U* has a string index signature of a union type of the types of the string index signatures from each type in *S*. +* Let *S* be the set of types in *U* that has a numeric index signature. If *S* is not empty, *U* has a numeric index signature of a union type of the types of the numeric index signatures from each type in *S*. -An object type containing one or more construct signatures is said to be a ***constructor type***. Constructor types may be written using constructor type literals (section [3.6.8](#3.6.8)) or by including construct signatures in object type literals. - -### 3.3.7 Members - -Every object type is composed from zero or more of the following kinds of members: - -* ***Properties***, which define the names and types of the properties of objects of the given type. Property names are unique within their type. -* ***Call signatures***, which define the possible parameter lists and return types associated with applying call operations to objects of the given type. -* ***Construct signatures***, which define the possible parameter lists and return types associated with applying the `new` operator to objects of the given type. -* ***Index signatures***, which define type constraints for properties in the given type. An object type can have at most one string index signature and one numeric index signature. - -Properties are either ***public***, ***private***, or ***protected*** and are either ***required*** or ***optional***: - -* Properties in a class declaration may be designated public, private, or protected, while properties declared in other contexts are always considered public. Private members are only accessible within their declaring class, as described in section [8.2.2](#8.2.2), and private properties match only themselves in subtype and assignment compatibility checks, as described in section [3.8](#3.8). Protected members are only accessible within their declaring class and classes derived from it, as described in section [8.2.2](#8.2.2), and protected properties match only themselves and overrides in subtype and assignment compatibility checks, as described in section [3.8](#3.8). -* Properties in an object type literal or interface declaration may be designated required or optional, while properties declared in other contexts are always considered required. Properties that are optional in the target type of an assignment may be omitted from source objects, as described in section [3.8.4](#3.8.4). - -Call and construct signatures may be ***specialized*** (section [3.7.2.4](#3.7.2.4)) by including parameters with string literal types. Specialized signatures are used to express patterns where specific string values for some parameters cause the types of other parameters or the function result to become further specialized. - -## 3.4 Type Parameters +## 3.5 Type Parameters A type parameter represents an actual type that the parameter is bound to in a generic type reference or a generic function call. Type parameters have constraints that establish upper bounds for their actual type arguments. Since a type parameter represents a multitude of different type arguments, type parameters have certain restrictions compared to other types. In particular, a type parameter cannot be used as a base class or interface. -### 3.4.1 Type Parameter Lists +### 3.5.1 Type Parameter Lists Class, interface, and function declarations may optionally include lists of type parameters enclosed in < and > brackets. Type parameters are also permitted in call signatures of object, function, and constructor type literals. @@ -1273,11 +1276,11 @@ interface G { the base constraint of 'T' is the empty object type, and the base constraint of 'U' and 'V' is 'Function'. -For purposes of determining type relationships (section [3.8](#3.8)), type parameters appear to be subtypes of their base constraint. Likewise, in property accesses (section [4.10](#4.10)), `new` operations (section [4.11](#4.11)), and function calls (section [4.12](#4.12)), type parameters appear to have the members of their base constraint, but no other members. +For purposes of determining type relationships (section [0](#0)), type parameters appear to be subtypes of their base constraint. Likewise, in property accesses (section [4.10](#4.10)), `new` operations (section [4.11](#4.11)), and function calls (section [4.12](#4.12)), type parameters appear to have the members of their base constraint, but no other members. -### 3.4.2 Type Argument Lists +### 3.5.2 Type Argument Lists -A type reference (section [3.6.2](#3.6.2)) to a generic type must include a list of type arguments enclosed in angle brackets and separated by commas. Similarly, a call (section [4.12](#4.12)) to a generic function may explicitly include a type argument list instead of relying on type inference. +A type reference (section [3.7.2](#3.7.2)) to a generic type must include a list of type arguments enclosed in angle brackets and separated by commas. Similarly, a call (section [4.12](#4.12)) to a generic function may explicitly include a type argument list instead of relying on type inference.   *TypeArguments:*    `<` *TypeArgumentList* `>` @@ -1289,7 +1292,7 @@ A type reference (section [3.6.2](#3.6.2)) to a generic type must include a list   *TypeArgument:*    *Type* -Type arguments correspond one-to-one with type parameters of the generic type or function being referenced. A type argument list is required to specify exactly one type argument for each corresponding type parameter, and each type argument is required to ***satisfy*** the constraint of its corresponding type parameter. A type argument satisfies a type parameter constraint if the type argument is assignable to (section [3.8.4](#3.8.4)) the constraint type once type arguments are substituted for type parameters. +Type arguments correspond one-to-one with type parameters of the generic type or function being referenced. A type argument list is required to specify exactly one type argument for each corresponding type parameter, and each type argument is required to ***satisfy*** the constraint of its corresponding type parameter. A type argument satisfies a type parameter constraint if the type argument is assignable to (section [3.10.4](#3.10.4)) the constraint type once type arguments are substituted for type parameters. Given the declaration @@ -1301,13 +1304,13 @@ a type reference of the form 'G<A, B>' places no requirements on 'A' but requ The process of substituting type arguments for type parameters in a generic type or generic signature is known as ***instantiating*** the generic type or signature. Instantiation of a generic type or signature can fail if the supplied type arguments do not satisfy the constraints of their corresponding type parameters. -## 3.5 Named Types +## 3.6 Named Types -Class, interface, and enum types are ***named types*** that are introduced through class declarations (section [8.1](#8.1)), interface declarations (section [7.1](#7.1)), and enum declarations ([9.1](#9.1)). Class and interface types may have type parameters and are then called ***generic types***. Conversely, named types without type parameters are called ***non-generic types***. +Classes, interfaces, enums, and type aliases are ***named types*** that are introduced through class declarations (section [8.1](#8.1)), interface declarations (section [7.1](#7.1)), enum declarations ([9.1](#9.1)), and type alias declarations (section [3.9](#3.9)). Class and interface types may have type parameters and are then called ***generic types***. Conversely, named types without type parameters are called ***non-generic types***. Interface declarations only introduce named types, whereas class declarations introduce named types *and* constructor functions that create instances of implementations of those named types. The named types introduced by class and interface declarations have only minor differences (classes can't declare optional members and interfaces can't declare private or protected members) and are in most contexts interchangeable. In particular, class declarations with only public members introduce named types that function exactly like those created by interface declarations. -Named types are referenced through ***type references*** (section [3.6.2](#3.6.2)) that specify a type name and, if applicable, the type arguments to be substituted for the type parameters of the named type. +Named types are referenced through ***type references*** (section [3.7.2](#3.7.2)) that specify a type name and, if applicable, the type arguments to be substituted for the type parameters of the named type. Named types are technically not types—only *references* to named types are. This distinction is particularly evident with generic types: Generic types are "templates" from which multiple *actual* types can be created by writing type references that supply type arguments to substitute in place of the generic type's type parameters. This substitution process is known as ***instantiating*** a generic type. Only once a generic type is instantiated does it denote an actual type. @@ -1329,9 +1332,9 @@ is indistinguishable from the type { first: string; second: Entity; } ``` -### 3.5.1 Instance Types +### 3.6.1 Instance Types -Each named type has an associated actual type known as the ***instance type***. For a non-generic type, the instance type is simply a type reference to the non-generic type. For a generic type, the instance type is an instantiation of the generic type where each of the type arguments is the corresponding type parameter. Since the instance type uses the type parameters it can be used only where the type parameters are in scope—that is, inside the declaration of the generic type. Within the constructor and instance member functions of a class, the type of `this` is the instance type of the class. +Each class and interface has an associated actual type known as the ***instance type***. For a non-generic class or interface, the instance type is simply a type reference to the class or interface. For a generic class or interface, the instance type is an instantiation of the generic type where each of the type arguments is the corresponding type parameter. Since the instance type uses the type parameters it can be used only where the type parameters are in scope—that is, inside the declaration of the class or interface. Within the constructor and instance member functions of a class, the type of `this` is the instance type of the class. The following example illustrates the concept of an instance type: @@ -1344,7 +1347,7 @@ class G { // Introduce type parameter T } ``` -## 3.6 Specifying Types +## 3.7 Specifying Types Types are specified either by referencing their keyword or name, or by writing object type literals, array type literals, tuple type literals, function type literals, constructor type literals, or type queries. @@ -1378,7 +1381,7 @@ Parentheses are required around union, function, or constructor types when they The different forms of type notations are described in the following sections. -### 3.6.1 Predefined Types +### 3.7.1 Predefined Types The `any`, `number`, `boolean`, `string`, and `void` keywords reference the Any type and the Number, Boolean, String, and Void primitive types respectively. @@ -1391,7 +1394,7 @@ The `any`, `number`, `boolean`, `string`, and `void` keywords reference the Any The predefined type keywords are reserved and cannot be used as names of user defined types. -### 3.6.2 Type References +### 3.7.2 Type References A type reference references a named type or type parameter through its name and, in the case of a generic type, supplies a type argument list. @@ -1406,7 +1409,7 @@ A type reference references a named type or type parameter through its name and,    *Identifier*    *ModuleName* `.` *Identifier* -A *TypeReference* consists of a *TypeName* that a references a named type or type parameter. A reference to a generic type must be followed by a list of *TypeArguments* (section [3.4.2](#3.4.2)). +A *TypeReference* consists of a *TypeName* that a references a named type or type parameter. A reference to a generic type must be followed by a list of *TypeArguments* (section [3.5.2](#3.5.2)). Resolution of a *TypeName* consisting of a single identifier is described in section [2.4](#2.4). @@ -1416,7 +1419,7 @@ Resolution of a *ModuleName* consisting of a single identifier is described in s Resolution of a *ModuleName* of the form *M.N*, where *M* is a *ModuleName* and *N* is an *Identifier*, proceeds by first resolving the module name *M*. If the resolution of *M* is successful and the resulting module contains an exported module member *N*, then *M.N* refers to that member. Otherwise, *M.N* is undefined. -A type reference to a generic type is required to specify exactly one type argument for each type parameter of the referenced generic type, and each type argument must be assignable to (section [3.8.4](#3.8.4)) the constraint of the corresponding type parameter or otherwise an error occurs. An example: +A type reference to a generic type is required to specify exactly one type argument for each type parameter of the referenced generic type, and each type argument must be assignable to (section [3.10.4](#3.10.4)) the constraint of the corresponding type parameter or otherwise an error occurs. An example: ```TypeScript interface A { a: string; } @@ -1441,7 +1444,7 @@ var v7: G; // Error, no arguments A type argument is simply a *Type* and may itself be a type reference to a generic type, as demonstrated by 'v4' in the example above. -As described in section [3.5](#3.5), a type reference to a generic type *G* designates a type wherein all occurrences of *G*'s type parameters have been replaced with the actual type arguments supplied in the type reference. For example, the declaration of 'v1' above is equivalent to: +As described in section [3.6](#3.6), a type reference to a generic type *G* designates a type wherein all occurrences of *G*'s type parameters have been replaced with the actual type arguments supplied in the type reference. For example, the declaration of 'v1' above is equivalent to: ```TypeScript var v1: { @@ -1450,7 +1453,7 @@ var v1: { }; ``` -### 3.6.3 Object Type Literals +### 3.7.3 Object Type Literals An object type literal defines an object type by specifying the set of members that are statically considered to be present in instances of the type. Object type literals can be given names using interface declarations but are otherwise anonymous. @@ -1471,9 +1474,9 @@ An object type literal defines an object type by specifying the set of members t    *IndexSignature*    *MethodSignature* -The members of an object type literal are specified as a combination of property, call, construct, index, and method signatures. Object type members are described in section [3.7](#3.7). +The members of an object type literal are specified as a combination of property, call, construct, index, and method signatures. Object type members are described in section [3.8](#3.8). -### 3.6.4 Array Type Literals +### 3.7.4 Array Type Literals An array type literal is written as an element type followed by an open and close square bracket. @@ -1496,7 +1499,7 @@ Array Array<() => string> ``` -### 3.6.5 Tuple Type Literals +### 3.7.5 Tuple Type Literals A tuple type literal is written as a sequence of element types, separated by commas and enclosed in square brackets. @@ -1512,14 +1515,14 @@ A tuple type literal is written as a sequence of element types, separated by com A tuple type literal references a tuple type (section [3.3.3](#3.3.3)). -### 3.6.6 Union Type Literals +### 3.7.6 Union Type Literals A union type literal is written as a sequence of types separated by vertical bars.   *UnionType:*    *PrimaryOrUnionType* `|` *PrimaryType* -A union typle literal references a union type (section [3.3.4](#3.3.4)). +A union typle literal references a union type (section [3.4](#3.4)). When function or constructor types are included in union types they must be enclosed in parentheses. For example: @@ -1533,7 +1536,7 @@ Alternatively, function or constructor types in union types can be written using { (x: string): string } | { (x: number): number } ``` -### 3.6.7 Function Type Literals +### 3.7.7 Function Type Literals A function type literal specifies the type parameters, regular parameters, and return type of a call signature. @@ -1554,7 +1557,7 @@ is exactly equivalent to the object type literal Note that function types with multiple call or construct signatures cannot be written as function type literals but must instead be written as object type literals. -### 3.6.8 Constructor Type Literals +### 3.7.8 Constructor Type Literals A constructor type literal specifies the type parameters, regular parameters, and return type of a construct signature. @@ -1575,7 +1578,7 @@ is exactly equivalent to the object type literal Note that constructor types with multiple construct signatures cannot be written as constructor type literals but must instead be written as object type literals. -### 3.6.9 Type Queries +### 3.7.9 Type Queries A type query obtains the type of an expression. @@ -1586,7 +1589,7 @@ A type query obtains the type of an expression.    *Identifier*    *TypeQueryExpression* `.` *IdentifierName* -A type query consists of the keyword `typeof` followed by an expression. The expression is restricted to a single identifier or a sequence of identifiers separated by periods. The expression is processed as an identifier expression (section [4.3](#4.3)) or property access expression (section [4.10](#4.10)), the widened type (section [3.9](#3.9)) of which becomes the result. Similar to other static typing constructs, type queries are erased from the generated JavaScript code and add no run-time overhead. +A type query consists of the keyword `typeof` followed by an expression. The expression is restricted to a single identifier or a sequence of identifiers separated by periods. The expression is processed as an identifier expression (section [4.3](#4.3)) or property access expression (section [4.10](#4.10)), the widened type (section [3.11](#3.11)) of which becomes the result. Similar to other static typing constructs, type queries are erased from the generated JavaScript code and add no run-time overhead. Type queries are useful for capturing anonymous types that are generated by various constructs such as object literals, function declarations, and module declarations. For example: @@ -1615,11 +1618,11 @@ var h: () => typeof h; Here, 'g' and 'g.x' have the same recursive type, and likewise 'h' and 'h()' have the same recursive type. -## 3.7 Specifying Members +## 3.8 Specifying Members -The members of an object type literal (section [3.6.3](#3.6.3)) are specified as a combination of property, call, construct, index, and method signatures. +The members of an object type literal (section [3.7.3](#3.7.3)) are specified as a combination of property, call, construct, index, and method signatures. -### 3.7.1 Property Signatures +### 3.8.1 Property Signatures A property signature declares the name and type of a property member. @@ -1637,26 +1640,26 @@ The *PropertyName* of a property signature must be unique within its containing If a property signature omits a *TypeAnnotation*, the Any type is assumed. -### 3.7.2 Call Signatures +### 3.8.2 Call Signatures A call signature defines the type parameters, parameter list, and return type associated with applying a call operation (section [4.12](#4.12)) to an instance of the containing type. A type may ***overload*** call operations by defining multiple different call signatures.   *CallSignature:*    *TypeParametersopt* `(` *ParameterListopt* `)` *TypeAnnotationopt* -A call signature that includes *TypeParameters* (section [3.4.1](#3.4.1)) is called a ***generic call signature***. Conversely, a call signature with no *TypeParameters* is called a non-generic call signature. +A call signature that includes *TypeParameters* (section [3.5.1](#3.5.1)) is called a ***generic call signature***. Conversely, a call signature with no *TypeParameters* is called a non-generic call signature. -As well as being members of object type literals, call signatures occur in method signatures (section [3.7.5](#3.7.5)), function expressions (section [4.9](#4.9)), and function declarations (section [6.1](#6.1)). +As well as being members of object type literals, call signatures occur in method signatures (section [3.8.5](#3.8.5)), function expressions (section [4.9](#4.9)), and function declarations (section [6.1](#6.1)). An object type containing call signatures is said to be a ***function type***. -#### 3.7.2.1 Type Parameters +#### 3.8.2.1 Type Parameters -Type parameters (section [3.4.1](#3.4.1)) in call signatures provide a mechanism for expressing the relationships of parameter and return types in call operations. For example, a signature might introduce a type parameter and use it as both a parameter type and a return type, in effect describing a function that returns a value of the same type as its argument. +Type parameters (section [3.5.1](#3.5.1)) in call signatures provide a mechanism for expressing the relationships of parameter and return types in call operations. For example, a signature might introduce a type parameter and use it as both a parameter type and a return type, in effect describing a function that returns a value of the same type as its argument. Type parameters may be referenced in parameter types and return type annotations, but not in type parameter constraints, of the call signature in which they are introduced. -Type arguments (section [3.4.2](#3.4.2)) for call signature type parameters may be explicitly specified in a call operation or may, when possible, be inferred (section [4.12.2](#4.12.2)) from the types of the regular arguments in the call. An ***instantiation*** of a generic call signature for a particular set of type arguments is the call signature formed by replacing each type parameter with its corresponding type argument. +Type arguments (section [3.5.2](#3.5.2)) for call signature type parameters may be explicitly specified in a call operation or may, when possible, be inferred (section [4.12.2](#4.12.2)) from the types of the regular arguments in the call. An ***instantiation*** of a generic call signature for a particular set of type arguments is the call signature formed by replacing each type parameter with its corresponding type argument. Some examples of call signatures with type parameters follow below. @@ -1684,7 +1687,7 @@ A function taking an array of one type and a function argument, returning an arr (a: T[], f: (x: T) => U): U[] ``` -#### 3.7.2.2 Parameter List +#### 3.8.2.2 Parameter List A signature's parameter list consists of zero or more required parameters, followed by zero or more optional parameters, finally followed by an optional rest parameter. @@ -1730,11 +1733,11 @@ A parameter with a type annotation is considered to be of that type. A type anno A parameter with no type annotation or initializer is considered to be of type `any`, unless it is a rest parameter, in which case it is considered to be of type `any[]`. -When a parameter type annotation specifies a string literal type, the containing signature is a specialized signature (section [3.7.2.4](#3.7.2.4)). Specialized signatures are not permitted in conjunction with a function body, i.e. the *FunctionExpression*, *FunctionImplementation*, *MemberFunctionImplementation*, and *ConstructorImplementation* grammar productions do not permit parameters with string literal types. +When a parameter type annotation specifies a string literal type, the containing signature is a specialized signature (section [3.8.2.4](#3.8.2.4)). Specialized signatures are not permitted in conjunction with a function body, i.e. the *FunctionExpression*, *FunctionImplementation*, *MemberFunctionImplementation*, and *ConstructorImplementation* grammar productions do not permit parameters with string literal types. A parameter can be marked optional by following its name with a question mark (`?`) or by including an initializer. The form that includes an initializer is permitted only in conjunction with a function body, i.e. only in a *FunctionExpression*, *FunctionImplementation*, *MemberFunctionImplementation*, or *ConstructorImplementation* grammar production. -#### 3.7.2.3 Return Type +#### 3.8.2.3 Return Type If present, a call signature's return type annotation specifies the type of the value computed and returned by a call operation. A `void` return type annotation is used to indicate that a function has no return value. @@ -1742,7 +1745,7 @@ When a call signature with no return type annotation occurs in a context without When a call signature with no return type annotation occurs in a context that has a function body (specifically, a function implementation, a member function implementation, or a member accessor declaration), the return type is inferred from the function body as described in section [6.3](#6.3). -#### 3.7.2.4 Specialized Signatures +#### 3.8.2.4 Specialized Signatures When a parameter type annotation specifies a string literal type (section [3.2.8](#3.2.8)), the containing signature is considered a specialized signature. Specialized signatures are used to express patterns where specific string values for some parameters cause the types of other parameters or the function result to become further specialized. For example, the declaration @@ -1761,7 +1764,7 @@ When writing overloaded declarations such as the one above it is important to li Every specialized call or construct signature in an object type must be assignable to at least one non-specialized call or construct signature in the same object type (where a call signature *A* is considered assignable to another call signature *B* if an object type containing only *A* would be assignable to an object type containing only *B*). For example, the 'createElement' property in the example above is of a type that contains three specialized signatures, all of which are assignable to the non-specialized signature in the type. -### 3.7.3 Construct Signatures +### 3.8.3 Construct Signatures A construct signature defines the parameter list and return type associated with applying the `new` operator (section [4.11](#4.11)) to an instance of the containing type. A type may overload `new` operations by defining multiple construct signatures with different parameter lists. @@ -1772,7 +1775,7 @@ The type parameters, parameter list, and return type of a construct signature ar A type containing construct signatures is said to be a ***constructor type***. -### 3.7.4 Index Signatures +### 3.8.4 Index Signatures An index signature defines a type constraint for properties in the containing type. @@ -1791,7 +1794,7 @@ An object type can contain at most one string index signature and one numeric in Index signatures affect the determination of the type that results from applying a bracket notation property access to an instance of the containing type, as described in section [4.10](#4.10). -### 3.7.5 Method Signatures +### 3.8.5 Method Signatures A method signature is shorthand for declaring a property of a function type. @@ -1855,27 +1858,92 @@ the properties 'func1', 'func2', and 'func3' are all of the same type, namely an the properties 'func4' and 'func5' are of the same type, namely an object type with two call signatures taking and returning number and string respectively. -## 3.8 Type Relationships +## 3.9 Type Aliases + +A type alias declaration introduces a ***type alias*** in the containing module. + +  *TypeAliasDeclaration:* +   `type` *Identifier* `=` *Type* `;` + +A type alias serves as an alias for the type specified in the type alias declaration. Unlike an interface declaration, which always introduces a named object type, a type alias declaration can introduce a name for any kind of type, including primitive types and union types. + +Type aliases are referenced using type references ([3.7.2](#3.7.2)). Writing a reference to a type alias has ***exactly*** the same effect as writing the aliased type itself. + +The *Identifier* of a type alias declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). + +It is an error for the type specified in a type alias to depend on that type alias. Types have the following dependencies: + +* A type alias *directly depends on* the type it aliases. +* A type reference *directly depends on* the referenced type and each of the type arguments, if any. +* A union type *directly depends on* each of the constituent types. +* An array type *directly depends on* its element type. +* A tuple type *directly depends on* each of its element types. +* A type query *directly depends on* the type of the referenced entity. + +Given this definition, the complete set of types upon which a type depends is the transitive closure of the *directly depends on* relationship. Note that object type literals, function type literals, and constructor type literals do not depend on types referenced within them and are therefore permitted to circularly reference themselves through type aliases. + +Some examples of type alias declarations: + +```TypeScript +type StringOrNumber = string | number; +type Text = string | { text: string }; +type Coordinates = [number, number]; +type NameLookup = Dictionary; +type Callback = (data: string) => void; +type RecFunc = () => RecFunc; +type ObjectStatics = typeof Object; +``` + +Interface types have many similarities to type aliases for object type literals, but since interface types offer more capabilities they are generally preferred to type aliases. For example, the interface type + +```TypeScript +interface Point { + x: number; + y: number; +} +``` + +could be written as the type alias + +```TypeScript +type Point = { + x: number; + y: number; +}; +``` + +However, doing so means the following capabilities are lost: + +* An interface can be named in an extends or implements clause, but a type alias for an object type literal cannot. +* An interface can have multiple merged declarations, but a type alias for an object type literal cannot. +* An interface can have type parameters, but a type alias for an object type literal cannot. +* An interface is referenced by its name in error messages and tooling, but a type alias is always expanded to its structural representation. + +## 3.10 Type Relationships Types in TypeScript have identity, subtype, supertype, and assignment compatibility relationships as defined in the following sections. -For purposes of determining type relationships, all object types appear to have the members of the 'Object' interface unless those members are hidden by members with the same name in the object types, and object types with one or more call or construct signatures appear to have the members of the 'Function' interface unless those members are hidden by members with the same name in the object types. Apparent types (section [3.8.1](#3.8.1)) that are object types appear to have these extra members as well. +### 3.10.1 Apparent Members -### 3.8.1 Apparent Type +The ***apparent members*** of a type are the members observed in subtype, supertype, and assignment compatibility relationships, as well as in the type checking of property accesses (section [4.10](#4.10)), `new` operations (section [4.11](#4.11)), and function calls (section [4.12](#4.12)). The apparent members of a type are determined as follows: -In certain contexts a type appears to have the characteristics of a related type called the type's ***apparent type***. Specifically, a type's apparent type is used when determining subtype, supertype, and assignment compatibility relationships, as well as in the type checking of property accesses (section [4.10](#4.10)), `new` operations (section [4.11](#4.11)), and function calls (section [4.12](#4.12)). +* The apparent members of the primitive types Number, Boolean, and String are the apparent members of the global interface types 'Number', 'Boolean', and 'String' respectively. +* The apparent members of an enum type are the apparent members of the global interface type 'Number'. +* The apparent members of a type parameter are the apparent members of the base constraint (section [3.5.1](#3.5.1)) of that type parameter. +* The apparent members of an object type *T* are the combination of the following: + * The declared and/or inherited members of *T*. + * The properties of the global interface type 'Object' that aren't hidden by properties with the same name in *T*. + * If *T* has one or more call or construct signatures, the properties of the global interface type 'Function' that aren't hidden by properties with the same name in *T*. +* The apparent members of a union type *U* are determined as follows: + * If each type in *U* has an apparent property *P*, *U* has an apparent property *P* of a union type of the types of *P* from each type in *U*. + * If each type in *U* has apparent call signatures and the sets of apparent call signatures are identical ignoring return types, *U* has the same set of call signatures, but with return types that are unions of the return types of the respective apparent call signatures from each type in *U*. + * If each type in *U* has apparent construct signatures and the sets of apparent construct signatures are identical ignoring return types, *U* has the same set of construct signatures, but with return types that are unions of the return types of the respective apparent construct signatures from each type in *U*. + * If each type in *U* has an apparent string index signature, *U* has a string index signature of a union type of the types of the apparent string index signatures from each type in *U*. + * If each type in *U* has an apparent numeric index signature, *U* has a numeric index signature of a union type of the types of the apparent numeric index signatures from each type in *U*. -The apparent type of a type *T* is defined as follows: +If a type is not one of the above, it is considered to have no apparent members. -* If *T* is the primitive type Number, Boolean, or String, the apparent type of *T* is the augmented form (as defined below) of the global interface type 'Number', 'Boolean', or 'String'. -* if *T* is an enum type, the apparent type of *T* is the augmented form of the global interface type 'Number'. -* If *T* is an object type, the apparent type of *T* is the augmented form of *T*. -* If *T* is a type parameter, the apparent type of *T* is the apparent type of *T*'s base constraint (section [3.4.1](#3.4.1)). -* Otherwise, the apparent type of *T* is *T* itself. - -The augmented form of an object type *T* adds to *T* those properties of the global interface type 'Object' that aren't hidden by properties in *T*. Furthermore, if *T* has one or more call or construct signatures, the augmented form of *T* adds to *T* the properties of the global interface type 'Function' that aren't hidden by properties in *T*. Properties in *T* hide 'Object' or 'Function' interface properties with the same name. - -In effect, a type's apparent type is a subtype of the 'Object' or 'Function' interface unless the type defines members that are incompatible with those of the 'Object' or 'Function' interface—which, for example, occurs if the type defines a property with the same name as a property in the 'Object' or 'Function' interface but with a type that isn't a subtype of that in the 'Object' or 'Function' interface. +In effect, a type's apparent members make it a subtype of the 'Object' or 'Function' interface unless the type defines members that are incompatible with those of the 'Object' or 'Function' interface—which, for example, occurs if the type defines a property with the same name as a property in the 'Object' or 'Function' interface but with a type that isn't a subtype of that in the 'Object' or 'Function' interface. Some examples: @@ -1885,9 +1953,9 @@ var f: Function = (x: number) => x * x; // Ok var err: Object = { toString: 0 }; // Error ``` -The last assignment is an error because the apparent type of the object literal has a 'toString' method that isn't compatible with that of 'Object'. +The last assignment is an error because the object literal has a 'toString' method that isn't compatible with that of 'Object'. -### 3.8.2 Type and Member Identity +### 3.10.2 Type and Member Identity Two types are considered ***identical*** when @@ -1895,7 +1963,7 @@ Two types are considered ***identical*** when * they are the same primitive type, * they are the same type parameter, * they are union types with identical sets of constituent types, or -* they are non-union object types with identical sets of members. +* they are object types with identical sets of members. Two members are considered identical when @@ -1924,9 +1992,9 @@ var b: C; the variables 'a' and 'b' are of identical types because the two type references to 'C' create types with a private member 'x' that originates in the same declaration, and because the two private 'x' members have types with identical sets of members once the type arguments 'X' and 'Y' are substituted. -### 3.8.3 Subtypes and Supertypes +### 3.10.3 Subtypes and Supertypes -*S* is a ***subtype*** of a type *T*, and *T* is a ***supertype*** of *S*, if one of the following is true, where *S*' denotes the apparent type (section [3.8.1](#3.8.1)) of *S*: +*S* is a ***subtype*** of a type *T*, and *T* is a ***supertype*** of *S*, if one of the following is true: * *S* and *T* are identical types. * *T* is the Any type. @@ -1937,32 +2005,31 @@ the variables 'a' and 'b' are of identical types because the two type references * *S* and *T* are type parameters, and *S* is directly or indirectly constrained to *T*. * *S* is a union type and each constituent type of *S* is a subtype of *T*. * *T* is a union type and *S* is a subtype of at least one constituent type of *T*. -* *S'* and *T* are object types and, for each member *M* in *T*, one of the following is true: - * *M* is a property and *S'* contains a property *N* where +* *S* is an object type, a type parameter, or the Number, Boolean, or String primitive type, *T* is an object type, and for each member *M* in *T*, one of the following is true: + * *M* is a property and *S* has an apparent property *N* where * *M* and *N* have the same name, * the type of *N* is a subtype of that of *M*, * if *M* is a required property, *N* is also a required property, and * *M* and *N* are both public, *M* and *N* are both private and originate in the same declaration, *M* and *N* are both protected and originate in the same declaration, or *M* is protected and *N* is declared in a class derived from the class in which *M* is declared. - * *M* is an optional property and *S'* contains no property of the same name as *M*. - * *M* is a non-specialized call or construct signature and *S*' contains a call or construct signature *N* where, when *M* and *N* are instantiated using type Any as the type argument for all type parameters declared by *M* and *N* (if any), + * *M* is a non-specialized call or construct signature and *S* has an apparent call or construct signature *N* where, when *M* and *N* are instantiated using type Any as the type argument for all type parameters declared by *M* and *N* (if any), * the signatures are of the same kind (call or construct), * *M* has a rest parameter or the number of non-optional parameters in *N* is less than or equal to the total number of parameters in *M*, * for parameter positions that are present in both signatures, each parameter type in *N* is a subtype or supertype of the corresponding parameter type in *M*, and * the result type of *M* is Void, or the result type of *N* is a subtype of that of *M*. - * *M* is a string index signature of type *U* and *S'* contains a string index signature of a type that is a subtype of *U*. - * *M* is a numeric index signature of type *U* and *S'* contains a string or numeric index signature of a type that is a subtype of *U*. + * *M* is a string index signature of type *U* and *S* has an apparent string index signature of a type that is a subtype of *U*. + * *M* is a numeric index signature of type *U* and *S* has an apparent string or numeric index signature of a type that is a subtype of *U*. When comparing call or construct signatures, parameter names are ignored and rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. -Note that specialized call and construct signatures (section [3.7.2.4](#3.7.2.4)) are not significant when determining subtype and supertype relationships. +Note that specialized call and construct signatures (section [3.8.2.4](#3.8.2.4)) are not significant when determining subtype and supertype relationships. Also note that type parameters are not considered object types. Thus, the only subtypes of a type parameter *T* are *T* itself and other type parameters that are directly or indirectly constrained to *T*. -### 3.8.4 Assignment Compatibility +### 3.10.4 Assignment Compatibility Types are required to be assignment compatible in certain circumstances, such as expression and variable types in assignment statements and argument and parameter types in function calls. -*S* is ***assignable to*** a type *T*, and *T* is ***assignable from*** *S*, if one of the following is true, where *S*' denotes the apparent type (section [3.8.1](#3.8.1)) of *S*: +*S* is ***assignable to*** a type *T*, and *T* is ***assignable from*** *S*, if one of the following is true: * *S* and *T* are identical types. * *S* or *T* is the Any type. @@ -1973,29 +2040,30 @@ Types are required to be assignment compatible in certain circumstances, such as * *S* and *T* are type parameters, and *S* is directly or indirectly constrained to *T*. * *S* is a union type and each constituent type of *S* is assignable to *T*. * *T* is a union type and *S* is assignable to at least one constituent type of *T*. -* *S'* and *T* are object types and, for each member *M* in *T*, one of the following is true: - * *M* is a property and *S'* contains a property *N* where +* *S* is an object type, a type parameter, or the Number, Boolean, or String primitive type, *T* is an object type, and for each member *M* in *T*, one of the following is true: + * *M* is a property and *S* has an apparent property *N* where * *M* and *N* have the same name, * the type of *N* is assignable to that of *M*, * if *M* is a required property, *N* is also a required property, and * *M* and *N* are both public, *M* and *N* are both private and originate in the same declaration, *M* and *N* are both protected and originate in the same declaration, or *M* is protected and *N* is declared in a class derived from the class in which *M* is declared. - * *M* is an optional property and *S'* contains no property of the same name as *M*. - * *M* is a non-specialized call or construct signature and *S*' contains a call or construct signature *N* where, when *M* and *N* are instantiated using type Any as the type argument for all type parameters declared by *M* and *N* (if any), + * *M* is an optional property and *S* has no apparent property of the same name as *M*. + * *M* is a non-specialized call or construct signature and *S* has an apparent call or construct signature *N* where, when *M* and *N* are instantiated using type Any as the type argument for all type parameters declared by *M* and *N* (if any), * the signatures are of the same kind (call or construct), * *M* has a rest parameter or the number of non-optional parameters in *N* is less than or equal to the total number of parameters in *M*, * for parameter positions that are present in both signatures, each parameter type in *N* is assignable to or from the corresponding parameter type in *M*, and * the result type of *M* is Void, or the result type of *N* is assignable to that of *M*. - * *M* is a string index signature of type *U* and *S'* contains a string index signature of a type that is assignable to *U*. - * *M* is a numeric index signature of type *U* and *S'* contains a string or numeric index signature of a type that is assignable to *U*. + * *M* is a string index signature of type *U* and *S* has an apparent string index signature of a type that is assignable to *U*. + * *M* is a numeric index signature of type *U* and *S* has an apparent string or numeric index signature of a type that is assignable to *U*. When comparing call or construct signatures, parameter names are ignored and rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. -Note that specialized call and construct signatures (section [3.7.2.4](#3.7.2.4)) are not significant when determining assignment compatibility. +Note that specialized call and construct signatures (section [3.8.2.4](#3.8.2.4)) are not significant when determining assignment compatibility. The assignment compatibility and subtyping rules differ only in that -* the Any type is assignable to, but not a subtype of, all types, and -* the primitive type Number is assignable to, but not a subtype of, all enum types. +* the Any type is assignable to, but not a subtype of, all types, +* the primitive type Number is assignable to, but not a subtype of, all enum types, and +* an object type without a particular property is assignable to an object type in which that property is optional. The assignment compatibility rules imply that, when assigning values or passing parameters, optional properties must either be present and of a compatible type, or not be present at all. For example: @@ -2008,14 +2076,14 @@ foo({ id: 1234, name: false }); // Error, name of wrong type foo({ name: "hello" }); // Error, id required but missing ``` -### 3.8.5 Contextual Signature Instantiation +### 3.10.5 Contextual Signature Instantiation During type argument inference in a function call (section [4.12.2](#4.12.2)) it is in certain circumstances necessary to instantiate a generic call signature of an argument expression in the context of a non-generic call signature of a parameter such that further inferences can be made. A generic call signature *A* is ***instantiated in the context of*** non-generic call signature *B* as follows: -* Using the process described in [3.8.6](#3.8.6), inferences for *A*'s type parameters are made from each parameter type in *B* to the corresponding parameter type in *A* for those parameter positions that are present in both signatures, where rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. +* Using the process described in [3.10.6](#3.10.6), inferences for *A*'s type parameters are made from each parameter type in *B* to the corresponding parameter type in *A* for those parameter positions that are present in both signatures, where rest parameters correspond to an unbounded expansion of optional parameters of the rest parameter element type. * The inferred type argument for each type parameter is the union type of the set of inferences made for that type parameter. However, if the union type does not satisfy the constraint of the type parameter, the inferred type argument is instead the constraint. -### 3.8.6 Type Inference +### 3.10.6 Type Inference In certain contexts, inferences for a given set of type parameters are made *from* a type *S*, in which those type parameters do not occur, *to* another type *T*, in which those type parameters do occur. Inferences consist of a set of candidate type arguments collected for each of the type parameters. The inference process recursively relates *S* and *T* to gather as many inferences as possible: @@ -2035,7 +2103,7 @@ In certain contexts, inferences for a given set of type parameters are made *fro When comparing call or construct signatures, signatures in *S* correspond to signatures of the same kind in *T* pairwise in declaration order. If *S* and *T* have different numbers of a given kind of signature, the excess *first* signatures in declaration order of the longer list are ignored. -### 3.8.7 Recursive Types +### 3.10.7 Recursive Types Classes and interfaces can reference themselves in their internal structure, in effect creating recursive types with infinite nesting. For example, the type @@ -2069,7 +2137,7 @@ interface List { 'List<T>' has a member 'owner' of type 'List<List<T>>', which has a member 'owner' of type 'List<List<List<T>>>', which has a member 'owner' of type 'List<List<List<List<T>>>>' and so on, ad infinitum. Since type relationships are determined structurally, possibly exploring the constituent types to their full depth, in order to determine type relationships involving infinitely expanding generic types it may be necessary for the compiler to terminate the recursion at some point with the assumption that no further exploration will change the outcome. -## 3.9 Widened Types +## 3.11 Widened Types In several situations TypeScript infers types from context, alleviating the need for the programmer to explicitly specify types that appear obvious. For example @@ -2193,7 +2261,7 @@ A get accessor declaration is processed in the same manner as an ordinary functi If a get accessor is declared for a property, the return type of the get accessor becomes the type of the property. If only a set accessor is declared for a property, the parameter type (which may be type Any if no type annotation is present) of the set accessor becomes the type of the property. -When an object literal is contextually typed by a type that includes a string index signature, the resulting type of the object literal includes a string index signature with the union type of the types of the properties declared in the object literal, or the Undefined type if the object literal is empty. Likewise, when an object literal is contextually typed by a type that includes a numeric index signature, the resulting type of the object literal includes a numeric index signature with the union type of the types of the numerically named properties (section [3.7.4](#3.7.4)) declared in the object literal, or the Undefined type if the object literal declares no numerically named properties. +When an object literal is contextually typed by a type that includes a string index signature, the resulting type of the object literal includes a string index signature with the union type of the types of the properties declared in the object literal, or the Undefined type if the object literal is empty. Likewise, when an object literal is contextually typed by a type that includes a numeric index signature, the resulting type of the object literal includes a numeric index signature with the union type of the types of the numerically named properties (section [3.8.4](#3.8.4)) declared in the object literal, or the Undefined type if the object literal declares no numerically named properties. ## 4.6 Array Literals @@ -2394,8 +2462,6 @@ Furthermore, when a function expression has no return type annotation and is con A property access uses either dot notation or bracket notation. A property access expression is always classified as a reference. -A property access uses an object's apparent type (section [3.8.1](#3.8.1)) to determine its properties. Furthermore, in a property access, an object's apparent type includes the properties that originate in the 'Object' or 'Function' global interface types, as described in section [3.3](#3.3). - A dot notation property access of the form ```TypeScript @@ -2405,7 +2471,7 @@ object . name where *object* is an expression and *name* is an identifier (including, possibly, a reserved word), is used to access the property with the given name on the given object. A dot notation property access is processed as follows at compile-time: * If *object* is of type Any, any *name* is permitted and the property access is of type Any. -* Otherwise, if *name* denotes an accessible property member in the apparent type of *object*, the property access is of the type of that property. Public members are always accessible, but private and protected members of a class have restricted accessibility, as described in [8.2.2](#8.2.2). +* Otherwise, if *name* denotes an accessible apparent property (section [3.10.1](#3.10.1)) in the type of *object*, the property access is of the type of that property. Public members are always accessible, but private and protected members of a class have restricted accessibility, as described in [8.2.2](#8.2.2). * Otherwise, the property access is invalid and a compile-time error occurs. A bracket notation property access of the form @@ -2416,9 +2482,9 @@ object [ index ] where *object* and *index* are expressions, is used to access the property with the name computed by the index expression on the given object. A bracket notation property access is processed as follows at compile-time: -* If *index* is a string literal or a numeric literal and *object*'s apparent type has a property with the name given by that literal (converted to its string representation in the case of a numeric literal), the property access is of the type of that property. -* Otherwise, if *object*'s apparent type has a numeric index signature and *index* is of type Any, the Number primitive type, or an enum type, the property access is of the type of that index signature. -* Otherwise, if *object*'s apparent type has a string index signature and *index* is of type Any, the String or Number primitive type, or an enum type, the property access is of the type of that index signature. +* If *index* is a string literal or a numeric literal and *object* has an apparent property (section [3.10.1](#3.10.1)) with the name given by that literal (converted to its string representation in the case of a numeric literal), the property access is of the type of that property. +* Otherwise, if *object* has an apparent numeric index signature and *index* is of type Any, the Number primitive type, or an enum type, the property access is of the type of that index signature. +* Otherwise, if *object* has an apparent string index signature and *index* is of type Any, the String or Number primitive type, or an enum type, the property access is of the type of that index signature. * Otherwise, if *index* is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. * Otherwise, the property access is invalid and a compile-time error occurs. @@ -2455,8 +2521,8 @@ new C < ... > ( ... ) where *C* is an expression. The first form is equivalent to supplying an empty argument list. *C* must be of type Any or of an object type with one or more construct or call signatures. The operation is processed as follows at compile-time: * If *C* is of type Any, any argument list is permitted and the result of the operation is of type Any. -* If *C*'s apparent type (section [3.8.1](#3.8.1)) is an object type with one or more construct signatures, the expression is processed in the same manner as a function call, but using the construct signatures as the initial set of candidate signatures for overload resolution. The result type of the function call becomes the result type of the operation. -* If *C*'s apparent type is an object type with no construct signatures but one or more call signatures, the expression is processed as a function call. A compile-time error occurs if the result of the function call is not Void. The type of the result of the operation is Any. +* If *C* has one or more apparent construct signatures (section [3.10.1](#3.10.1)), the expression is processed in the same manner as a function call, but using the construct signatures as the initial set of candidate signatures for overload resolution. The result type of the function call becomes the result type of the operation. +* If *C* has no apparent construct signatures but one or more apparent call signatures, the expression is processed as a function call. A compile-time error occurs if the result of the function call is not Void. The type of the result of the operation is Any. ## 4.12 Function Calls @@ -2472,11 +2538,11 @@ func ( ... ) func < ... > ( ... ) ``` -where *func* is an expression of a function type or of type Any. The function expression is followed by an optional type argument list (section [3.4.2](#3.4.2)) and an argument list. +where *func* is an expression of a function type or of type Any. The function expression is followed by an optional type argument list (section [3.5.2](#3.5.2)) and an argument list. If *func* is of type Any, or of an object type that has no call or construct signatures but is a subtype of the Function interface, the call is an ***untyped function call***. In an untyped function call no type arguments are permitted, argument expressions can be of any type and number, no contextual types are provided for the argument expressions, and the result is always of type Any. -If *func*'s apparent type (section [3.8.1](#3.8.1)) is a function type, the call is a ***typed function call***. TypeScript employs ***overload resolution*** in typed function calls in order to support functions with multiple call signatures. Furthermore, TypeScript may perform ***type argument inference*** to automatically determine type arguments in generic function calls. +If *func* has apparent call signatures (section [3.10.1](#3.10.1)) the call is a ***typed function call***. TypeScript employs ***overload resolution*** in typed function calls in order to support functions with multiple call signatures. Furthermore, TypeScript may perform ***type argument inference*** to automatically determine type arguments in generic function calls. ### 4.12.1 Overload Resolution @@ -2503,7 +2569,7 @@ A signature is said to be an ***applicable signature*** with respect to an argum * the number of arguments is not less than the number of required parameters, * the number of arguments is not greater than the number of parameters, and -* for each argument expression *e* and its corresponding parameter *P,* when *e* is contextually typed (section [4.19](#4.19)) by the type of *P*, no errors ensue and the type of *e* is assignable to (section [3.8.4](#3.8.4)) the type of *P*. +* for each argument expression *e* and its corresponding parameter *P,* when *e* is contextually typed (section [4.19](#4.19)) by the type of *P*, no errors ensue and the type of *e* is assignable to (section [3.10.4](#3.10.4)) the type of *P*. ### 4.12.2 Type Argument Inference @@ -2518,13 +2584,13 @@ Type argument inference produces a set of candidate types for each type paramete In order to compute candidate types, the argument list is processed as follows: * Initially all inferred type arguments are considered ***unfixed*** with an empty set of candidate types. -* Proceeding from left to right, each argument expression *e* is ***inferentially typed*** by its corresponding parameter type *P*, possibly causing some inferred type arguments to become ***fixed***, and candidate type inferences (section [3.8.6](#3.8.6)) are made for unfixed inferred type arguments from the type computed for *e* to *P*. +* Proceeding from left to right, each argument expression *e* is ***inferentially typed*** by its corresponding parameter type *P*, possibly causing some inferred type arguments to become ***fixed***, and candidate type inferences (section [3.10.6](#3.10.6)) are made for unfixed inferred type arguments from the type computed for *e* to *P*. The process of inferentially typing an expression *e* by a type *T* is the same as that of contextually typing *e* by *T*, with the following exceptions: * Where expressions contained within *e* would be contextually typed, they are instead inferentially typed. * When a function expression is inferentially typed (section [4.9.3](#4.9.3)) and a type assigned to a parameter in that expression references type parameters for which inferences are being made, the corresponding inferred type arguments to become ***fixed*** and no further candidate inferences are made for them. -* If *e* is an expression of a function type that contains exactly one generic call signature and no other members, and *T* is a function type with exactly one non-generic call signature and no other members, then any inferences made for type parameters referenced by the parameters of *T*'s call signature are ***fixed***, and *e*'s type is changed to a function type with *e*'s call signature instantiated in the context of *T*'s call signature (section [3.8.5](#3.8.5)). +* If *e* is an expression of a function type that contains exactly one generic call signature and no other members, and *T* is a function type with exactly one non-generic call signature and no other members, then any inferences made for type parameters referenced by the parameters of *T*'s call signature are ***fixed***, and *e*'s type is changed to a function type with *e*'s call signature instantiated in the context of *T*'s call signature (section [3.10.5](#3.10.5)). An example: @@ -2696,7 +2762,7 @@ The 'void' operator takes an operand of any type and produces the value 'undefin ### 4.14.6 The typeof Operator -The 'typeof' operator takes an operand of any type and produces a value of the String primitive type. In positions where a type is expected, 'typeof' can also be used in a type query (section [3.6.9](#3.6.9)) to produce the type of an expression. +The 'typeof' operator takes an operand of any type and produces a value of the String primitive type. In positions where a type is expected, 'typeof' can also be used in a type query (section [3.7.9](#3.7.9)) to produce the type of an expression. ```TypeScript var x = 5; @@ -2708,31 +2774,31 @@ In the example above, 'x' is of type 'number', 'y' is of type 'string' because w ## 4.15 Binary Operators -The subsections that follow specify the compile-time processing rules of the binary operators. In general, if the operands of a binary operator do not meet the stated requirements, a compile-time error occurs and the result of the operation defaults to type any in further processing. Tables that summarize the compile-time processing rules for operands of the Any type, the Boolean, Number, and String primitive types, and all object types and type parameters (the Object column in the tables) are provided. +The subsections that follow specify the compile-time processing rules of the binary operators. In general, if the operands of a binary operator do not meet the stated requirements, a compile-time error occurs and the result of the operation defaults to type any in further processing. Tables that summarize the compile-time processing rules for operands of the Any type, the Boolean, Number, and String primitive types, and all other types (the Other column in the tables) are provided. ### 4.15.1 The *, /, %, –, <<, >>, >>>, &, ^, and | operators These operators require their operands to be of type Any, the Number primitive type, or an enum type. Operands of an enum type are treated as having the primitive type Number. If one operand is the `null` or `undefined` value, it is treated as having the type of the other operand. The result is always of the Number primitive type. -||Any|Boolean|Number|String|Object| +||Any|Boolean|Number|String|Other| |:---:|:---:|:---:|:---:|:---:|:---:| |Any|Number||Number||| |Boolean|||||| |Number|Number||Number||| |String|||||| -|Object|||||| +|Other|||||| ### 4.15.2 The + operator The binary + operator requires both operands to be of the Number primitive type or an enum type, or at least one of the operands to be of type Any or the String primitive type. Operands of an enum type are treated as having the primitive type Number. If one operand is the `null` or `undefined` value, it is treated as having the type of the other operand. If both operands are of the Number primitive type, the result is of the Number primitive type. If one or both operands are of the String primitive type, the result is of the String primitive type. Otherwise, the result is of type Any. -||Any|Boolean|Number|String|Object| +||Any|Boolean|Number|String|Other| |:---:|:---:|:---:|:---:|:---:|:---:| |Any|Any|Any|Any|String|Any| |Boolean|Any|||String|| |Number|Any||Number|String|| |String|String|String|String|String|String| -|Object|Any|||String|| +|Other|Any|||String|| A value of any type can converted to the String primitive type by adding an empty string: @@ -2746,15 +2812,15 @@ The example above converts the result of 'getValue()' to a string if it isn't a ### 4.15.3 The <, >, <=, >=, ==, !=, ===, and !== operators -These operators require one operand type to be identical to or a subtype of the other operand type. The result is always of the Boolean primitive type. +These operators require one or both of the operand types to be assignable to the other. The result is always of the Boolean primitive type. -||Any|Boolean|Number|String|Object| +||Any|Boolean|Number|String|Other| |:---:|:---:|:---:|:---:|:---:|:---:| |Any|Boolean|Boolean|Boolean|Boolean|Boolean| |Boolean|Boolean|Boolean|||| |Number|Boolean||Boolean||| |String|Boolean|||Boolean|| -|Object|Boolean||||Boolean| +|Other|Boolean||||Boolean| ### 4.15.4 The instanceof operator @@ -2770,13 +2836,13 @@ The `in` operator requires the left operand to be of type Any, the String primit The && operator permits the operands to be of any type and produces a result of the same type as the second operand. -||Any|Boolean|Number|String|Object| +||Any|Boolean|Number|String|Other| |:---:|:---:|:---:|:---:|:---:|:---:| -|Any|Any|Boolean|Number|String|Object| -|Boolean|Any|Boolean|Number|String|Object| -|Number|Any|Boolean|Number|String|Object| -|String|Any|Boolean|Number|String|Object| -|Object|Any|Boolean|Number|String|Object| +|Any|Any|Boolean|Number|String|Other| +|Boolean|Any|Boolean|Number|String|Other| +|Number|Any|Boolean|Number|String|Other| +|String|Any|Boolean|Number|String|Other| +|Other|Any|Boolean|Number|String|Other| ### 4.15.7 The || operator @@ -2786,13 +2852,13 @@ If the || expression is contextually typed (section [4.19](#4.19)), the operands The type of the result is the union type of the two operand types. -||Any|Boolean|Number|String|Object| +||Any|Boolean|Number|String|Other| |:---:|:---:|:---:|:---:|:---:|:---:| |Any|Any|Any|Any|Any|Any| -|Boolean|Any|Boolean|{ }|{ }|{ }| -|Number|Any|{ }|Number|{ }|{ }| -|String|Any|{ }|{ }|String|{ }| -|Object|Any|{ }|{ }|{ }|Object| +|Boolean|Any|Boolean|N | B|S | B|B | O| +|Number|Any|N | B|Number|S | N|N | O| +|String|Any|S | B|S | N|String|S | O| +|Other|Any|B | O|N | O|S | O|Other| ## 4.16 The Conditional Operator @@ -2816,7 +2882,7 @@ An assignment of the form v = expr ``` -requires *v* to be classified as a reference (section [4.1](#4.1)). The *expr* expression is contextually typed (section [4.19](#4.19)) by the type of *v*, and the type of *expr* must be assignable to (section [3.8.4](#3.8.4)) the type of *v*, or otherwise a compile-time error occurs. The result is a value with the type of *expr*. +requires *v* to be classified as a reference (section [4.1](#4.1)). The *expr* expression is contextually typed (section [4.19](#4.19)) by the type of *v*, and the type of *expr* must be assignable to (section [3.10.4](#3.10.4)) the type of *v*, or otherwise a compile-time error occurs. The result is a value with the type of *expr*. A compound assignment of the form @@ -3038,7 +3104,7 @@ Variable statements are extended to include optional type annotations. A variable declaration introduces a variable with the given name in the containing declaration space. The type associated with a variable is determined as follows: * If the declaration includes a type annotation, the stated type becomes the type of the variable. If an initializer is present, the initializer expression is contextually typed (section [4.19](#4.19)) by the stated type and must be assignable to the stated type, or otherwise a compile-time error occurs. -* If the declaration includes an initializer but no type annotation, and if the initializer doesn't directly or indirectly reference the variable, the widened type (section [3.9](#3.9)) of the initializer expression becomes the type of the variable. If the initializer directly or indirectly references the variable, the type of the variable becomes the Any type. +* If the declaration includes an initializer but no type annotation, and if the initializer doesn't directly or indirectly reference the variable, the widened type (section [3.11](#3.11)) of the initializer expression becomes the type of the variable. If the initializer directly or indirectly references the variable, the type of the variable becomes the Any type. * If the declaration includes neither a type annotation nor an initializer, the type of the variable becomes the Any type. Multiple declarations for the same variable name in the same declaration space are permitted, provided that each declaration associates the same type with the variable. @@ -3135,7 +3201,7 @@ Use of the 'with' statement in TypeScript is an error, as is the case in ECMAScr ## 5.9 Switch Statements -In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from (section [3.8.4](#3.8.4)) the type of the 'switch' expression. +In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from (section [3.10.4](#3.10.4)) the type of the 'switch' expression. ## 5.10 Throw Statements @@ -3212,8 +3278,8 @@ A function implementation without a return type annotation is said to be an ***i * If there are no return statements with expressions in *f*'s function body, the inferred return type is Void. * Otherwise, if *f*'s function body directly references *f* or references any implicitly typed functions that through this same analysis reference *f*, the inferred return type is Any. -* Otherwise, if *f* is a contextually typed function expression (section [4.9.3](#4.9.3)), the inferred return type is the union type (section [3.3.4](#3.3.4)) of the types of the return statement expressions in the function body, ignoring return statements with no expressions. -* Otherwise, the inferred return type is the first of the types of the return statement expressions in the function body that is a supertype (section [3.8.3](#3.8.3)) of each of the others, ignoring return statements with no expressions. A compile-time error occurs if no return statement expression has a type that is a supertype of each of the others. +* Otherwise, if *f* is a contextually typed function expression (section [4.9.3](#4.9.3)), the inferred return type is the union type (section [3.4](#3.4)) of the types of the return statement expressions in the function body, ignoring return statements with no expressions. +* Otherwise, the inferred return type is the first of the types of the return statement expressions in the function body that is a supertype (section [3.10.3](#3.10.3)) of each of the others, ignoring return statements with no expressions. A compile-time error occurs if no return statement expression has a type that is a supertype of each of the others. In the example @@ -3234,7 +3300,7 @@ An explicitly typed function whose return type isn't the Void or the Any type mu The type of 'this' in a function implementation is the Any type. -In the signature of a function implementation, a parameter can be marked optional by following it with an initializer. When a parameter declaration includes both a type annotation and an initializer, the initializer expression is contextually typed (section [4.19](#4.19)) by the stated type and must be assignable to the stated type, or otherwise a compile-time error occurs. When a parameter declaration has no type annotation but includes an initializer, the type of the parameter is the widened form (section [3.9](#3.9)) of the type of the initializer expression. +In the signature of a function implementation, a parameter can be marked optional by following it with an initializer. When a parameter declaration includes both a type annotation and an initializer, the initializer expression is contextually typed (section [4.19](#4.19)) by the stated type and must be assignable to the stated type, or otherwise a compile-time error occurs. When a parameter declaration has no type annotation but includes an initializer, the type of the parameter is the widened form (section [3.11](#3.11)) of the type of the initializer expression. Initializer expressions are evaluated in the scope of the function body but are not permitted to reference local variables and are only permitted to access parameters that are declared to the left of the parameter they initialize, unless the parameter reference occurs in a nested function expression. @@ -3269,7 +3335,7 @@ the local variable 'x' is in scope in the parameter initializer (thus hiding the ## 6.4 Generic Functions -A function implementation may include type parameters in its signature (section [3.7.2.1](#3.7.2.1)) and is then called a ***generic function***. Type parameters provide a mechanism for expressing relationships between parameter and return types in call operations. Type parameters have no run-time representation—they are purely a compile-time construct. +A function implementation may include type parameters in its signature (section [3.8.2.1](#3.8.2.1)) and is then called a ***generic function***. Type parameters provide a mechanism for expressing relationships between parameter and return types in call operations. Type parameters have no run-time representation—they are purely a compile-time construct. Type parameters declared in the signature of a function implementation are in scope in the signature and body of that function implementation. @@ -3287,7 +3353,7 @@ function compare(x: T, y: T): number { } ``` -Note that the 'x' and 'y' parameters are known to be subtypes of the constraint 'Comparable' and therefore have a 'compareTo' member. This is described further in section [3.4.1](#3.4.1). +Note that the 'x' and 'y' parameters are known to be subtypes of the constraint 'Comparable' and therefore have a 'compareTo' member. This is described further in section [3.5.1](#3.5.1). The type arguments of a call to a generic function may be explicitly specified in a call operation or may, when possible, be inferred (section [4.12.2](#4.12.2)) from the types of the regular arguments in the call. In the example @@ -3335,13 +3401,13 @@ Interfaces provide the ability to name and parameterize object types and to comp Interfaces have no run-time representation—they are purely a compile-time construct. Interfaces are particularly useful for documenting and validating the required shape of properties, objects passed as parameters, and objects returned from functions. -Because TypeScript has a structural type system, an interface type with a particular set of members is considered identical to, and can be substituted for, another interface type or object type literal with an identical set of members (see section [3.8.2](#3.8.2)). +Because TypeScript has a structural type system, an interface type with a particular set of members is considered identical to, and can be substituted for, another interface type or object type literal with an identical set of members (see section [3.10.2](#3.10.2)). Class declarations may reference interfaces in their implements clause to validate that they provide an implementation of the interfaces. ## 7.1 Interface Declarations -An interface declaration declares a new named type (section [3.5](#3.5)) by introducing a type name in the containing module. +An interface declaration declares a new named type (section [3.6](#3.6)) by introducing a type name in the containing module.   *InterfaceDeclaration:*    `interface` *Identifier* *TypeParametersopt* *InterfaceExtendsClauseopt* *ObjectType* @@ -3356,9 +3422,9 @@ An interface declaration declares a new named type (section [3.5](#3.5)) by intr   *ClassOrInterfaceType:*    *TypeReference* -The *Identifier* of an interface declaration may not be one of the predefined type names (section [3.6.1](#3.6.1)). +The *Identifier* of an interface declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). -An interface may optionally have type parameters (section [3.4.1](#3.4.1)) that serve as placeholders for actual types to be provided when the interface is referenced in type references. An interface with type parameters is called a ***generic interface***. The type parameters of a generic interface declaration are in scope in the entire declaration and may be referenced in the *InterfaceExtendsClause* and *ObjectType* body. +An interface may optionally have type parameters (section [3.5.1](#3.5.1)) that serve as placeholders for actual types to be provided when the interface is referenced in type references. An interface with type parameters is called a ***generic interface***. The type parameters of a generic interface declaration are in scope in the entire declaration and may be referenced in the *InterfaceExtendsClause* and *ObjectType* body. An interface can inherit from zero or more ***base types*** which are specified in the *InterfaceExtendsClause*. The base types must be type references to class or interface types. @@ -3372,9 +3438,9 @@ The following constraints must be satisfied by an interface declaration or other * An interface declaration may not, directly or indirectly, specify a base type that originates in the same declaration. In other words an interface cannot, directly or indirectly, be a base type of itself, regardless of type arguments. * An interface cannot declare a property with the same name as an inherited private or protected property. -* Inherited properties with the same name must be identical (section [3.8.2](#3.8.2)). -* All properties of the interface must satisfy the constraints implied by the index signatures of the interface as specified in section [3.7.4](#3.7.4). -* The instance type (section [3.5.1](#3.5.1)) of the declared interface must be assignable (section [3.8.4](#3.8.4)) to each of the base type references. +* Inherited properties with the same name must be identical (section [3.10.2](#3.10.2)). +* All properties of the interface must satisfy the constraints implied by the index signatures of the interface as specified in section [3.8.4](#3.8.4). +* The instance type (section [3.6.1](#3.6.1)) of the declared interface must be assignable (section [3.10.4](#3.10.4)) to each of the base type references. An interface is permitted to inherit identical members from multiple base types and will in that case only contain one occurrence of each particular member. @@ -3477,7 +3543,7 @@ class Location { } ``` -In the above example, 'SelectableControl' contains all of the members of 'Control', including the private 'state' property. Since 'state' is a private member it is only possible for descendants of 'Control' to implement 'SelectableControl'. This is because only descendants of 'Control' will have a 'state' private member that originates in the same declaration, which is a requirement for private members to be compatible (section [3.8](#3.8)). +In the above example, 'SelectableControl' contains all of the members of 'Control', including the private 'state' property. Since 'state' is a private member it is only possible for descendants of 'Control' to implement 'SelectableControl'. This is because only descendants of 'Control' will have a 'state' private member that originates in the same declaration, which is a requirement for private members to be compatible (section [0](#0)). Within the 'Control' class it is possible to access the 'state' private member through an instance of 'SelectableControl'. Effectively, a 'SelectableControl' acts like a 'Control' that is known to have a 'select' method. The 'Button' and 'TextBox' classes are subtypes of 'SelectableControl' (because they both inherit from 'Control' and have a 'select' method), but the 'Image' and 'Location' classes are not. @@ -3518,9 +3584,9 @@ Class declarations introduce named types and provide implementations of those ty A *ClassDeclaration* declares a ***class type*** and a ***constructor function***, both with the name given by *Identifier*, in the containing module. The class type is created from the instance members declared in the class body and the instance members inherited from the base class. The constructor function is created from the constructor declaration, the static member declarations in the class body, and the static members inherited from the base class. The constructor function initializes and returns an instance of the class type. -The *Identifier* of a class declaration may not be one of the predefined type names (section [3.6.1](#3.6.1)). +The *Identifier* of a class declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). -A class may optionally have type parameters (section [3.4.1](#3.4.1)) that serve as placeholders for actual types to be provided when the class is referenced in type references. A class with type parameters is called a ***generic class***. The type parameters of a generic class declaration are in scope in the entire declaration and may be referenced in the *ClassHeritage* and *ClassBody*. +A class may optionally have type parameters (section [3.5.1](#3.5.1)) that serve as placeholders for actual types to be provided when the class is referenced in type references. A class with type parameters is called a ***generic class***. The type parameters of a generic class declaration are in scope in the entire declaration and may be referenced in the *ClassHeritage* and *ClassBody*. The following example introduces both a named type called 'Point' (the class type) and a member called 'Point' (the constructor function) in the containing module. @@ -3581,7 +3647,7 @@ The following constraints must be satisfied by the class heritage specification * If present, the type reference specified in the `extends` clause must denote a class type. Furthermore, the *TypeName* part of the type reference is required to be a reference to the class constructor function when evaluated as an expression. * A class declaration may not, directly or indirectly, specify a base class that originates in the same declaration. In other words a class cannot, directly or indirectly, be a base class of itself, regardless of type arguments. -* The instance type (section [3.5.1](#3.5.1)) of the declared class must be assignable (section [3.8.4](#3.8.4)) to the base type reference and each of the type references listed in the `implements` clause. +* The instance type (section [3.6.1](#3.6.1)) of the declared class must be assignable (section [3.10.4](#3.10.4)) to the base type reference and each of the type references listed in the `implements` clause. * The constructor function type created by the class declaration must be assignable to the base class constructor function type, ignoring construct signatures. The following example illustrates a situation in which the first rule above would be violated: @@ -3629,7 +3695,7 @@ The members of a class consist of the members introduced through member declarat Members are either ***instance members*** or ***static members***. -Instance members are members of the class type (section [8.2.4](#8.2.4)) and its associated instance type. Within constructors, instance member functions, and instance member accessors, the type of `this` is the instance type (section [3.5.1](#3.5.1)) of the class. +Instance members are members of the class type (section [8.2.4](#8.2.4)) and its associated instance type. Within constructors, instance member functions, and instance member accessors, the type of `this` is the instance type (section [3.6.1](#3.6.1)) of the class. Static members are declared using the `static` modifier and are members of the constructor function type (section [8.2.5](#8.2.5)). Within static member functions and static member accessors, the type of `this` is the constructor function type. @@ -3677,7 +3743,7 @@ In class 'A', the accesses to 'x' are permitted because 'x' is declared in 'A', A derived class ***inherits*** all members from its base class it doesn't ***override***. Inheritance means that a derived class implicitly contains all non-overridden members of the base class. Only public and protected property members can be overridden. -A property member in a derived class is said to override a property member in a base class when the derived class property member has the same name and kind (instance or static) as the base class property member. The type of an overriding property member must be assignable (section [3.8.4](#3.8.4)) to the type of the overridden property member, or otherwise a compile-time error occurs. +A property member in a derived class is said to override a property member in a base class when the derived class property member has the same name and kind (instance or static) as the base class property member. The type of an overriding property member must be assignable (section [3.10.4](#3.10.4)) to the type of the overridden property member, or otherwise a compile-time error occurs. Base class instance member functions can be overridden by derived class instance member functions, but not by other kinds of members. @@ -3685,11 +3751,11 @@ Base class instance member variables and accessors can be overridden by derived Base class static property members can be overridden by derived class static property members of any kind as long as the types are compatible, as described above. -An index member in a derived class is said to override an index member in a base class when the derived class index member is of the same index kind (string or numeric) as the base class index member. The type of an overriding index member must be assignable (section [3.8.4](#3.8.4)) to the type of the overridden index member, or otherwise a compile-time error occurs. +An index member in a derived class is said to override an index member in a base class when the derived class index member is of the same index kind (string or numeric) as the base class index member. The type of an overriding index member must be assignable (section [3.10.4](#3.10.4)) to the type of the overridden index member, or otherwise a compile-time error occurs. ### 8.2.4 Class Types -A class declaration declares a new named type (section [3.5](#3.5)) called a class type. Within the constructor and member functions of a class, the type of `this` is the instance type (section [3.5.1](#3.5.1)) of this class type. The class type has the following members: +A class declaration declares a new named type (section [3.6](#3.6)) called a class type. Within the constructor and member functions of a class, the type of `this` is the instance type (section [3.6.1](#3.6.1)) of this class type. The class type has the following members: * A property for each instance member variable declaration in the class body. * A property of a function type for each instance member function declaration in the class body. @@ -3698,7 +3764,7 @@ A class declaration declares a new named type (section [3.5](#3.5)) called a cla * An index signature for each instance index member declaration in the class body. * All base class instance type property or index members that are not overridden in the class. -All instance property members (including those that are private or protected) of a class must satisfy the constraints implied by the index members of the class as specified in section [3.7.4](#3.7.4). +All instance property members (including those that are private or protected) of a class must satisfy the constraints implied by the index members of the class as specified in section [3.8.4](#3.8.4). In the example @@ -4078,14 +4144,14 @@ Get and set accessors are emitted as calls to 'Object.defineProperty' in the gen ## 8.5 Index Member Declarations -An index member declaration introduces an index signature (section [3.7.4](#3.7.4)) in the class instance type. +An index member declaration introduces an index signature (section [3.8.4](#3.8.4)) in the class instance type.   *IndexMemberDeclaration:*    *IndexSignature* `;` Index member declarations have no body and cannot specify an accessibility modifier. -A class declaration can have at most one string index member declaration and one numeric index member declaration. All instance property members of a class must satisfy the constraints implied by the index members of the class as specified in section [3.7.4](#3.7.4). +A class declaration can have at most one string index member declaration and one numeric index member declaration. All instance property members of a class must satisfy the constraints implied by the index members of the class as specified in section [3.8.4](#3.8.4). It is not possible to declare index members for the static side of a class. @@ -4289,7 +4355,7 @@ An enum declaration declares an ***enum type*** and an ***enum object*** in the The enum type and enum object declared by an *EnumDeclaration* both have the name given by the *Identifier* of the declaration. The enum type is a distinct subtype of the Number primitive type. The enum object is a variable of an anonymous object type containing a set of properties, all of the enum type, corresponding to the values declared for the enum type in the body of the declaration. The enum object's type furthermore includes a numeric index signature with the signature '[x: number]: string'. -The *Identifier* of an enum declaration may not be one of the predefined type names (section [3.6.1](#3.6.1)). +The *Identifier* of an enum declaration may not be one of the predefined type names (section [3.7.1](#3.7.1)). The example @@ -4443,7 +4509,7 @@ An internal module declaration declares a namespace name and, in the case of an Internal modules are either ***instantiated*** or ***non-instantiated***. A non-instantiated module is an internal module containing only interface types and other non-instantiated modules. An instantiated module is an internal module that doesn't meet this definition. In intuitive terms, an instantiated module is one for which a module object instance is created, whereas a non-instantiated module is one for which no code is generated. -When a module identifier is referenced as a *ModuleName* (section [3.6.2](#3.6.2)) it denotes a container of module and type names, and when a module identifier is referenced as a *PrimaryExpression* (section [4.3](#4.3)) it denotes the singleton module instance. For example: +When a module identifier is referenced as a *ModuleName* (section [3.7.2](#3.7.2)) it denotes a container of module and type names, and when a module identifier is referenced as a *PrimaryExpression* (section [4.3](#4.3)) it denotes the singleton module instance. For example: ```TypeScript module M { @@ -4499,6 +4565,7 @@ The body of an internal module corresponds to a function that is executed once t    `export`*opt* *FunctionDeclaration*    `export`*opt* *ClassDeclaration*    `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration*    `export`*opt* *EnumDeclaration*    `export`*opt* *ModuleDeclaration*    `export`*opt* *ImportDeclaration* @@ -4560,7 +4627,7 @@ When an import statement includes an export modifier, all meanings of the local An export declaration declares an externally accessible module member. An export declaration is simply a regular declaration prefixed with the keyword `export`. -Exported class, interface, and enum types can be accessed as a *TypeName* (section [3.6.2](#3.6.2)) of the form *M.T*, where *M* is a reference to the containing module and *T* is the exported type name. Likewise, as part of a *TypeName*, exported modules can be accessed as a *ModuleName* of the form *M.N*, where *M* is a reference to the containing module and *N* is the exported module. +Exported class, interface, and enum types can be accessed as a *TypeName* (section [3.7.2](#3.7.2)) of the form *M.T*, where *M* is a reference to the containing module and *T* is the exported type name. Likewise, as part of a *TypeName*, exported modules can be accessed as a *ModuleName* of the form *M.N*, where *M* is a reference to the containing module and *N* is the exported module. Exported variable, function, class, enum, module, and import alias declarations become properties on the module instance and together establish the module's ***instance type***. This unnamed type has the following members: @@ -4571,7 +4638,7 @@ Exported variable, function, class, enum, module, and import alias declarations * A property of an object type for each exported instantiated module declaration. * A property for each exported import alias that references a variable, function, class, enum, or instantiated module. -An exported member depends on a (possibly empty) set of named types (section [3.5](#3.5)). Those named types must be at least as accessible as the exported member, or otherwise an error occurs. +An exported member depends on a (possibly empty) set of named types (section [3.6](#3.6)). Those named types must be at least as accessible as the exported member, or otherwise an error occurs. The named types upon which a member depends are the named types occurring in the transitive closure of the ***directly depends on*** relationship defined as follows: @@ -4756,13 +4823,14 @@ A TypeScript ***program*** consists of one or more source files that are either    *ExportAssignment*    *AmbientExternalModuleDeclaration*    `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration*    `export`*opt* *ImportDeclaration*    `export`*opt* *AmbientDeclaration*    `export`*opt* *ExternalImportDeclaration* When a TypeScript program is compiled, all of the program's source files are processed together. Statements and declarations in different source files can depend on each other, possibly in a circular fashion. By default, a JavaScript output file is generated for each implementation source file in a compilation, but no output is generated from declaration source files. -The source elements permitted in a TypeScript implementation source file are a superset of those supported by JavaScript. Specifically, TypeScript extends the JavaScript grammar's existing *VariableDeclaration* (section [5.1](#5.1)) and *FunctionDeclaration* (section [6.1](#6.1)) productions, and adds *InterfaceDeclaration* (section [7.1](#7.1)), *ClassDeclaration* (section [8.1](#8.1)), *EnumDeclaration* (section [9.1](#9.1)), *ModuleDeclaration* (section [10.1](#10.1)), *ImportDeclaration* (section [10.3](#10.3)), *ExternalImportDeclaration* (section [11.2.2](#11.2.2)), *ExportAssignment* (section [11.2.4](#11.2.4)), *AmbientDeclaration* (section [12.1](#12.1)), and *AmbientExternalModuleDeclaration* (section [12.2](#12.2)) productions. +The source elements permitted in a TypeScript implementation source file are a superset of those supported by JavaScript. Specifically, TypeScript extends the JavaScript grammar's existing *VariableDeclaration* (section [5.1](#5.1)) and *FunctionDeclaration* (section [6.1](#6.1)) productions, and adds *TypeAliasDeclaration* (section [3.9](#3.9)), *InterfaceDeclaration* (section [7.1](#7.1)), *ClassDeclaration* (section [8.1](#8.1)), *EnumDeclaration* (section [9.1](#9.1)), *ModuleDeclaration* (section [10.1](#10.1)), *ImportDeclaration* (section [10.3](#10.3)), *ExternalImportDeclaration* (section [11.2.2](#11.2.2)), *ExportAssignment* (section [11.2.4](#11.2.4)), *AmbientDeclaration* (section [12.1](#12.1)), and *AmbientExternalModuleDeclaration* (section [12.2](#12.2)) productions. Declaration source files are restricted to contain declarations only. Declaration source files can be used to declare the static type information associated with existing JavaScript code in an adjunct manner. They are entirely optional but enable the TypeScript compiler and tools to provide better verification and assistance when integrating existing JavaScript code and libraries in a TypeScript application. @@ -4794,6 +4862,7 @@ External modules are written as separate source files that contain at least one * top-level exported *FunctionDeclaration*, * top-level exported *ClassDeclaration*, * top-level exported *InterfaceDeclaration*, +* top-level exported *TypeAliasDeclaration*, * top-level exported *EnumDeclaration*, * top-level exported *ModuleDeclaration*, * top-level exported *ImportDeclaration*, or @@ -5018,7 +5087,7 @@ An ambient function declaration introduces a function in the containing declarat   *AmbientFunctionDeclaration:*    `function` *Identifier* *CallSignature* `;` -Ambient functions may be overloaded by specifying multiple ambient function declarations with the same name, but it is an error to declare multiple overloads that are considered identical (section [3.8.2](#3.8.2)) or differ only in their return types. +Ambient functions may be overloaded by specifying multiple ambient function declarations with the same name, but it is an error to declare multiple overloads that are considered identical (section [3.10.2](#3.10.2)) or differ only in their return types. Ambient function declarations cannot specify a function bodies and do not permit default parameter values. @@ -5308,6 +5377,9 @@ This appendix contains a summary of the grammar found in the main document. As d   *MethodSignature:*    *PropertyName* `?`*opt* *CallSignature* +  *TypeAliasDeclaration:* +   `type` *Identifier* `=` *Type* `;` + ## A.2 Expressions   *PropertyAssignment:* *( Modified )* @@ -5515,6 +5587,7 @@ This appendix contains a summary of the grammar found in the main document. As d    `export`*opt* *FunctionDeclaration*    `export`*opt* *ClassDeclaration*    `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration*    `export`*opt* *EnumDeclaration*    `export`*opt* *ModuleDeclaration*    `export`*opt* *ImportDeclaration* @@ -5557,6 +5630,7 @@ This appendix contains a summary of the grammar found in the main document. As d    *ExportAssignment*    *AmbientExternalModuleDeclaration*    `export`*opt* *InterfaceDeclaration* +   `export`*opt* *TypeAliasDeclaration*    `export`*opt* *ImportDeclaration*    `export`*opt* *AmbientDeclaration*    `export`*opt* *ExternalImportDeclaration* diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index accb46504dc..18fd8c711b8 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -5,25 +5,51 @@ module ts { - export function isInstantiated(node: Node): boolean { + export const enum ModuleInstanceState { + NonInstantiated = 0, + Instantiated = 1, + ConstEnumOnly = 2 + } + + export function getModuleInstanceState(node: Node): ModuleInstanceState { // A module is uninstantiated if it contains only // 1. interface declarations if (node.kind === SyntaxKind.InterfaceDeclaration) { - return false; + return ModuleInstanceState.NonInstantiated; } - // 2. non - exported import declarations + // 2. const enum declarations don't make module instantiated + else if (node.kind === SyntaxKind.EnumDeclaration && isConstEnumDeclaration(node)) { + return ModuleInstanceState.ConstEnumOnly; + } + // 3. non - exported import declarations else if (node.kind === SyntaxKind.ImportDeclaration && !(node.flags & NodeFlags.Export)) { - return false; + return ModuleInstanceState.NonInstantiated; } - // 3. other uninstantiated module declarations. - else if (node.kind === SyntaxKind.ModuleBlock && !forEachChild(node, isInstantiated)) { - return false; + // 4. other uninstantiated module declarations. + else if (node.kind === SyntaxKind.ModuleBlock) { + var state = ModuleInstanceState.NonInstantiated; + forEachChild(node, n => { + switch (getModuleInstanceState(n)) { + case ModuleInstanceState.NonInstantiated: + // child is non-instantiated - continue searching + return false; + case ModuleInstanceState.ConstEnumOnly: + // child is const enum only - record state and continue searching + state = ModuleInstanceState.ConstEnumOnly; + return false; + case ModuleInstanceState.Instantiated: + // child is instantiated - record state and stop + state = ModuleInstanceState.Instantiated; + return true; + } + }); + return state; } - else if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated((node).body)) { - return false; + else if (node.kind === SyntaxKind.ModuleDeclaration) { + return getModuleInstanceState((node).body); } else { - return true; + return ModuleInstanceState.Instantiated; } } @@ -58,23 +84,30 @@ module ts { if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node; } + // TODO(jfreeman): Implement getDeclarationName for property name function getDeclarationName(node: Declaration): string { if (node.name) { if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) { - return '"' + node.name.text + '"'; + return '"' + (node.name).text + '"'; } - return node.name.text; + return (node.name).text; } switch (node.kind) { - case SyntaxKind.Constructor: return "__constructor"; - case SyntaxKind.CallSignature: return "__call"; - case SyntaxKind.ConstructSignature: return "__new"; - case SyntaxKind.IndexSignature: return "__index"; + case SyntaxKind.ConstructorType: + case SyntaxKind.Constructor: + return "__constructor"; + case SyntaxKind.FunctionType: + case SyntaxKind.CallSignature: + return "__call"; + case SyntaxKind.ConstructSignature: + return "__new"; + case SyntaxKind.IndexSignature: + return "__index"; } } function getDisplayName(node: Declaration): string { - return node.name ? identifierToString(node.name) : getDeclarationName(node); + return node.name ? declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol { @@ -87,8 +120,11 @@ module ts { } // Report errors every position with duplicate declaration // Report errors on previous encountered declarations - var message = symbol.flags & SymbolFlags.BlockScopedVariable ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; - forEach(symbol.declarations, (declaration) => { + var message = symbol.flags & SymbolFlags.BlockScopedVariable + ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : Diagnostics.Duplicate_identifier_0; + + forEach(symbol.declarations, declaration => { file.semanticErrors.push(createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); file.semanticErrors.push(createDiagnosticForNode(node.name, message, getDisplayName(node))); @@ -206,6 +242,8 @@ module ts { declareModuleMember(node, symbolKind, symbolExcludes); break; } + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -248,14 +286,44 @@ module ts { if (node.name.kind === SyntaxKind.StringLiteral) { bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); } - else if (isInstantiated(node)) { - bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); - } else { - bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes, /*isBlockScopeContainer*/ true); + var state = getModuleInstanceState(node); + if (state === ModuleInstanceState.NonInstantiated) { + bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes, /*isBlockScopeContainer*/ true); + } + else { + bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); + if (state === ModuleInstanceState.ConstEnumOnly) { + // mark value module as module that contains only enums + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + // const only value module was merged with instantiated module - reset flag + node.symbol.constEnumOnlyModule = false; + } + } } } + function bindFunctionOrConstructorType(node: SignatureDeclaration) { + // For a given function symbol "<...>(...) => T" we want to generate a symbol identical + // to the one we would get for: { <...>(...): T } + // + // We do that by making an anonymous type literal symbol, and then setting the function + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // from an actual type literal symbol you would have gotten had you used the long form. + + var symbolKind = node.kind === SyntaxKind.FunctionType ? SymbolFlags.CallSignature : SymbolFlags.ConstructSignature; + var symbol = createSymbol(symbolKind, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, /*isBlockScopeContainer:*/ false); + + var typeLiteralSymbol = createSymbol(SymbolFlags.TypeLiteral, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, SymbolFlags.TypeLiteral); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === SyntaxKind.FunctionType ? "__call" : "__new"] = symbol + } + function bindAnonymousDeclaration(node: Node, symbolKind: SymbolFlags, name: string, isBlockScopeContainer: boolean) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); @@ -320,12 +388,12 @@ module ts { case SyntaxKind.CallSignature: bindDeclaration(node, SymbolFlags.CallSignature, 0, /*isBlockScopeContainer*/ false); break; - case SyntaxKind.Method: - bindDeclaration(node, SymbolFlags.Method, SymbolFlags.MethodExcludes, /*isBlockScopeContainer*/ true); - break; case SyntaxKind.ConstructSignature: bindDeclaration(node, SymbolFlags.ConstructSignature, 0, /*isBlockScopeContainer*/ true); break; + case SyntaxKind.Method: + bindDeclaration(node, SymbolFlags.Method, SymbolFlags.MethodExcludes, /*isBlockScopeContainer*/ true); + break; case SyntaxKind.IndexSignature: bindDeclaration(node, SymbolFlags.IndexSignature, 0, /*isBlockScopeContainer*/ false); break; @@ -341,6 +409,12 @@ module ts { case SyntaxKind.SetAccessor: bindDeclaration(node, SymbolFlags.SetAccessor, SymbolFlags.SetAccessorExcludes, /*isBlockScopeContainer*/ true); break; + + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + bindFunctionOrConstructorType(node); + break; + case SyntaxKind.TypeLiteral: bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type", /*isBlockScopeContainer*/ false); break; @@ -360,8 +434,16 @@ module ts { case SyntaxKind.InterfaceDeclaration: bindDeclaration(node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes, /*isBlockScopeContainer*/ false); break; + case SyntaxKind.TypeAliasDeclaration: + bindDeclaration(node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes, /*isBlockScopeContainer*/ false); + break; case SyntaxKind.EnumDeclaration: - bindDeclaration(node, SymbolFlags.Enum, SymbolFlags.EnumExcludes, /*isBlockScopeContainer*/ false); + if (isConstEnumDeclaration(node)) { + bindDeclaration(node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes, /*isBlockScopeContainer*/ false); + } + else { + bindDeclaration(node, SymbolFlags.RegularEnum, SymbolFlags.RegularEnumExcludes, /*isBlockScopeContainer*/ false); + } break; case SyntaxKind.ModuleDeclaration: bindModuleDeclaration(node); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 91b27812d04..0e42f2eb4ee 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6,7 +6,6 @@ /// module ts { - var nextSymbolId = 1; var nextNodeId = 1; var nextMergeId = 1; @@ -85,7 +84,8 @@ module ts { checkProgram: checkProgram, emitFiles: invokeEmitter, getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, + getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, getSignaturesOfType: getSignaturesOfType, @@ -130,6 +130,7 @@ module ts { var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); @@ -145,6 +146,7 @@ module ts { var globalNumberType: ObjectType; var globalBooleanType: ObjectType; var globalRegExpType: ObjectType; + var globalTemplateStringsArrayType: ObjectType; var tupleTypes: Map = {}; var unionTypes: Map = {}; @@ -184,12 +186,14 @@ module ts { if (flags & SymbolFlags.Function) result |= SymbolFlags.FunctionExcludes; if (flags & SymbolFlags.Class) result |= SymbolFlags.ClassExcludes; if (flags & SymbolFlags.Interface) result |= SymbolFlags.InterfaceExcludes; - if (flags & SymbolFlags.Enum) result |= SymbolFlags.EnumExcludes; + if (flags & SymbolFlags.RegularEnum) result |= SymbolFlags.RegularEnumExcludes; + if (flags & SymbolFlags.ConstEnum) result |= SymbolFlags.ConstEnumExcludes; if (flags & SymbolFlags.ValueModule) result |= SymbolFlags.ValueModuleExcludes; if (flags & SymbolFlags.Method) result |= SymbolFlags.MethodExcludes; if (flags & SymbolFlags.GetAccessor) result |= SymbolFlags.GetAccessorExcludes; if (flags & SymbolFlags.SetAccessor) result |= SymbolFlags.SetAccessorExcludes; if (flags & SymbolFlags.TypeParameter) result |= SymbolFlags.TypeParameterExcludes; + if (flags & SymbolFlags.TypeAlias) result |= SymbolFlags.TypeAliasExcludes; if (flags & SymbolFlags.Import) result |= SymbolFlags.ImportExcludes; return result; } @@ -204,6 +208,7 @@ module ts { result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) result.exports = cloneSymbolTable(symbol.exports); recordMergedSymbol(result, symbol); @@ -212,6 +217,10 @@ module ts { function extendSymbol(target: Symbol, source: Symbol) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & SymbolFlags.ValueModule && target.flags & SymbolFlags.ValueModule && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + // reset flag when merging instantiated module into value module that has only const enums + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; forEach(source.declarations, node => { @@ -306,52 +315,37 @@ module ts { // return undefined if we can't find a symbol. } - function resolveName(location: Node, name: string, meaning: SymbolFlags, nameNotFoundMessage: DiagnosticMessage, nameArg: string): Symbol { - var errorLocation = location; - var result: Symbol; - var lastLocation: Node; - - var memberWithInitializerThatReferencesIdentifierFromConstructor: Node; - - function returnResolvedSymbol(s: Symbol) { - // we've seen member with initializer that references identifier defined in constructor during the search. - // if this was the only result with given name then just report default 'nameNotFound' message. - // however if we met something else that was 'shadowed' by the identifier in constructor - report more specific error - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = (memberWithInitializerThatReferencesIdentifierFromConstructor).name; - error(errorLocation, Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - - if (s && s.flags & SymbolFlags.BlockScopedVariable) { - // Block-scoped variables can not be used before their definition - var declaration = forEach(s.declarations, d => d.flags & NodeFlags.BlockScoped ? d : undefined); - Debug.assert(declaration, "Block-scoped variable declaration is undefined"); - var declarationSourceFile = getSourceFileOfNode(declaration); - var referenceSourceFile = getSourceFileOfNode(errorLocation); - if (declarationSourceFile === referenceSourceFile) { - if (declaration.pos > errorLocation.pos) { - error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, identifierToString(declaration.name)); - } - } - else if (compilerOptions.out) { - var sourceFiles = program.getSourceFiles(); - if (sourceFiles.indexOf(referenceSourceFile) < sourceFiles.indexOf(declarationSourceFile)) { - error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, identifierToString(declaration.name)); - } - } - } - return s; + /** Returns true if node1 is defined before node 2**/ + function isDefinedBefore(node1: Node, node2: Node): boolean { + var file1 = getSourceFileOfNode(node1); + var file2 = getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; } - while (location) { + if (!compilerOptions.out) { + return true; + } + + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } + + // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and + // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with + // the given name can be found. + function resolveName(location: Node, name: string, meaning: SymbolFlags, nameNotFoundMessage: DiagnosticMessage, nameArg: string | Identifier): Symbol { + + var result: Symbol; + var lastLocation: Node; + var propertyWithInvalidInitializer: Node; + var errorLocation = location; + + loop: while (location) { // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); + break loop; } } switch (location.kind) { @@ -359,27 +353,27 @@ module ts { if (!isExternalModule(location)) break; case SyntaxKind.ModuleDeclaration: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); + break loop; } break; case SyntaxKind.EnumDeclaration: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & SymbolFlags.EnumMember)) { - return returnResolvedSymbol(result); + break loop; } break; case SyntaxKind.Property: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or - // local variables of the constructor.This effectively means that entities from outer scopes + // local variables of the constructor. This effectively means that entities from outer scopes // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. if (location.parent.kind === SyntaxKind.ClassDeclaration && !(location.flags & NodeFlags.Static)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & SymbolFlags.Value)) { - // save the property node - later it will be used by 'returnResolvedSymbol' to report appropriate error - memberWithInitializerThatReferencesIdentifierFromConstructor = location; + // Remember the property node, it will be used later to report appropriate error + propertyWithInvalidInitializer = location; } } } @@ -389,14 +383,12 @@ module ts { if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & SymbolFlags.Type)) { if (lastLocation && lastLocation.flags & NodeFlags.Static) { // TypeScript 1.0 spec (April 2014): 3.4.1 - // The scope of a type parameter extends over the entire declaration - // with which the type parameter list is associated, with the exception of static member declarations in classes. + // The scope of a type parameter extends over the entire declaration with which the type + // parameter list is associated, with the exception of static member declarations in classes. error(errorLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } - else { - return returnResolvedSymbol(result); - } + break loop; } break; case SyntaxKind.Method: @@ -406,33 +398,64 @@ module ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ArrowFunction: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } break; case SyntaxKind.FunctionExpression: if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); + result = argumentsSymbol; + break loop; } var id = (location).name; if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; case SyntaxKind.CatchBlock: var id = (location).variable; if (name === id.text) { - return returnResolvedSymbol(location.symbol); + result = location.symbol; + break loop; } break; } lastLocation = location; location = location.parent; } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); + + if (!result) { + result = getSymbol(globals, name, meaning); } - return returnResolvedSymbol(undefined); + if (!result) { + if (nameNotFoundMessage) { + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + } + return undefined; + } + + // Perform extra checks only if error reporting was requested + if (nameNotFoundMessage) { + if (propertyWithInvalidInitializer) { + // We have a match, but the reference occurred within a property initializer and the identifier also binds + // to a local variable in the constructor where the code will be emitted. + var propertyName = (propertyWithInvalidInitializer).name; + error(errorLocation, Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, + declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); + return undefined; + } + if (result.flags & SymbolFlags.BlockScopedVariable) { + // Block-scoped variables cannot be used before their definition + var declaration = forEach(result.declarations, d => d.flags & NodeFlags.BlockScoped ? d : undefined); + Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationNameToString(declaration.name)); + } + } + } + return result; } function resolveImport(symbol: Symbol): Symbol { @@ -460,8 +483,8 @@ module ts { // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImport(entityName: EntityName, importDeclaration?: ImportDeclaration): Symbol { if (!importDeclaration) { - importDeclaration = getAncestor(entityName, SyntaxKind.ImportDeclaration); - Debug.assert(importDeclaration); + importDeclaration = getAncestor(entityName, SyntaxKind.ImportDeclaration); + Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, // the search term is enclosed in |...|: @@ -470,7 +493,7 @@ module ts { // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace if (entityName.kind === SyntaxKind.Identifier && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; + entityName = entityName.parent; } // Check for case 1 and 3 in the above example if (entityName.kind === SyntaxKind.Identifier || entityName.parent.kind === SyntaxKind.QualifiedName) { @@ -491,8 +514,7 @@ module ts { // Resolves a qualified name and any involved import aliases function resolveEntityName(location: Node, name: EntityName, meaning: SymbolFlags): Symbol { if (name.kind === SyntaxKind.Identifier) { - // TODO: Investigate error recovery for symbols not found - var symbol = resolveName(location, (name).text, meaning, Diagnostics.Cannot_find_name_0, identifierToString(name)); + var symbol = resolveName(location, (name).text, meaning, Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } @@ -503,7 +525,7 @@ module ts { var symbol = getSymbol(namespace.exports, (name).right.text, meaning); if (!symbol) { error(location, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), - identifierToString((name).right)); + declarationNameToString((name).right)); return; } } @@ -589,7 +611,7 @@ module ts { } if (node.exportName.text) { var meaning = SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, Diagnostics.Cannot_find_name_0, identifierToString(node.exportName)); + var exportSymbol = resolveName(node, node.exportName.text, meaning, Diagnostics.Cannot_find_name_0, node.exportName); } } symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; @@ -941,11 +963,11 @@ module ts { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + aliasesToMakeVisible.push(declaration); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [declaration]; } return true; } @@ -960,13 +982,12 @@ module ts { function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult { var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, (firstIdentifier).text, SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, firstIdentifierName); + var symbolOfNameSpace = resolveName(entityName.parent, (firstIdentifier).text, SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, firstIdentifier); // Verify if the symbol is accessible var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); return hasNamespaceDeclarationsVisibile ? { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : - { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: firstIdentifierName }; + { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: declarationNameToString(firstIdentifier) }; } function releaseStringWriter(writer: StringSymbolWriter) { @@ -1015,6 +1036,19 @@ module ts { return result; } + function getTypeAliasForTypeLiteral(type: Type): Symbol { + if (type.symbol && type.symbol.flags & SymbolFlags.TypeLiteral) { + var node = type.symbol.declarations[0].parent; + while (node.kind === SyntaxKind.ParenType) { + node = node.parent; + } + if (node.kind === SyntaxKind.TypeAliasDeclaration) { + return getSymbolOfNode(node); + } + } + return undefined; + } + // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. var _displayBuilder: SymbolDisplayBuilder; function getSymbolDisplayBuilder(): SymbolDisplayBuilder { @@ -1026,7 +1060,7 @@ module ts { if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; if (declaration.name) { - writer.writeSymbol(identifierToString(declaration.name), symbol); + writer.writeSymbol(declarationNameToString(declaration.name), symbol); return; } } @@ -1205,8 +1239,15 @@ module ts { writeTypeofSymbol(type); } else if (typeStack && contains(typeStack, type)) { - // Recursive usage, use any - writeKeyword(writer, SyntaxKind.AnyKeyword); + // If type is an anonymous type literal in a type alias declaration, use type alias name + var typeAlias = getTypeAliasForTypeLiteral(type); + if (typeAlias) { + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, SymbolFlags.Type); + } + else { + // Recursive usage, use any + writeKeyword(writer, SyntaxKind.AnyKeyword); + } } else { if (!typeStack) { @@ -1530,6 +1571,7 @@ module ts { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.FunctionDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ImportDeclaration: @@ -1564,7 +1606,7 @@ module ts { return true; default: - Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + SyntaxKind[node.kind]); + Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } @@ -1586,7 +1628,7 @@ module ts { return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, _ => anyType)) : classType; } - function getTypeOfVariableDeclaration(declaration: VariableDeclaration): Type { + function getTypeOfVariableOrPropertyDeclaration(declaration: VariableDeclaration | PropertyDeclaration): Type { // A variable declared in a for..in statement is always of type any if (declaration.parent.kind === SyntaxKind.ForInStatement) { return anyType; @@ -1596,7 +1638,7 @@ module ts { return getTypeFromTypeNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { - var func = declaration.parent; + var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present if (func.kind === SyntaxKind.SetAccessor) { var getter = getDeclarationOfKind(declaration.parent.symbol, SyntaxKind.GetAccessor); @@ -1605,7 +1647,7 @@ module ts { } } // Use contextual parameter type if one is available - var type = getContextuallyTypedParameterType(declaration); + var type = getContextuallyTypedParameterType(declaration); if (type) { return type; } @@ -1653,7 +1695,7 @@ module ts { default: var diagnostic = Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, identifierToString(declaration.name), typeToString(type)); + error(declaration, diagnostic, declarationNameToString(declaration.name), typeToString(type)); } } @@ -1671,7 +1713,7 @@ module ts { } // Handle variable, parameter or property links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } @@ -1933,6 +1975,24 @@ module ts { return links.declaredType; } + function getDeclaredTypeOfTypeAlias(symbol: Symbol): Type { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + links.declaredType = resolvingType; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); + var type = getTypeFromTypeNode(declaration.type); + if (links.declaredType === resolvingType) { + links.declaredType = type; + } + } + else if (links.declaredType === resolvingType) { + links.declaredType = unknownType; + var declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); + error(declaration.name, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + } + return links.declaredType; + } + function getDeclaredTypeOfEnum(symbol: Symbol): Type { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -1972,6 +2032,9 @@ module ts { if (symbol.flags & SymbolFlags.Interface) { return getDeclaredTypeOfInterface(symbol); } + if (symbol.flags & SymbolFlags.TypeAlias) { + return getDeclaredTypeOfTypeAlias(symbol); + } if (symbol.flags & SymbolFlags.Enum) { return getDeclaredTypeOfEnum(symbol); } @@ -2112,7 +2175,7 @@ module ts { return false; } for (var i = 0; i < s.length; i++) { - if (!compareSignatures(s[i], t[i], /*compareReturnTypes*/ false, isTypeIdenticalTo)) { + if (!compareSignatures(s[i], t[i], /*compareReturnTypes*/ false, compareTypes)) { return false; } } @@ -2443,7 +2506,7 @@ module ts { returnType = getAnnotatedAccessorType(setter); } - if (!returnType && !(declaration).body) { + if (!returnType && !(declaration).body) { returnType = anyType; } } @@ -2460,6 +2523,8 @@ module ts { for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.FunctionDeclaration: case SyntaxKind.Method: case SyntaxKind.Constructor: @@ -2473,7 +2538,7 @@ module ts { // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). - if (i > 0 && (node).body) { + if (i > 0 && (node).body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { break; @@ -2495,7 +2560,7 @@ module ts { var type = getUnionType(map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + var type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -2506,7 +2571,7 @@ module ts { if (compilerOptions.noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { - error(declaration.name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, identifierToString(declaration.name)); + error(declaration.name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(declaration.name)); } else { error(declaration, Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); @@ -2897,8 +2962,8 @@ module ts { } return links.resolvedType; } - - function getTypeFromTypeLiteralNode(node: TypeLiteralNode): Type { + + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node: Node): Type { var links = getNodeLinks(node); if (!links.resolvedType) { // Deferred resolution of members is handled by resolveObjectTypeMembers @@ -2948,8 +3013,10 @@ module ts { return getTypeFromUnionTypeNode(node); case SyntaxKind.ParenType: return getTypeFromTypeNode((node).type); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: - return getTypeFromTypeLiteralNode(node); + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case SyntaxKind.Identifier: @@ -3158,102 +3225,48 @@ module ts { // TYPE CHECKING - var subtypeRelation: Map = {}; - var assignableRelation: Map = {}; - var identityRelation: Map = {}; + var subtypeRelation: Map = {}; + var assignableRelation: Map = {}; + var identityRelation: Map = {}; function isTypeIdenticalTo(source: Type, target: Type): boolean { - return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined); + } + + function compareTypes(source: Type, target: Type): Ternary { + return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? Ternary.True : Ternary.False; } function isTypeSubtypeOf(source: Type, target: Type): boolean { - return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); - } - - function checkTypeSubtypeOf(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); + return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined); } function isTypeAssignableTo(source: Type, target: Type): boolean { - return checkTypeAssignableTo(source, target, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return checkTypeAssignableTo(source, target, /*errorNode*/ undefined); } - function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); + function checkTypeSubtypeOf(source: Type, target: Type, errorNode: Node, headMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); } - function isTypeRelatedTo(source: Type, target: Type, relation: Map): boolean { - return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + function checkTypeAssignableTo(source: Type, target: Type, errorNode: Node, headMessage?: DiagnosticMessage): boolean { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } function isSignatureAssignableTo(source: Signature, target: Signature): boolean { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + return checkTypeRelatedTo(sourceType, targetType, assignableRelation, /*errorNode*/ undefined); } - function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, /*reportErrors*/ false, (s, t, _reportErrors) => isTypeIdenticalTo(s, t)); - } + function checkTypeRelatedTo( + source: Type, + target: Type, + relation: Map, + errorNode: Node, + headMessage?: DiagnosticMessage, + containingMessageChain?: DiagnosticMessageChain): boolean { - function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - - var seen: Map<{ prop: Symbol; containingType: Type }> = {}; - forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); - var ok = true; - - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - - var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - - return ok; - } - - function isPropertyIdenticalToRecursive(sourceProp: Symbol, targetProp: Symbol, reportErrors: boolean, relate: (source: Type, target: Type, reportErrors: boolean) => boolean): boolean { - // Two members are considered identical when - // - they are public properties with identical names, optionality, and types, - // - they are private or protected properties originating in the same declaration and having identical types - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (NodeFlags.Private | NodeFlags.Protected); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (NodeFlags.Private | NodeFlags.Protected); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - - function checkTypeRelatedTo(source: Type, target: Type, relation: Map, errorNode: Node, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { var errorInfo: DiagnosticMessageChain; var sourceStack: ObjectType[]; var targetStack: ObjectType[]; @@ -3263,61 +3276,65 @@ module ts { Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + if (containingMessageChain) { + errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + } addDiagnostic(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; + return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void { errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source: Type, target: Type, reportErrors?: boolean): boolean { - return isRelatedToWithCustomErrors(source, target, reportErrors, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); - } - - function isRelatedToWithCustomErrors(source: Type, target: Type, reportErrors: boolean, chainedMessage: DiagnosticMessage, terminalMessage: DiagnosticMessage): boolean { + // Compare two types and return + // Ternary.True if they are related with no assumptions, + // Ternary.Maybe if they are related with assumptions of other relationships, or + // Ternary.False if they are not related. + function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary { + var result: Ternary; if (relation === identityRelation) { // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases - if (source === target) return true; + if (source === target) return Ternary.True; } else { - if (source === target) return true; - if (target.flags & TypeFlags.Any) return true; - if (source === undefinedType) return true; - if (source === nullType && target !== undefinedType) return true; - if (source.flags & TypeFlags.Enum && target === numberType) return true; - if (source.flags & TypeFlags.StringLiteral && target === stringType) return true; + if (source === target) return Ternary.True; + if (target.flags & TypeFlags.Any) return Ternary.True; + if (source === undefinedType) return Ternary.True; + if (source === nullType && target !== undefinedType) return Ternary.True; + if (source.flags & TypeFlags.Enum && target === numberType) return Ternary.True; + if (source.flags & TypeFlags.StringLiteral && target === stringType) return Ternary.True; if (relation === assignableRelation) { - if (source.flags & TypeFlags.Any) return true; - if (source === numberType && target.flags & TypeFlags.Enum) return true; + if (source.flags & TypeFlags.Any) return Ternary.True; + if (source === numberType && target.flags & TypeFlags.Enum) return Ternary.True; } } if (source.flags & TypeFlags.Union) { - if (unionTypeRelatedToType(source, target, reportErrors)) { - return true; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else if (target.flags & TypeFlags.Union) { - if (typeRelatedToUnionType(source, target, reportErrors)) { - return true; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } else if (source.flags & TypeFlags.TypeParameter && target.flags & TypeFlags.TypeParameter) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { // We have type references to same target type, see if relationship holds for all type arguments - if (typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { + return result; } } // Even if relationship doesn't hold for type arguments, it may hold in a structural comparison @@ -3326,77 +3343,76 @@ module ts { // identity relation does not use apparent type var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType && - objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { - // The error should end in a period when this is the deepest error in the chain - // (when errorInfo is undefined). Otherwise, it has a colon before the nested - // error. - - chainedMessage = chainedMessage || Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); + headMessage = headMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; + reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return Ternary.False; } - function typeRelatedToUnionType(source: Type, target: UnionType, reportErrors: boolean): boolean { + function typeRelatedToUnionType(source: Type, target: UnionType, reportErrors: boolean): Ternary { var targetTypes = target.types; for (var i = 0, len = targetTypes.length; i < len; i++) { - if (isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1)) { - return true; + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; } } - return false; + return Ternary.False; } - function unionTypeRelatedToType(source: UnionType, target: Type, reportErrors: boolean): boolean { + function unionTypeRelatedToType(source: UnionType, target: Type, reportErrors: boolean): Ternary { + var result = Ternary.True; var sourceTypes = source.types; for (var i = 0, len = sourceTypes.length; i < len; i++) { - if (!isRelatedTo(sourceTypes[i], target, reportErrors)) { - return false; + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return Ternary.False; } + result &= related; } - return true; + return result; } - function typesRelatedTo(sources: Type[], targets: Type[], reportErrors: boolean): boolean { + function typesRelatedTo(sources: Type[], targets: Type[], reportErrors: boolean): Ternary { + var result = Ternary.True; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return Ternary.False; + } + result &= related; } - return true; + return result; } - function typeParameterRelatedTo(source: TypeParameter, target: TypeParameter, reportErrors: boolean): boolean { + function typeParameterRelatedTo(source: TypeParameter, target: TypeParameter, reportErrors: boolean): Ternary { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return Ternary.False; } - // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { - return true; + return Ternary.True; } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return Ternary.False; } - return isRelatedTo(source.constraint, target.constraint, reportErrors); } else { while (true) { var constraint = getConstraintOfTypeParameter(source); - if (constraint === target) return true; + if (constraint === target) return Ternary.True; if (!(constraint && constraint.flags & TypeFlags.TypeParameter)) break; source = constraint; } - return false; + return Ternary.False; } } @@ -3405,18 +3421,25 @@ module ts { // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { - if (overflow) return false; - var result: boolean; + function objectTypeRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { + if (overflow) { + return Ternary.False; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) return result; + var related = relation[id]; + if (related !== undefined) { + return related; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) return true; + // If source and target are already being compared, consider them related with assumptions + if (source === sourceStack[i] && target === targetStack[i]) { + return Ternary.Maybe; + } } if (depth === 100) { overflow = true; - return false; + return Ternary.False; } } else { @@ -3430,15 +3453,28 @@ module ts { var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || - propertiesRelatedTo(source, target, reportErrors) && - signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors) && - signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors) && - stringIndexTypesRelatedTo(source, target, reportErrors) && - numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = Ternary.True; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { + // Only cache results that are free of assumptions + if (result !== Ternary.Maybe) { relation[id] = result; } return result; @@ -3464,10 +3500,11 @@ module ts { return false; } - function propertiesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function propertiesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return propertiesIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } + var result = Ternary.True; var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; @@ -3478,7 +3515,7 @@ module ts { if (reportErrors) { reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return false; + return Ternary.False; } } else if (!(targetProp.flags & SymbolFlags.Prototype)) { @@ -3496,7 +3533,7 @@ module ts { typeToString(sourceFlags & NodeFlags.Private ? target : source)); } } - return false; + return Ternary.False; } } else if (targetFlags & NodeFlags.Protected) { @@ -3508,7 +3545,7 @@ module ts { reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return false; + return Ternary.False; } } else if (sourceFlags & NodeFlags.Protected) { @@ -3516,14 +3553,16 @@ module ts { reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return Ternary.False; } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { if (reportErrors) { - reportError(Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); + reportError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return false; + return Ternary.False; } + result &= related; if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { // TypeScript 1.0 spec (April 2014): 3.8.3 // S is a subtype of a type T, and T is a supertype of S if ... @@ -3536,37 +3575,46 @@ module ts { reportError(Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return Ternary.False; } } } } - return true; + return result; } - function propertiesIdenticalTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function propertiesIdenticalTo(source: ObjectType, target: ObjectType): Ternary { var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return false; + return Ternary.False; } + var result = Ternary.True; for (var i = 0, len = sourceProperties.length; i < len; ++i) { var sourceProp = sourceProperties[i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; + if (!targetProp) { + return Ternary.False; } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return Ternary.False; + } + result &= related; } - return true; + return result; } - function signaturesRelatedTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { + function signaturesRelatedTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return signaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); + } + if (target === anyFunctionType || source === anyFunctionType) { + return Ternary.True; } - if (target === anyFunctionType || source === anyFunctionType) return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = Ternary.True; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; @@ -3575,7 +3623,9 @@ module ts { for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; if (!s.hasStringLiterals || source.flags & TypeFlags.FromSignature) { - if (signatureRelatedTo(s, t, localErrors)) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -3583,18 +3633,18 @@ module ts { localErrors = false; } } - return false; + return Ternary.False; } } - return true; + return result; } - function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): boolean { + function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { if (source === target) { - return true; + return Ternary.True; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return Ternary.False; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -3619,45 +3669,52 @@ module ts { // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); + var result = Ternary.True; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { - reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, + reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return Ternary.False; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); - if (t === voidType) return true; + if (t === voidType) return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } - function signaturesIdenticalTo(source: ObjectType, target: ObjectType, kind: SignatureKind, reportErrors: boolean): boolean { + function signaturesIdenticalTo(source: ObjectType, target: ObjectType, kind: SignatureKind): Ternary { var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return false; + return Ternary.False; } + var result = Ternary.True; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!compareSignatures(sourceSignatures[i], targetSignatures[i], /*compareReturnTypes*/ true, isRelatedTo)) { - return false; + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], /*compareReturnTypes*/ true, isRelatedTo); + if (!related) { + return Ternary.False; } + result &= related; } - return true; + return result; } - function stringIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function stringIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return indexTypesIdenticalTo(IndexKind.String, source, target, reportErrors); + return indexTypesIdenticalTo(IndexKind.String, source, target); } var targetType = getIndexTypeOfType(target, IndexKind.String); if (targetType) { @@ -3666,21 +3723,23 @@ module ts { if (reportErrors) { reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return Ternary.False; } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { if (reportErrors) { - reportError(Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(Diagnostics.Index_signatures_are_incompatible); } - return false; + return Ternary.False; } + return related; } - return true; + return Ternary.True; } - function numberIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function numberIndexTypesRelatedTo(source: ObjectType, target: ObjectType, reportErrors: boolean): Ternary { if (relation === identityRelation) { - return indexTypesIdenticalTo(IndexKind.Number, source, target, reportErrors); + return indexTypesIdenticalTo(IndexKind.Number, source, target); } var targetType = getIndexTypeOfType(target, IndexKind.Number); if (targetType) { @@ -3690,53 +3749,92 @@ module ts { if (reportErrors) { reportError(Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return Ternary.False; } if (sourceStringType && sourceNumberType) { // If we know for sure we're testing both string and numeric index types then only report errors from the second one - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } - if (!compatible) { + if (!related) { if (reportErrors) { - reportError(Diagnostics.Index_signatures_are_incompatible_Colon); + reportError(Diagnostics.Index_signatures_are_incompatible); } - return false; + return Ternary.False; } + return related; } - return true; + return Ternary.True; } - function indexTypesIdenticalTo(indexKind: IndexKind, source: ObjectType, target: ObjectType, reportErrors: boolean): boolean { + function indexTypesIdenticalTo(indexKind: IndexKind, source: ObjectType, target: ObjectType): Ternary { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return Ternary.True; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return Ternary.False; } } - function compareSignatures(source: Signature, target: Signature, compareReturnTypes: boolean, compareTypes: (s: Type, t: Type) => boolean): boolean { + function isPropertyIdenticalTo(sourceProp: Symbol, targetProp: Symbol): boolean { + return compareProperties(sourceProp, targetProp, compareTypes) !== Ternary.False; + } + + function compareProperties(sourceProp: Symbol, targetProp: Symbol, compareTypes: (source: Type, target: Type) => Ternary): Ternary { + // Two members are considered identical when + // - they are public properties with identical names, optionality, and types, + // - they are private or protected properties originating in the same declaration and having identical types + if (sourceProp === targetProp) { + return Ternary.True; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (NodeFlags.Private | NodeFlags.Protected); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (NodeFlags.Private | NodeFlags.Protected); + if (sourcePropAccessibility !== targetPropAccessibility) { + return Ternary.False; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return Ternary.False; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return Ternary.False; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + + function compareSignatures(source: Signature, target: Signature, compareReturnTypes: boolean, compareTypes: (s: Type, t: Type) => Ternary): Ternary { if (source === target) { - return true; + return Ternary.True; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return false; + return Ternary.False; } + var result = Ternary.True; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return false; + return Ternary.False; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!compareTypes(source.typeParameters[i], target.typeParameters[i])) { - return false; + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return Ternary.False; } + result &= related; } } else if (source.typeParameters || source.typeParameters) { - return false; + return Ternary.False; } // Spec 1.0 Section 3.8.3 & 3.8.4: // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N @@ -3745,11 +3843,16 @@ module ts { for (var i = 0, len = source.parameters.length; i < len; i++) { var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!compareTypes(s, t)) { - return false; + var related = compareTypes(s, t); + if (!related) { + return Ternary.False; } + result &= related; } - return !compareReturnTypes || compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; } function isSupertypeOfEach(candidate: Type, types: Type[]): boolean { @@ -3763,6 +3866,42 @@ module ts { return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined); } + function reportNoCommonSupertypeError(types: Type[], errorLocation: Node, errorMessageChainHead: DiagnosticMessageChain): void { + var bestSupertype: Type; + var bestSupertypeDownfallType: Type; // The type that caused bestSupertype not to be the common supertype + var bestSupertypeScore = 0; + + for (var i = 0; i < types.length; i++) { + var score = 0; + var downfallType: Type = undefined; + for (var j = 0; j < types.length; j++) { + if (isTypeSubtypeOf(types[j], types[i])) { + score++; + } + else if (!downfallType) { + downfallType = types[j]; + } + } + + if (score > bestSupertypeScore) { + bestSupertype = types[i]; + bestSupertypeDownfallType = downfallType; + bestSupertypeScore = score; + } + + // types.length - 1 is the maximum score, given that getCommonSupertype returned false + if (bestSupertypeScore === types.length - 1) { + break; + } + } + + // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the + // subtype as the first argument to the error + checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, + Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, + errorMessageChainHead); + } + function isTypeOfObjectLiteral(type: Type): boolean { return (type.flags & TypeFlags.Anonymous) && type.symbol && (type.symbol.flags & SymbolFlags.ObjectLiteral) ? true : false; } @@ -3872,8 +4011,10 @@ module ts { } function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { - var inferences: Type[][] = []; - for (var i = 0; i < typeParameters.length; i++) inferences.push([]); + var inferences: TypeInferences[] = []; + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -3887,6 +4028,7 @@ module ts { var sourceStack: Type[]; var targetStack: Type[]; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source: Type, target: Type) { @@ -3915,9 +4057,11 @@ module ts { var typeParameters = context.typeParameters; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { - context.inferenceCount++; var inferences = context.inferences[i]; - if (!contains(inferences, source)) inferences.push(source); + var candidates = inferiority ? + inferences.secondary || (inferences.secondary = []) : + inferences.primary || (inferences.primary = []); + if (!contains(candidates, source)) candidates.push(source); break; } } @@ -3932,7 +4076,6 @@ module ts { } else if (target.flags & TypeFlags.Union) { var targetTypes = (target).types; - var startCount = context.inferenceCount; var typeParameterCount = 0; var typeParameter: TypeParameter; // First infer to each type in union that isn't a type parameter @@ -3946,9 +4089,11 @@ module ts { inferFromTypes(source, t); } } - // If no inferences were produced above and union contains a single naked type parameter, infer to that type parameter - if (context.inferenceCount === startCount && typeParameterCount === 1) { + // If union contains a single naked type parameter, make a secondary inference to that type parameter + if (typeParameterCount === 1) { + inferiority++; inferFromTypes(source, typeParameter); + inferiority--; } } else if (source.flags & TypeFlags.Union) { @@ -4018,31 +4163,38 @@ module ts { } } + function getInferenceCandidates(context: InferenceContext, index: number): Type[]{ + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } + function getInferredType(context: InferenceContext, index: number): Type { - var result = context.inferredTypes[index]; - if (!result) { - var inferences = context.inferences[index]; + var inferredType = context.inferredTypes[index]; + if (!inferredType) { + var inferences = getInferenceCandidates(context, index); if (inferences.length) { // Infer widened union or supertype, or the undefined type for no common supertype var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - var inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : undefinedType; + inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; } else { // Infer the empty object type when no inferences were made inferredType = emptyObjectType; } - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; - context.inferredTypes[index] = result; + if (inferredType !== inferenceFailureType) { + var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + } + context.inferredTypes[index] = inferredType; } - return result; + return inferredType; } function getInferredTypes(context: InferenceContext): Type[] { for (var i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - context.inferences = undefined; + return context.inferredTypes; } @@ -4055,7 +4207,7 @@ module ts { function getResolvedSymbol(node: Identifier): Symbol { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, identifierToString(node)) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, SymbolFlags.Value | SymbolFlags.ExportValue, Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } return links.resolvedSymbol; } @@ -4170,14 +4322,10 @@ module ts { function getNarrowedTypeOfSymbol(symbol: Symbol, node: Node) { var type = getTypeOfSymbol(symbol); // Only narrow when symbol is variable of a structured type - if (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured) { - while (true) { + if (node && (symbol.flags & SymbolFlags.Variable && type.flags & TypeFlags.Structured)) { + loop: while (true) { var child = node; node = node.parent; - // Stop at containing function or module block - if (!node || node.kind === SyntaxKind.FunctionBlock || node.kind === SyntaxKind.ModuleBlock) { - break; - } var narrowedType = type; switch (node.kind) { case SyntaxKind.IfStatement: @@ -4203,9 +4351,18 @@ module ts { } } break; + case SyntaxKind.SourceFile: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + // Stop at the first containing function or module declaration + break loop; } - // Only use narrowed type if construct contains no assignments to variable - if (narrowedType !== type) { + // Use narrowed type if it is a subtype and construct contains no assignments to variable + if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) { if (isVariableAssignedWithin(symbol, node)) { break; } @@ -4325,8 +4482,8 @@ module ts { if (symbol.flags & SymbolFlags.Import) { // Mark the import as referenced so that we emit it in the final .js file. - // exception: identifiers that appear in type queries - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + // exception: identifiers that appear in type queries, const enums, modules that contain only const enums + getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))); } checkCollisionWithCapturedSuperVariable(node, node); @@ -4517,7 +4674,7 @@ module ts { // Return contextual type of parameter or undefined if no contextual type is available function getContextuallyTypedParameterType(parameter: ParameterDeclaration): Type { - var func = parameter.parent; + var func = parameter.parent; if (func.kind === SyntaxKind.FunctionExpression || func.kind === SyntaxKind.ArrowFunction) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); @@ -4663,7 +4820,8 @@ module ts { var declaration = node.parent; var objectLiteral = declaration.parent; var type = getContextualType(objectLiteral); - var name = declaration.name.text; + // TODO(jfreeman): Handle this case for computed names and symbols + var name = (declaration.name).text; if (type && name) { return getTypeOfPropertyOfContextualType(type, name) || isNumericName(name) && getIndexTypeOfContextualType(type, IndexKind.Number) || @@ -4741,8 +4899,9 @@ module ts { // Return the contextual signature for a given expression node. A contextual type provides a // contextual signature if it has a single call signature and if that call signature is non-generic. - // If the contextual type is a union type and each constituent type that has a contextual signature - // provides the same contextual signature, then the union type provides that contextual signature. + // If the contextual type is a union type, get the signature from each type possible and if they are + // all identical ignoring their return type, the result is same signature but with return type as + // union type of return types from these signatures function getContextualSignature(node: Expression): Signature { var type = getContextualType(node); if (!type) { @@ -4751,19 +4910,41 @@ module ts { if (!(type.flags & TypeFlags.Union)) { return getNonGenericSignature(type); } - var result: Signature; + var signatureList: Signature[]; var types = (type).types; for (var i = 0; i < types.length; i++) { + // The signature set of all constituent type with call signatures should match + // So number of signatures allowed is either 0 or 1 + if (signatureList && + getSignaturesOfObjectOrUnionType(types[i], SignatureKind.Call).length > 1) { + return undefined; + } + var signature = getNonGenericSignature(types[i]); if (signature) { - if (!result) { - result = signature; + if (!signatureList) { + // This signature will contribute to contextual union signature + signatureList = [signature]; } - else if (!compareSignatures(result, signature, /*compareReturnTypes*/ true, isTypeIdenticalTo)) { + else if (!compareSignatures(signatureList[0], signature, /*compareReturnTypes*/ false, compareTypes)) { + // Signatures arent identical, do not use return undefined; } + else { + // Use this signature for contextual union signature + signatureList.push(signature); + } } } + + // Result is union of signatures collected (return type is union of return types of this signature set) + var result: Signature; + if (signatureList) { + result = cloneSignature(signatureList[0]); + // Clear resolved return type we possibly got from cloneSignature + result.resolvedReturnType = undefined; + result.unionSignatures = signatureList; + } return result; } @@ -4785,7 +4966,7 @@ module ts { } return createArrayType(getUnionType(elementTypes)); } - + function isNumericName(name: string) { // The intent of numeric names is that // - they are names with text in a numeric form, and that @@ -4810,7 +4991,7 @@ module ts { // with the strings '"Infinity"', '"-Infinity"', and '"NaN"' respectively. return (+name).toString() === name; } - + function checkObjectLiteral(node: ObjectLiteral, contextualMapper?: TypeMapper): Type { var members = node.symbol.members; var properties: SymbolTable = {}; @@ -4930,7 +5111,7 @@ module ts { var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, identifierToString(node.right), typeToString(type)); + error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(node.right), typeToString(type)); } return unknownType; } @@ -4980,6 +5161,10 @@ module ts { if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== SyntaxKind.StringLiteral) { + error(node.index, Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } + // TypeScript 1.0 spec (April 2014): 4.10 Property Access // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. @@ -4994,6 +5179,7 @@ module ts { var name = (node.index).text; var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } @@ -5029,45 +5215,103 @@ module ts { return unknownType; } - function resolveUntypedCall(node: CallExpression): Signature { - forEach(node.arguments, argument => { - checkExpression(argument); - }); + function resolveUntypedCall(node: CallLikeExpression): Signature { + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + checkExpression((node).template); + } + else { + forEach((node).arguments, argument => { + checkExpression(argument); + }); + } return anySignature; } - function resolveErrorCall(node: CallExpression): Signature { + function resolveErrorCall(node: CallLikeExpression): Signature { resolveUntypedCall(node); return unknownSignature; } - function signatureHasCorrectArity(node: CallExpression, signature: Signature): boolean { - if (!node.arguments) { - // This only happens when we have something of the form: - // new C - // - return signature.minArgumentCount === 0; + function hasCorrectArity(node: CallLikeExpression, args: Expression[], signature: Signature) { + var adjustedArgCount: number; + var typeArguments: NodeArray; + var callIsIncomplete: boolean; + + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + var tagExpression = node; + + // Even if the call is incomplete, we'll have a missing expression as our last argument, + // so we can say the count is just the arg list length + adjustedArgCount = args.length; + typeArguments = undefined; + + if (tagExpression.template.kind === SyntaxKind.TemplateExpression) { + // If a tagged template expression lacks a tail literal, the call is incomplete. + // Specifically, a template only can end in a TemplateTail or a Missing literal. + var templateExpression = tagExpression.template; + var lastSpan = lastOrUndefined(templateExpression.templateSpans); + Debug.assert(lastSpan !== undefined); // we should always have at least one span. + callIsIncomplete = lastSpan.literal.kind === SyntaxKind.Missing || isUnterminatedTemplateEnd(lastSpan.literal); + } + else { + // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, + // then this might actually turn out to be a TemplateHead in the future; + // so we consider the call to be incomplete. + var templateLiteral = tagExpression.template; + Debug.assert(templateLiteral.kind === SyntaxKind.NoSubstitutionTemplateLiteral); + callIsIncomplete = isUnterminatedTemplateEnd(templateLiteral); + } + } + else { + var callExpression = node; + if (!callExpression.arguments) { + // This only happens when we have something of the form: 'new C' + Debug.assert(callExpression.kind === SyntaxKind.NewExpression); + + return signature.minArgumentCount === 0; + } + + // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. + adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + + // If we are missing the close paren, the call is incomplete. + callIsIncomplete = (callExpression).arguments.end === callExpression.end; + + typeArguments = callExpression.typeArguments; } - // For IDE scenarios, since we may have an incomplete call, we make two modifications - // to arity checking. - // 1. A trailing comma is tantamount to adding another argument - // 2. If the call is incomplete (no closing paren) allow fewer arguments than expected - var args = node.arguments; - var numberOfArgs = args.hasTrailingComma ? args.length + 1 : args.length; - var hasTooManyArguments = !signature.hasRestParameter && numberOfArgs > signature.parameters.length; - var hasRightNumberOfTypeArguments = !node.typeArguments || - (signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); + Debug.assert(adjustedArgCount !== undefined, "'adjustedArgCount' undefined"); + Debug.assert(callIsIncomplete !== undefined, "'callIsIncomplete' undefined"); - if (hasTooManyArguments || !hasRightNumberOfTypeArguments) { - return false; + return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature); + + /** + * @param adjustedArgCount The "apparent" number of arguments that we will have in this call. + * @param typeArguments Type arguments node of the call if it exists; undefined otherwise. + * @param callIsIncomplete Whether or not a call is unfinished, and we should be "lenient" when we have too few arguments. + * @param signature The signature whose arity we are comparing. + */ + function checkArity(adjustedArgCount: number, + typeArguments: NodeArray, + callIsIncomplete: boolean, + signature: Signature): boolean { + // Too many arguments implies incorrect arity. + if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { + return false; + } + + // If the user supplied type arguments, but the number of type arguments does not match + // the declared number of type parameters, the call has an incorrect arity. + var hasRightNumberOfTypeArgs = !typeArguments || + (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + if (!hasRightNumberOfTypeArgs) { + return false; + } + + // If the call is incomplete, we should skip the lower bound check. + var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; + return callIsIncomplete || hasEnoughArguments; } - - // If we are missing the close paren, the call is incomplete, and we should skip - // the lower bound check. - var callIsIncomplete = args.end === node.end; - var hasEnoughArguments = numberOfArgs >= signature.minArgumentCount; - return callIsIncomplete || hasEnoughArguments; } // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. @@ -5092,7 +5336,7 @@ module ts { return getSignatureInstantiation(signature, getInferredTypes(context)); } - function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): Type[] { + function inferTypeArguments(signature: Signature, args: Expression[], excludeArgument?: boolean[]): InferenceContext { var typeParameters = signature.typeParameters; var context = createInferenceContext(typeParameters, /*inferUnionTypes*/ false); var mapper = createInferenceMapper(context); @@ -5103,15 +5347,23 @@ module ts { } if (!excludeArgument || excludeArgument[i] === undefined) { var parameterType = getTypeAtPosition(signature, i); + + if (i === 0 && args[i].parent.kind === SyntaxKind.TaggedTemplateExpression) { + inferTypes(context, globalTemplateStringsArrayType, parameterType); + continue; + } + inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); } } + // Next, infer from those context sensitive arguments that are no longer excluded if (excludeArgument) { for (var i = 0; i < args.length; i++) { if (args[i].kind === SyntaxKind.OmittedExpression) { continue; } + // No need to special-case tagged templates; their excludeArgument value will be 'undefined'. if (excludeArgument[i] === false) { var parameterType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); @@ -5119,51 +5371,104 @@ module ts { } } var inferredTypes = getInferredTypes(context); - // Inference has failed if the undefined type is in list of inferences - return contains(inferredTypes, undefinedType) ? undefined : inferredTypes; + // Inference has failed if the inferenceFailureType type is in list of inferences + context.failedTypeParameterIndex = indexOf(inferredTypes, inferenceFailureType); + + // Wipe out the inferenceFailureType from the array so that error recovery can work properly + for (var i = 0; i < inferredTypes.length; i++) { + if (inferredTypes[i] === inferenceFailureType) { + inferredTypes[i] = unknownType; + } + } + + return context; } - function checkTypeArguments(signature: Signature, typeArguments: TypeNode[]): Type[] { + function checkTypeArguments(signature: Signature, typeArguments: TypeNode[], typeArgumentResultTypes: Type[], reportErrors: boolean): boolean { var typeParameters = signature.typeParameters; - var result: Type[] = []; + var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + // Do not push on this array! It has a preallocated length + typeArgumentResultTypes[i] = typeArgument; + if (typeArgumentsAreAssignable /* so far */) { + var constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, + Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } } - result.push(typeArgument); } - return result; + return typeArgumentsAreAssignable; } - function checkApplicableSignature(node: CallExpression, signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.kind === SyntaxKind.OmittedExpression) { - continue; - } - var paramType = getTypeAtPosition(signature, i); + function checkApplicableSignature(node: CallLikeExpression, args: Node[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var argType: Type; + + if (arg.kind === SyntaxKind.OmittedExpression) { + continue; + } + + var paramType = getTypeAtPosition(signature, i); + + if (i === 0 && node.kind === SyntaxKind.TaggedTemplateExpression) { + // A tagged template expression has something of a + // "virtual" parameter with the "cooked" strings array type. + argType = globalTemplateStringsArrayType; + } + else { // String literals get string literal types unless we're reporting errors - var argType = arg.kind === SyntaxKind.StringLiteral && !reportErrors ? - getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - // Use argument expression as error location when reporting errors - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, - Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } + argType = arg.kind === SyntaxKind.StringLiteral && !reportErrors + ? getStringLiteralType(arg) + : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + } + + // Use argument expression as error location when reporting errors + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; } } + return true; } - function resolveCall(node: CallExpression, signatures: Signature[], candidatesOutArray: Signature[]): Signature { - forEach(node.typeArguments, checkSourceElement); + /** + * Returns the effective arguments for an expression that works like a function invokation. + * + * If 'node' is a CallExpression or a NewExpression, then its argument list is returned. + * If 'node' is a TaggedTemplateExpression, a new argument list is constructed from the substitution + * expressions, where the first element of the list is the template for error reporting purposes. + */ + function getEffectiveCallArguments(node: CallLikeExpression): Expression[] { + var args: Expression[]; + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + var template = (node).template; + args = [template]; + + if (template.kind === SyntaxKind.TemplateExpression) { + forEach((template).templateSpans, span => { + args.push(span.expression); + }); + } + } + else { + args = (node).arguments || emptyArray; + } + + return args; + } + + function resolveCall(node: CallLikeExpression, signatures: Signature[], candidatesOutArray: Signature[]): Signature { + var isTaggedTemplate = node.kind === SyntaxKind.TaggedTemplateExpression; + + var typeArguments = isTaggedTemplate ? undefined : (node).typeArguments; + forEach(typeArguments, checkSourceElement); + var candidates = candidatesOutArray || []; // collectCandidates fills up the candidates array directly collectCandidates(); @@ -5171,55 +5476,107 @@ module ts { error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); return resolveErrorCall(node); } - var args = node.arguments || emptyArray; + + var args = getEffectiveCallArguments(node); + + // The following applies to any value of 'excludeArgument[i]': + // - true: the argument at 'i' is susceptible to a one-time permanent contextual typing. + // - undefined: the argument at 'i' is *not* susceptible to permanent contextual typing. + // - false: the argument at 'i' *was* and *has been* permanently contextually typed. + // + // The idea is that we will perform type argument inference & assignability checking once + // without using the susceptible parameters that are functions, and once more for each of those + // parameters, contextually typing each as we go along. + // + // For a tagged template, then the first argument be 'undefined' if necessary + // because it represents a TemplateStringsArray. var excludeArgument: boolean[]; - for (var i = 0; i < args.length; i++) { + for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) excludeArgument = new Array(args.length); + if (!excludeArgument) { + excludeArgument = new Array(args.length); + } excludeArgument[i] = true; } } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - var lastCandidate: Signature; - while (true) { - for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { - continue; - } - while (true) { - var candidate = candidates[i]; - if (candidate.typeParameters) { - var typeArguments = node.typeArguments ? - checkTypeArguments(candidate, node.typeArguments) : - inferTypeArguments(candidate, args, excludeArgument); - if (!typeArguments) { - break; - } - candidate = getSignatureInstantiation(candidate, typeArguments); - } - lastCandidate = candidate; - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, /*reportErrors*/ false)) { - break; - } - var index = excludeArgument ? indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; + + // The following variables are captured and modified by calls to chooseOverload. + // If overload resolution or type argument inference fails, we want to report the + // best error possible. The best error is one which says that an argument was not + // assignable to a parameter. This implies that everything else about the overload + // was fine. So if there is any overload that is only incorrect because of an + // argument, we will report an error on that one. + // + // function foo(s: string) {} + // function foo(n: number) {} // Report argument error on this overload + // function foo() {} + // foo(true); + // + // If none of the overloads even made it that far, there are two possibilities. + // There was a problem with type arguments for some overload, in which case + // report an error on that. Or none of the overloads even had correct arity, + // in which case give an arity error. + // + // function foo(x: T, y: T) {} // Report type argument inference error + // function foo() {} + // foo(0, true); + // + var candidateForArgumentError: Signature; + var candidateForTypeArgumentError: Signature; + var resultOfFailedInference: InferenceContext; + var result: Signature; + + // Section 4.12.1: + // if the candidate list contains one or more signatures for which the type of each argument + // expression is a subtype of each corresponding parameter type, the return type of the first + // of those signatures becomes the return type of the function call. + // Otherwise, the return type of the first signature in the candidate list becomes the return + // type of the function call. + // + // Whether the call is an error is determined by assignability of the arguments. The subtype pass + // is just important for choosing the best signature. So in the case where there is only one + // signature, the subtype pass is useless. So skipping it is an optimization. + if (candidates.length > 1) { + result = chooseOverload(candidates, subtypeRelation); + } + if (!result) { + // Reinitialize these pointers for round two + candidateForArgumentError = undefined; + candidateForTypeArgumentError = undefined; + resultOfFailedInference = undefined; + result = chooseOverload(candidates, assignableRelation); + } + if (result) { + return result; } // No signatures were applicable. Now report errors based on the last applicable signature with // no arguments excluded from assignability checks. // If candidate is undefined, it means that no candidates had a suitable arity. In that case, // skip the checkApplicableSignature check. - if (lastCandidate) { - checkApplicableSignature(node, lastCandidate, relation, /*excludeArgument*/ undefined, /*reportErrors*/ true); + if (candidateForArgumentError) { + // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] + // The importance of excludeArgument is to prevent us from typing function expression parameters + // in arguments too early. If possible, we'd like to only type them once we know the correct + // overload. However, this matters for the case where the call is correct. When the call is + // an error, we don't need to exclude any arguments, although it would cause no harm to do so. + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true); + } + else if (candidateForTypeArgumentError) { + if (!isTaggedTemplate && (node).typeArguments) { + checkTypeArguments(candidateForTypeArgumentError, (node).typeArguments, [], /*reportErrors*/ true) + } + else { + Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); + var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); + + var diagnosticChainHead = chainDiagnosticMessages(/*details*/ undefined, // details will be provided by call to reportNoCommonSupertypeError + Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, + typeToString(failedTypeParameter)); + + reportNoCommonSupertypeError(inferenceCandidates, (node).func || (node).tag, diagnosticChainHead); + } } else { error(node, Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); @@ -5232,7 +5589,7 @@ module ts { // f({ | if (!fullTypeCheck) { for (var i = 0, n = candidates.length; i < n; i++) { - if (signatureHasCorrectArity(node, candidates[i])) { + if (hasCorrectArity(node, args, candidates[i])) { return candidates[i]; } } @@ -5240,6 +5597,70 @@ module ts { return resolveErrorCall(node); + function chooseOverload(candidates: Signature[], relation: Map) { + for (var i = 0; i < candidates.length; i++) { + if (!hasCorrectArity(node, args, candidates[i])) { + continue; + } + + var originalCandidate = candidates[i]; + var inferenceResult: InferenceContext; + + while (true) { + var candidate = originalCandidate; + if (candidate.typeParameters) { + var typeArgumentTypes: Type[]; + var typeArgumentsAreValid: boolean; + if (typeArguments) { + typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false) + } + else { + inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; + typeArgumentTypes = inferenceResult.inferredTypes; + } + if (!typeArgumentsAreValid) { + break; + } + candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + } + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + break; + } + var index = excludeArgument ? indexOf(excludeArgument, true) : -1; + if (index < 0) { + return candidate; + } + excludeArgument[index] = false; + } + + // A post-mortem of this iteration of the loop. The signature was not applicable, + // so we want to track it as a candidate for reporting an error. If the candidate + // had no type parameters, or had no issues related to type arguments, we can + // report an error based on the arguments. If there was an issue with type + // arguments, then we can only report an error based on the type arguments. + if (originalCandidate.typeParameters) { + var instantiatedCandidate = candidate; + if (typeArgumentsAreValid) { + candidateForArgumentError = instantiatedCandidate; + } + else { + candidateForTypeArgumentError = originalCandidate; + if (!typeArguments) { + resultOfFailedInference = inferenceResult; + } + } + } + else { + Debug.assert(originalCandidate === candidate); + candidateForArgumentError = originalCandidate; + } + } + + return undefined; + } + // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order // A nit here is that we reorder only signatures that belong to the same symbol, // so order how inherited signatures are processed is still preserved. @@ -5256,31 +5677,29 @@ module ts { Debug.assert(!result.length); for (var i = 0; i < signatures.length; i++) { var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } + var symbol = signature.declaration && getSymbolOfNode(signature.declaration); + var parent = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent === lastParent) { + pos++; } else { - // current declaration belongs to a different symbol - // set cutoffPos so re-orderings in the future won't change result set from 0 to cutoffPos - pos = cutoffPos = result.length; lastParent = parent; + pos = cutoffPos; } - lastSymbol = symbol; - - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; } + else { + // current declaration belongs to a different symbol + // set cutoffPos so re-orderings in the future won't change result set from 0 to cutoffPos + pos = cutoffPos = result.length; + lastParent = parent; + } + lastSymbol = symbol; + + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; } } } @@ -5339,7 +5758,6 @@ module ts { function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[]): Signature { var expressionType = checkExpression(node.func); - // TS 1.0 spec: 4.11 // If ConstructExpr is of type Any, Args can be any argument // list and the result of the operation is of type Any. @@ -5387,9 +5805,32 @@ module ts { return resolveErrorCall(node); } + function resolveTaggedTemplateExpression(node: TaggedTemplateExpression, candidatesOutArray: Signature[]): Signature { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + + if (apparentType === unknownType) { + // Another error has already been reported + return resolveErrorCall(node); + } + + var callSignatures = getSignaturesOfType(apparentType, SignatureKind.Call); + + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & TypeFlags.Union) && isTypeAssignableTo(tagType, globalFunctionType))) { + return resolveUntypedCall(node); + } + + if (!callSignatures.length) { + error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return resolveErrorCall(node); + } + + return resolveCall(node, callSignatures, candidatesOutArray); + } + // candidatesOutArray is passed by signature help in the language service, and collectCandidates // must fill it up with the appropriate candidate signatures - function getResolvedSignature(node: CallExpression, candidatesOutArray?: Signature[]): Signature { + function getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature { var links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. // However, it is possible that either candidatesOutArray was not passed in the first time, @@ -5397,9 +5838,19 @@ module ts { // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === SyntaxKind.CallExpression - ? resolveCallExpression(node, candidatesOutArray) - : resolveNewExpression(node, candidatesOutArray); + + if (node.kind === SyntaxKind.CallExpression) { + links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); + } + else if (node.kind === SyntaxKind.NewExpression) { + links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); + } + else if (node.kind === SyntaxKind.TaggedTemplateExpression) { + links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); + } + else { + Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); + } } return links.resolvedSignature; } @@ -5411,7 +5862,11 @@ module ts { } if (node.kind === SyntaxKind.NewExpression) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== SyntaxKind.Constructor && declaration.kind !== SyntaxKind.ConstructSignature)) { + if (declaration && + declaration.kind !== SyntaxKind.Constructor && + declaration.kind !== SyntaxKind.ConstructSignature && + declaration.kind !== SyntaxKind.ConstructorType) { + // When resolved signature is a call signature (and not a construct signature) the result type is any if (compilerOptions.noImplicitAny) { error(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); @@ -5422,13 +5877,17 @@ module ts { return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type { + return getReturnTypeOfSignature(getResolvedSignature(node)); + } + function checkTypeAssertion(node: TypeAssertion): Type { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); if (fullTypeCheck && targetType !== unknownType) { var widenedType = getWidenedType(exprType, /*supressNoImplicitAnyErrors*/ true); if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); + checkTypeAssignableTo(exprType, targetType, node, Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); } } return targetType; @@ -5454,7 +5913,7 @@ module ts { } } - function getReturnTypeFromBody(func: FunctionDeclaration, contextualMapper?: TypeMapper): Type { + function getReturnTypeFromBody(func: FunctionLikeDeclaration, contextualMapper?: TypeMapper): Type { var contextualSignature = getContextualSignature(func); if (func.body.kind !== SyntaxKind.FunctionBlock) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); @@ -5488,7 +5947,7 @@ module ts { var typeName = typeToString(widenedType); if (func.name) { - error(func, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, identifierToString(func.name), typeName); + error(func, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, declarationNameToString(func.name), typeName); } else { error(func, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -5532,7 +5991,7 @@ module ts { // An explicitly typed function whose return type isn't the Void or the Any type // must have at least one return statement somewhere in its body. // An exception to this rule is if the function implementation consists of a single 'throw' statement. - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionDeclaration, returnType: Type): void { + function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionLikeDeclaration, returnType: Type): void { if (!fullTypeCheck) { return; } @@ -5609,7 +6068,7 @@ module ts { else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -5743,6 +6202,14 @@ module ts { return (type.flags & TypeFlags.Structured) !== 0; } + function isConstEnumObjectType(type: Type) : boolean { + return type.flags & (TypeFlags.ObjectType | TypeFlags.Anonymous) && type.symbol && isConstEnumSymbol(type.symbol); + } + + function isConstEnumSymbol(symbol: Symbol): boolean { + return (symbol.flags & SymbolFlags.ConstEnum) !== 0; + } + function checkInstanceOfExpression(node: BinaryExpression, leftType: Type, rightType: Type): Type { // TypeScript 1.0 spec (April 2014): 4.15.4 // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, @@ -5915,7 +6382,7 @@ module ts { // Use default messages if (ok) { // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported - checkTypeAssignableTo(valueType, leftType, node.left, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(valueType, leftType, node.left, /*headMessage*/ undefined); } } } @@ -5932,6 +6399,19 @@ module ts { return getUnionType([type1, type2]); } + function checkTemplateExpression(node: TemplateExpression): Type { + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + forEach((node).templateSpans, templateSpan => { + checkExpression(templateSpan.expression); + }); + + return stringType; + } + function checkExpressionWithContextualType(node: Expression, contextualType: Type, contextualMapper?: TypeMapper): Type { var saveContextualType = node.contextualType; node.contextualType = contextualType; @@ -5967,6 +6447,21 @@ module ts { } } } + + if (isConstEnumObjectType(type)) { + // enum object type for const enums are only permitted in: + // - 'left' in property access + // - 'object' in indexed access + // - target in rhs of import statement + var ok = + (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).left === node) || + (node.parent.kind === SyntaxKind.IndexedAccess && (node.parent).object === node) || + ((node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName) && isInRightSideOfImportOrExportAssignment(node)); + + if (!ok) { + error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + } + } return type; } @@ -5985,7 +6480,10 @@ module ts { return booleanType; case SyntaxKind.NumericLiteral: return numberType; + case SyntaxKind.TemplateExpression: + return checkTemplateExpression(node); case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: return stringType; case SyntaxKind.RegularExpressionLiteral: return globalRegExpType; @@ -6002,6 +6500,8 @@ module ts { case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: return checkCallExpression(node); + case SyntaxKind.TaggedTemplateExpression: + return checkTaggedTemplateExpression(node); case SyntaxKind.TypeAssertion: return checkTypeAssertion(node); case SyntaxKind.ParenExpression: @@ -6050,7 +6550,7 @@ module ts { } } else { - if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { + if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { error(parameterDeclaration, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); } } @@ -6059,16 +6559,16 @@ module ts { function checkReferencesInInitializer(n: Node): void { if (n.kind === SyntaxKind.Identifier) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - // check FunctionDeclaration.locals (stores parameters\function local variable) + // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name and if this entry matches the resolved symbol if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, SymbolFlags.Value) === referencedSymbol) { if (referencedSymbol.valueDeclaration.kind === SyntaxKind.Parameter) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, identifierToString(parameterDeclaration.name)); + error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = - forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); + forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { // legal case - parameter initializer references some parameter strictly on left of current parameter declaration @@ -6077,7 +6577,7 @@ module ts { // fall through to error reporting } - error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, identifierToString(parameterDeclaration.name), identifierToString(n)); + error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(parameterDeclaration.name), declarationNameToString(n)); } } else { @@ -6296,7 +6796,7 @@ module ts { var constraint = getConstraintOfTypeParameter((type).target.typeParameters[i]); if (fullTypeCheck && constraint) { var typeArgument = (type).typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + checkTypeAssignableTo(typeArgument, constraint, node, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } } @@ -6309,7 +6809,7 @@ module ts { function checkTypeLiteral(node: TypeLiteralNode) { forEach(node.members, checkSourceElement); if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); + var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); checkIndexConstraints(type); checkTypeForDuplicateIndexSignatures(node); } @@ -6342,12 +6842,11 @@ module ts { // TypeScript 1.0 spec (April 2014): 3.7.2.2 // Specialized signatures are not permitted in conjunction with a function body - if ((signatureDeclarationNode).body) { + if ((signatureDeclarationNode).body) { error(signatureDeclarationNode, Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } - var symbol = getSymbolOfNode(signatureDeclarationNode); // TypeScript 1.0 spec (April 2014): 3.7.2.4 // Every specialized call or construct signature in an object type must be assignable // to at least one non-specialized call or construct signature in the same object type @@ -6393,7 +6892,7 @@ module ts { return; } - function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { + function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionLikeDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { // Error if some overloads have a flag that is not shared by all overloads. To find the // deviations, we XOR someOverloadFlags with allOverloadFlags var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; @@ -6429,14 +6928,14 @@ module ts { var someNodeFlags: NodeFlags = 0; var allNodeFlags = flagsToCheck; var hasOverloads = false; - var bodyDeclaration: FunctionDeclaration; - var lastSeenNonAmbientDeclaration: FunctionDeclaration; - var previousDeclaration: FunctionDeclaration; + var bodyDeclaration: FunctionLikeDeclaration; + var lastSeenNonAmbientDeclaration: FunctionLikeDeclaration; + var previousDeclaration: FunctionLikeDeclaration; var declarations = symbol.declarations; var isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; - function reportImplementationExpectedError(node: FunctionDeclaration): void { + function reportImplementationExpectedError(node: FunctionLikeDeclaration): void { if (node.name && node.name.kind === SyntaxKind.Missing) { return; } @@ -6452,8 +6951,9 @@ module ts { }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode: Node = (subsequentNode).name || subsequentNode; - if (node.name && (subsequentNode).name && node.name.text === (subsequentNode).name.text) { + var errorNode: Node = (subsequentNode).name || subsequentNode; + // TODO(jfreeman): These are methods, so handle computed name case + if (node.name && (subsequentNode).name && (node.name).text === ((subsequentNode).name).text) { // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members Debug.assert(node.kind === SyntaxKind.Method); Debug.assert((node.flags & NodeFlags.Static) !== (subsequentNode.flags & NodeFlags.Static)); @@ -6461,8 +6961,8 @@ module ts { error(errorNode, diagnostic); return; } - else if ((subsequentNode).body) { - error(errorNode, Diagnostics.Function_implementation_name_must_be_0, identifierToString(node.name)); + else if ((subsequentNode).body) { + error(errorNode, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); return; } } @@ -6482,7 +6982,7 @@ module ts { var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + var node = declarations[i]; var inAmbientContext = isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral || inAmbientContext; if (inAmbientContextOrInterface) { @@ -6626,7 +7126,7 @@ module ts { // declaration spaces for exported and non-exported declarations intersect forEach(symbol.declarations, d => { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, identifierToString(d.name)); + error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(d.name)); } }); } @@ -6636,7 +7136,7 @@ module ts { case SyntaxKind.InterfaceDeclaration: return SymbolFlags.ExportType; case SyntaxKind.ModuleDeclaration: - return (d).name.kind === SyntaxKind.StringLiteral || isInstantiated(d) + return (d).name.kind === SyntaxKind.StringLiteral || getModuleInstanceState(d) !== ModuleInstanceState.NonInstantiated ? SymbolFlags.ExportNamespace | SymbolFlags.ExportValue : SymbolFlags.ExportNamespace; case SyntaxKind.ClassDeclaration: @@ -6653,7 +7153,7 @@ module ts { } } - function checkFunctionDeclaration(node: FunctionDeclaration): void { + function checkFunctionDeclaration(node: FunctionLikeDeclaration): void { checkSignatureDeclaration(node); var symbol = getSymbolOfNode(node); @@ -6689,7 +7189,7 @@ module ts { var typeName = typeToString(anyType); if (node.name) { - error(node, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, identifierToString(node.name), typeName); + error(node, Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, declarationNameToString(node.name), typeName); } else { error(node, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -6704,7 +7204,7 @@ module ts { function checkCollisionWithArgumentsInGeneratedCode(node: SignatureDeclaration) { // no rest parameters \ declaration context \ overload - no codegen impact - if (!hasRestParameters(node) || isInAmbientContext(node) || !(node).body) { + if (!hasRestParameters(node) || isInAmbientContext(node) || !(node).body) { return; } @@ -6725,7 +7225,7 @@ module ts { // - function has implementation (not a signature) // - function has rest parameters // - context is not ambient (otherwise no codegen impact) - if ((node.parent).body && hasRestParameters(node.parent) && !isInAmbientContext(node)) { + if ((node.parent).body && hasRestParameters(node.parent) && !isInAmbientContext(node)) { error(node, Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } return; @@ -6783,7 +7283,7 @@ module ts { case SyntaxKind.Method: case SyntaxKind.ArrowFunction: case SyntaxKind.Constructor: - if (hasRestParameters(current)) { + if (hasRestParameters(current)) { error(node, Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; } @@ -6793,8 +7293,9 @@ module ts { } } - function needCollisionCheckForIdentifier(node: Node, identifier: Identifier, name: string): boolean { - if (!(identifier && identifier.text === name)) { + // TODO(jfreeman): Decide what to do for computed properties + function needCollisionCheckForIdentifier(node: Node, identifier: DeclarationName, name: string): boolean { + if (!(identifier && (identifier).text === name)) { return false; } @@ -6811,15 +7312,16 @@ module ts { return false; } - if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { + if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { // just an overload - no codegen impact return false; } return true; } - - function checkCollisionWithCapturedThisVariable(node: Node, name: Identifier): void { + + // TODO(jfreeman): Decide what to do for computed properties + function checkCollisionWithCapturedThisVariable(node: Node, name: DeclarationName): void { if (!needCollisionCheckForIdentifier(node, name, "_this")) { return; } @@ -6844,7 +7346,7 @@ module ts { } } - function checkCollisionWithCapturedSuperVariable(node: Node, name: Identifier) { + function checkCollisionWithCapturedSuperVariable(node: Node, name: DeclarationName) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } @@ -6867,13 +7369,14 @@ module ts { } } - function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) { + // TODO(jfreeman): Decide what to do for computed properties + function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: DeclarationName) { if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } // Uninstantiated modules shouldnt do this check - if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated(node)) { + if (node.kind === SyntaxKind.ModuleDeclaration && getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return; } @@ -6881,7 +7384,8 @@ module ts { var parent = node.kind === SyntaxKind.VariableDeclaration ? node.parent.parent : node.parent; if (parent.kind === SyntaxKind.SourceFile && isExternalModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords - error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); + error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, + declarationNameToString(name), declarationNameToString(name)); } } @@ -6917,7 +7421,7 @@ module ts { } } - function checkVariableDeclaration(node: VariableDeclaration) { + function checkVariableDeclaration(node: VariableDeclaration | PropertyDeclaration) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -6931,16 +7435,17 @@ module ts { type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & NodeCheckFlags.TypeChecked)) { // Use default messages - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*headMessage*/ undefined); } - checkCollisionWithConstDeclarations(node); + //TODO(jfreeman): Check that it is not a computed property + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -6951,7 +7456,7 @@ module ts { // Multiple declarations for the same variable name in the same declaration space are permitted, // provided that each declaration associates the same type with the variable. if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -7051,7 +7556,7 @@ module ts { func.type || (func.kind === SyntaxKind.GetAccessor && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, SyntaxKind.SetAccessor))); if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, /*headMessage*/ undefined); } else if (func.kind == SyntaxKind.Constructor) { // constructor doesn't have explicit return type annotation and yet its return type is known - declaring type @@ -7079,7 +7584,7 @@ module ts { var caseType = checkExpression(clause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails - checkTypeAssignableTo(caseType, expressionType, clause.expression, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + checkTypeAssignableTo(caseType, expressionType, clause.expression, /*headMessage*/ undefined); } } checkBlock(clause); @@ -7169,16 +7674,17 @@ module ts { } } - function checkTypeNameIsReserved(name: Identifier, message: DiagnosticMessage): void { + // TODO(jfreeman): Decide what to do for computed properties + function checkTypeNameIsReserved(name: DeclarationName, message: DiagnosticMessage): void { // TS 1.0 spec (April 2014): 3.6.1 // The predefined type keywords are reserved and cannot be used as names of user defined types. - switch (name.text) { + switch ((name).text) { case "any": case "number": case "boolean": case "string": case "void": - error(name, message, name.text); + error(name, message, (name).text); } } @@ -7192,7 +7698,7 @@ module ts { if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, Diagnostics.Duplicate_identifier_0, identifierToString(node.name)); + error(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); } } } @@ -7216,10 +7722,10 @@ module ts { if (type.baseTypes.length) { if (fullTypeCheck) { var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, Diagnostics.Class_0_incorrectly_extends_base_class_1); + checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, - Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, SymbolFlags.Value)) { error(node.baseType, Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } @@ -7238,7 +7744,7 @@ module ts { if (t !== unknownType) { var declaredType = (t.flags & TypeFlags.Reference) ? (t).target : t; if (declaredType.flags & (TypeFlags.Class | TypeFlags.Interface)) { - checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, Diagnostics.Class_0_incorrectly_implements_interface_1); + checkTypeAssignableTo(type, t, node.name, Diagnostics.Class_0_incorrectly_implements_interface_1); } else { error(typeRefNode, Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -7311,17 +7817,17 @@ module ts { errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - Debug.assert(derived.flags & SymbolFlags.Property); + Debug.assert((derived.flags & SymbolFlags.Property) !== 0); errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & SymbolFlags.Property) { - Debug.assert(derived.flags & SymbolFlags.Method); + Debug.assert((derived.flags & SymbolFlags.Method) !== 0); errorMessage = Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - Debug.assert(base.flags & SymbolFlags.Accessor); - Debug.assert(derived.flags & SymbolFlags.Method); + Debug.assert((base.flags & SymbolFlags.Accessor) !== 0); + Debug.assert((derived.flags & SymbolFlags.Method) !== 0); errorMessage = Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } @@ -7363,6 +7869,43 @@ module ts { return true; } + function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + + var seen: Map<{ prop: Symbol; containingType: Type }> = {}; + forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); + var ok = true; + + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + + var errorInfo = chainDiagnosticMessages(undefined, Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + + return ok; + } + function checkInterfaceDeclaration(node: InterfaceDeclaration) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { @@ -7383,7 +7926,7 @@ module ts { // run subsequent checks only if first set succeeded if (checkInheritedPropertiesAreIdentical(type, node.name)) { forEach(type.baseTypes, baseType => { - checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, Diagnostics.Interface_0_incorrectly_extends_interface_1); + checkTypeAssignableTo(type, baseType, node.name , Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); } @@ -7397,21 +7940,9 @@ module ts { } } - function getConstantValueForExpression(node: Expression): number { - var isNegative = false; - if (node.kind === SyntaxKind.PrefixOperator) { - var unaryExpression = node; - if (unaryExpression.operator === SyntaxKind.MinusToken || unaryExpression.operator === SyntaxKind.PlusToken) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === SyntaxKind.MinusToken; - } - } - if (node.kind === SyntaxKind.NumericLiteral) { - var literalText = (node).text; - return isNegative ? -literalText : +literalText; - } - - return undefined; + function checkTypeAliasDeclaration(node: TypeAliasDeclaration) { + checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); + checkSourceElement(node.type); } function computeEnumMemberValues(node: EnumDeclaration) { @@ -7422,23 +7953,39 @@ module ts { var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = isInAmbientContext(node); + var enumIsConst = isConstEnumDeclaration(node); forEach(node.members, member => { - if(isNumericName(member.name.text)) { + // TODO(jfreeman): Check that it is not a computed name + if(isNumericName((member.name).text)) { error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - // Only here do we need to check that the initializer is assignable to the enum type. - // If it is a constant value (not undefined), it is syntactically constrained to be a number. - // Also, we do not need to check this for ambients because there is already - // a syntax error if it is not a constant. - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*chainedMessage*/ undefined, /*terminalMessage*/ undefined); + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + // Only here do we need to check that the initializer is assignable to the enum type. + // If it is a constant value (not undefined), it is syntactically constrained to be a number. + // Also, we do not need to check this for ambients because there is already + // a syntax error if it is not a constant. + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*headMessage*/ undefined); + } } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } + } + } - else if (ambient) { + else if (ambient && !enumIsConst) { autoValue = undefined; } @@ -7449,6 +7996,110 @@ module ts { nodeLinks.flags |= NodeCheckFlags.EnumValuesComputed; } + + function getConstantValueForEnumMemberInitializer(initializer: Expression, enumIsConst: boolean): number { + return evalConstant(initializer); + + function evalConstant(e: Node): number { + switch (e.kind) { + case SyntaxKind.PrefixOperator: + var value = evalConstant((e).operand); + if (value === undefined) { + return undefined; + } + switch ((e).operator) { + case SyntaxKind.PlusToken: return value; + case SyntaxKind.MinusToken: return -value; + case SyntaxKind.TildeToken: return enumIsConst ? ~value : undefined; + } + return undefined; + case SyntaxKind.BinaryExpression: + if (!enumIsConst) { + return undefined; + } + + var left = evalConstant((e).left); + if (left === undefined) { + return undefined; + } + var right = evalConstant((e).right); + if (right === undefined) { + return undefined; + } + switch ((e).operator) { + case SyntaxKind.BarToken: return left | right; + case SyntaxKind.AmpersandToken: return left & right; + case SyntaxKind.GreaterThanGreaterThanToken: return left >> right; + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return left >>> right; + case SyntaxKind.LessThanLessThanToken: return left << right; + case SyntaxKind.CaretToken: return left ^ right; + case SyntaxKind.AsteriskToken: return left * right; + case SyntaxKind.SlashToken: return left / right; + case SyntaxKind.PlusToken: return left + right; + case SyntaxKind.MinusToken: return left - right; + case SyntaxKind.PercentToken: return left % right; + } + return undefined; + case SyntaxKind.NumericLiteral: + return +(e).text; + case SyntaxKind.ParenExpression: + return enumIsConst ? evalConstant((e).expression) : undefined; + case SyntaxKind.Identifier: + case SyntaxKind.IndexedAccess: + case SyntaxKind.PropertyAccess: + if (!enumIsConst) { + return undefined; + } + + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType: Type; + var propertyName: string; + + if (e.kind === SyntaxKind.Identifier) { + // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. + // instead pick current enum type and later try to fetch member from the type + enumType = currentType; + propertyName = (e).text; + } + else { + if (e.kind === SyntaxKind.IndexedAccess) { + if ((e).index.kind !== SyntaxKind.StringLiteral) { + return undefined; + } + var enumType = getTypeOfNode((e).object); + propertyName = ((e).index).text; + } + else { + var enumType = getTypeOfNode((e).left); + propertyName = (e).right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & SymbolFlags.EnumMember)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + // self references are illegal + if (member === propertyDecl) { + return undefined; + } + + // illegal case: forward reference + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node: EnumDeclaration) { @@ -7472,6 +8123,16 @@ module ts { var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = isConstEnumDeclaration(node); + // check that const is placed\omitted on all enum declarations + forEach(enumSymbol.declarations, decl => { + if (isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } + var seenEnumMissingInitialInitializer = false; forEach(enumSymbol.declarations, declaration => { // return true if we hit a violation of the rule, false otherwise @@ -7501,7 +8162,7 @@ module ts { var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && (declaration).body)) && !isInAmbientContext(declaration)) { + if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && (declaration).body)) && !isInAmbientContext(declaration)) { return declaration; } } @@ -7562,7 +8223,7 @@ module ts { checkExpression(node.entityName); } else { - error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, identifierToString(moduleName)); + error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); } } if (target.flags & SymbolFlags.Type) { @@ -7622,6 +8283,8 @@ module ts { return checkParameter(node); case SyntaxKind.Property: return checkPropertyDeclaration(node); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -7648,7 +8311,7 @@ module ts { case SyntaxKind.ParenType: return checkSourceElement((node).type); case SyntaxKind.FunctionDeclaration: - return checkFunctionDeclaration(node); + return checkFunctionDeclaration(node); case SyntaxKind.Block: return checkBlock(node); case SyntaxKind.FunctionBlock: @@ -7689,6 +8352,8 @@ module ts { return checkClassDeclaration(node); case SyntaxKind.InterfaceDeclaration: return checkInterfaceDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return checkTypeAliasDeclaration(node); case SyntaxKind.EnumDeclaration: return checkEnumDeclaration(node); case SyntaxKind.ModuleDeclaration: @@ -7713,7 +8378,7 @@ module ts { switch (node.kind) { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - forEach((node).parameters, checkFunctionExpressionBodies); + forEach((node).parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; case SyntaxKind.Method: @@ -7721,7 +8386,7 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.FunctionDeclaration: - forEach((node).parameters, checkFunctionExpressionBodies); + forEach((node).parameters, checkFunctionExpressionBodies); break; case SyntaxKind.WithStatement: checkFunctionExpressionBodies((node).expression); @@ -7735,6 +8400,7 @@ module ts { case SyntaxKind.IndexedAccess: case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: + case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.TypeAssertion: case SyntaxKind.ParenExpression: case SyntaxKind.PrefixOperator: @@ -7933,6 +8599,7 @@ module ts { case SyntaxKind.TypeParameter: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: return true; } @@ -7966,7 +8633,7 @@ module ts { // above them to find the lowest container case SyntaxKind.Identifier: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === SyntaxKind.QualifiedName) { + if (node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node) { node = node.parent; } // fall through @@ -8001,7 +8668,7 @@ module ts { case SyntaxKind.Method: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - return node === (parent).type; + return node === (parent).type; case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -8011,6 +8678,9 @@ module ts { case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: return (parent).typeArguments && (parent).typeArguments.indexOf(node) >= 0; + case SyntaxKind.TaggedTemplateExpression: + // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. + return false; } } @@ -8019,7 +8689,7 @@ module ts { function isInRightSideOfImportOrExportAssignment(node: EntityName) { while (node.parent.kind === SyntaxKind.QualifiedName) { - node = node.parent; + node = node.parent; } if (node.parent.kind === SyntaxKind.ImportDeclaration) { @@ -8053,7 +8723,7 @@ module ts { } if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; + entityName = entityName.parent; } if (isExpression(entityName)) { @@ -8066,7 +8736,7 @@ module ts { else if (entityName.kind === SyntaxKind.QualifiedName || entityName.kind === SyntaxKind.PropertyAccess) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { - checkPropertyAccess(entityName); + checkPropertyAccess(entityName); } return getNodeLinks(entityName).resolvedSymbol; } @@ -8098,10 +8768,10 @@ module ts { return getSymbolOfNode(node.parent); } - if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(node)) { + if (node.kind === SyntaxKind.Identifier && isInRightSideOfImportOrExportAssignment(node)) { return node.parent.kind === SyntaxKind.ExportAssignment ? getSymbolOfEntityName(node) - : getSymbolOfPartOfRightHandSideOfImport(node); + : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { @@ -8182,7 +8852,7 @@ module ts { return symbol && getTypeOfSymbol(symbol); } - if (isInRightSideOfImportOrExportAssignment(node)) { + if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolInfo(node); var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); @@ -8254,7 +8924,7 @@ module ts { return true; } - function getLocalNameOfContainer(container: Declaration): string { + function getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string { var links = getNodeLinks(container); if (!links.localModuleName) { var prefix = ""; @@ -8271,7 +8941,7 @@ module ts { var node = location; while (node) { if ((node.kind === SyntaxKind.ModuleDeclaration || node.kind === SyntaxKind.EnumDeclaration) && getSymbolOfNode(node) === symbol) { - return getLocalNameOfContainer(node); + return getLocalNameOfContainer(node); } node = node.parent; } @@ -8298,17 +8968,15 @@ module ts { function getExportAssignmentName(node: SourceFile): string { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol): undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol): undefined; } - function isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean { + function isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean { if (node.parent.kind !== SyntaxKind.SourceFile || !node.entityName) { // parent is not source file or it is not reference to internal module return false; } - var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { @@ -8326,6 +8994,16 @@ module ts { return forEach(getDiagnostics(sourceFile), d => d.isEarly); } + function isImportResolvedToValue(symbol: Symbol): boolean { + var target = resolveImport(symbol); + // const enums and modules that contain only const enums are not considered values from the emit perespective + return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); + } + + function isConstEnumOrConstEnumOnlyModule(s: Symbol): boolean { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; + } + function isReferencedImportDeclaration(node: ImportDeclaration): boolean { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { @@ -8334,15 +9012,12 @@ module ts { // logic below will answer 'true' for exported import declaration in a nested module that itself is not exported. // As a consequence this might cause emitting extra. if (node.flags & NodeFlags.Export) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } - function isImplementationOfOverload(node: FunctionDeclaration) { + function isImplementationOfOverload(node: FunctionLikeDeclaration) { if (node.body) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); @@ -8372,7 +9047,7 @@ module ts { return getNodeLinks(node).enumMemberValue; } - function getConstantValue(node: PropertyAccess): number { + function getConstantValue(node: PropertyAccess | IndexedAccess): number { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & SymbolFlags.EnumMember)) { var declaration = symbol.valueDeclaration; @@ -8388,7 +9063,9 @@ module ts { function writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) { // Get type of the symbol if this is the valid symbol otherwise get type at location var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & SymbolFlags.TypeLiteral) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.CallSignature | SymbolFlags.ConstructSignature)) + ? getTypeOfSymbol(symbol) + : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } @@ -8407,7 +9084,7 @@ module ts { isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, isEmitBlocked: isEmitBlocked, isDeclarationVisible: isDeclarationVisible, @@ -8448,6 +9125,12 @@ module ts { globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + + // If we're in ES6 mode, load the TemplateStringsArray. + // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios. + globalTemplateStringsArrayType = compilerOptions.target >= ScriptTarget.ES6 + ? getGlobalType("TemplateStringsArray") + : unknownType; } initializeTypeChecker(); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 71d68c546d2..5e61e9e1cb7 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -24,7 +24,7 @@ module ts { type: "boolean", }, { - name: "emitBOM", + name: "emitBOM", type: "boolean" }, { @@ -107,7 +107,7 @@ module ts { { name: "target", shortName: "t", - type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5 , "es6": ScriptTarget.ES6 }, + type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 }, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: Diagnostics.VERSION, error: Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -123,6 +123,11 @@ module ts { shortName: "w", type: "boolean", description: Diagnostics.Watch_input_files, + }, + { + name: "preserveConstEnums", + type: "boolean", + description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code } ]; @@ -188,9 +193,10 @@ module ts { break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: - var value = (args[i++] || "").toLowerCase(); - if (hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; + var map = >opt.type; + var key = (args[i++] || "").toLowerCase(); + if (hasProperty(map, key)) { + options[opt.name] = map[key]; } else { errors.push(createCompilerDiagnostic(opt.error)); diff --git a/src/compiler/core.ts b/src/compiler/core.ts index ae2cf053123..e512688fee2 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,10 +1,30 @@ /// module ts { + + // Ternary values are defined such that + // x & y is False if either x or y is False. + // x & y is Maybe if either x or y is Maybe, but neither x or y is False. + // x & y is True if both x and y are True. + // x | y is False if both x and y are False. + // x | y is Maybe if either x or y is Maybe, but neither x or y is True. + // x | y is True if either x or y is True. + export const enum Ternary { + False = 0, + Maybe = 1, + True = -1 + } + export interface Map { [index: string]: T; } + export const enum Comparison { + LessThan = -1, + EqualTo = 0, + GreaterThan = 1 + } + export interface StringSet extends Map { } export function forEach(array: T[], callback: (element: T) => U): U { @@ -79,6 +99,7 @@ module ts { export function concatenate(array1: T[], array2: T[]): T[] { if (!array2 || !array2.length) return array1; if (!array1 || !array1.length) return array2; + return array1.concat(array2); } @@ -101,6 +122,17 @@ module ts { return result; } + /** + * Returns the last element of an array if non-empty, undefined otherwise. + */ + export function lastOrUndefined(array: T[]): T { + if (array.length === 0) { + return undefined; + } + + return array[array.length - 1]; + } + export function binarySearch(array: number[], value: number): number { var low = 0; var high = array.length - 1; @@ -274,6 +306,12 @@ module ts { }; } + export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain { + Debug.assert(!headChain.next); + headChain.next = tailChain; + return headChain; + } + export function flattenDiagnosticChain(file: SourceFile, start: number, length: number, diagnosticChain: DiagnosticMessageChain, newLine: string): Diagnostic { Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); @@ -306,11 +344,11 @@ module ts { }; } - export function compareValues(a: T, b: T): number { - if (a === b) return 0; - if (a === undefined) return -1; - if (b === undefined) return 1; - return a < b ? -1 : 1; + export function compareValues(a: T, b: T): Comparison { + if (a === b) return Comparison.EqualTo; + if (a === undefined) return Comparison.LessThan; + if (b === undefined) return Comparison.GreaterThan; + return a < b ? Comparison.LessThan : Comparison.GreaterThan; } function getDiagnosticFilename(diagnostic: Diagnostic): string { @@ -335,7 +373,7 @@ module ts { var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === Comparison.EqualTo; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -610,7 +648,7 @@ module ts { getSignatureConstructor: () => Signature } - export enum AssertionLevel { + export const enum AssertionLevel { None = 0, Normal = 1, Aggressive = 2, @@ -624,7 +662,7 @@ module ts { return currentAssertionLevel >= level; } - export function assert(expression: any, message?: string, verboseDebugInfo?: () => string): void { + export function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void { if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 61842486450..bae908b2774 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -120,6 +120,8 @@ module ts { const_declarations_must_be_initialized: { code: 1155, category: DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, @@ -140,17 +142,16 @@ module ts { Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, Cannot_find_global_type_0: { code: 2318, category: DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.Error, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible:" }, + Types_of_property_0_are_incompatible: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, Index_signature_is_missing_in_type_0: { code: 2329, category: DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible:" }, + Index_signatures_are_incompatible: { code: 2330, category: DiagnosticCategory.Error, key: "Index signatures are incompatible." }, this_cannot_be_referenced_in_a_module_body: { code: 2331, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in a module body." }, this_cannot_be_referenced_in_current_location: { code: 2332, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, @@ -163,7 +164,6 @@ module ts { Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}':" }, Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, @@ -173,7 +173,6 @@ module ts { Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, No_best_common_type_exists_among_return_expressions: { code: 2354, category: DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, @@ -234,12 +233,9 @@ module ts { Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, Class_name_cannot_be_0: { code: 2414, category: DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, Class_0_incorrectly_extends_base_class_1: { code: 2415, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}':" }, Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, Class_0_incorrectly_implements_interface_1: { code: 2420, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}':" }, A_class_may_only_implement_another_class_or_interface: { code: 2422, category: DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, @@ -247,7 +243,6 @@ module ts { Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, Interface_name_cannot_be_0: { code: 2427, category: DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}':" }, Interface_0_incorrectly_extends_interface_1: { code: 2430, category: DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, Enum_name_cannot_be_0: { code: 2431, category: DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, @@ -271,6 +266,10 @@ module ts { Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, @@ -350,6 +349,15 @@ module ts { Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: DiagnosticCategory.Error, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, @@ -364,7 +372,8 @@ module ts { Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, Watch_input_files: { code: 6005, category: DiagnosticCategory.Message, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6007, category: DiagnosticCategory.Message, key: "Do not emit outputs if any type checking errors were reported." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: DiagnosticCategory.Message, key: "Do not emit outputs if any type checking errors were reported." }, Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cfb30775251..93638b6dade 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -471,6 +471,14 @@ "category": "Error", "code": 1157 }, + "Invalid template literal; expected '}'": { + "category": "Error", + "code": 1158 + }, + "Tagged templates are only available when targeting ECMAScript 6 and higher.": { + "category": "Error", + "code": 1159 + }, "Duplicate identifier '{0}'.": { "category": "Error", @@ -552,7 +560,7 @@ "category": "Error", "code": 2319 }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':": { + "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.": { "category": "Error", "code": 2320 }, @@ -560,13 +568,9 @@ "category": "Error", "code": 2321 }, - "Type '{0}' is not assignable to type '{1}':": { - "category": "Error", - "code": 2322 - }, "Type '{0}' is not assignable to type '{1}'.": { "category": "Error", - "code": 2323 + "code": 2322 }, "Property '{0}' is missing in type '{1}'.": { "category": "Error", @@ -576,7 +580,7 @@ "category": "Error", "code": 2325 }, - "Types of property '{0}' are incompatible:": { + "Types of property '{0}' are incompatible.": { "category": "Error", "code": 2326 }, @@ -584,7 +588,7 @@ "category": "Error", "code": 2327 }, - "Types of parameters '{0}' and '{1}' are incompatible:": { + "Types of parameters '{0}' and '{1}' are incompatible.": { "category": "Error", "code": 2328 }, @@ -592,7 +596,7 @@ "category": "Error", "code": 2329 }, - "Index signatures are incompatible:": { + "Index signatures are incompatible.": { "category": "Error", "code": 2330 }, @@ -644,10 +648,6 @@ "category": "Error", "code": 2342 }, - "Type '{0}' does not satisfy the constraint '{1}':": { - "category": "Error", - "code": 2343 - }, "Type '{0}' does not satisfy the constraint '{1}'.": { "category": "Error", "code": 2344 @@ -684,10 +684,6 @@ "category": "Error", "code": 2352 }, - "Neither type '{0}' nor type '{1}' is assignable to the other:": { - "category": "Error", - "code": 2353 - }, "No best common type exists among return expressions.": { "category": "Error", "code": 2354 @@ -928,18 +924,10 @@ "category": "Error", "code": 2415 }, - "Class '{0}' incorrectly extends base class '{1}':": { - "category": "Error", - "code": 2416 - }, "Class static side '{0}' incorrectly extends base class static side '{1}'.": { "category": "Error", "code": 2417 }, - "Class static side '{0}' incorrectly extends base class static side '{1}':": { - "category": "Error", - "code": 2418 - }, "Type name '{0}' in extends clause does not reference constructor function for '{0}'.": { "category": "Error", "code": 2419 @@ -948,10 +936,6 @@ "category": "Error", "code": 2420 }, - "Class '{0}' incorrectly implements interface '{1}':": { - "category": "Error", - "code": 2421 - }, "A class may only implement another class or interface.": { "category": "Error", "code": 2422 @@ -980,10 +964,6 @@ "category": "Error", "code": 2428 }, - "Interface '{0}' incorrectly extends interface '{1}':": { - "category": "Error", - "code": 2429 - }, "Interface '{0}' incorrectly extends interface '{1}'.": { "category": "Error", "code": 2430 @@ -1080,6 +1060,22 @@ "category": "Error", "code": 2452 }, + "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.": { + "category": "Error", + "code": 2453 + }, + "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'.": { + "category": "Error", + "code": 2455 + }, + "Type alias '{0}' circularly references itself.": { + "category": "Error", + "code": 2456 + }, + "Type alias name cannot be '{0}'": { + "category": "Error", + "code": 2457 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -1397,13 +1393,47 @@ "category": "Error", "code": 4078 }, - - + "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { + "category": "Error", + "code": 4079 + }, + "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'.": { + "category": "Error", + "code": 4080 + }, + "Exported type alias '{0}' has or is using private name '{1}'.": { + "category": "Error", + "code": 4081 + }, + "Enum declarations must all be const or non-const.": { + "category": "Error", + "code": 4082 + }, + "In 'const' enum declarations member initializer must be constant expression.": { + "category": "Error", + "code": 4083, + "isEarly": true + }, + "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.": { + "category": "Error", + "code": 4084 + }, + "Index expression arguments in 'const' enums must be of type 'string'.": { + "category": "Error", + "code": 4085 + }, + "'const' enum member initializer was evaluated to a non-finite value.": { + "category": "Error", + "code": 4086 + }, + "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { + "category": "Error", + "code": 4087 + }, "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 }, - "Cannot find the common subdirectory path for the input files.": { "category": "Error", "code": 5009 @@ -1456,10 +1486,14 @@ "category": "Message", "code": 6006 }, - "Do not emit outputs if any type checking errors were reported.": { + "Do not erase const enum declarations in generated code.": { "category": "Message", "code": 6007 }, + "Do not emit outputs if any type checking errors were reported.": { + "category": "Message", + "code": 6008 + }, "Do not emit comments to output.": { "category": "Message", "code": 6009 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 3ce39b95127..00d958604c7 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -86,8 +86,9 @@ module ts { var getAccessor: AccessorDeclaration; var setAccessor: AccessorDeclaration; forEach(node.members, (member: Declaration) => { + // TODO(jfreeman): Handle computed names for accessor matching if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) && - member.name.text === accessor.name.text && + (member.name).text === (accessor.name).text && (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { if (!firstAccessor) { firstAccessor = member; @@ -138,7 +139,7 @@ module ts { function writeLiteral(s: string) { if (s && s.length) { write(s); - var lineStartsOfS = getLineStarts(s); + var lineStartsOfS = computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; @@ -577,7 +578,8 @@ module ts { node.kind === SyntaxKind.EnumDeclaration) { // Declaration and has associated name use it if ((node).name) { - scopeName = (node).name.text; + // TODO(jfreeman): Ask shkamat about what this name should be for source maps + scopeName = ((node).name).text; } recordScopeNameStart(scopeName); } @@ -786,27 +788,136 @@ module ts { } } - function emitLiteral(node: LiteralExpression) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === SyntaxKind.StringLiteral && compilerOptions.sourceMap) { + function emitLiteral(node: LiteralExpression): void { + var text = getLiteralText(); + + if (compilerOptions.sourceMap && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + + function getLiteralText() { + if (compilerOptions.target < ScriptTarget.ES6 && isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node) + } + + return getSourceTextOfLocalNode(node); + } + } + + function getTemplateLiteralAsStringLiteral(node: LiteralExpression): string { + return '"' + escapeString(node.text) + '"'; + } + + function emitTemplateExpression(node: TemplateExpression): void { + // In ES6 mode and above, we can simply emit each portion of a template in order, but in + // ES3 & ES5 we must convert the template expression into a series of string concatenations. + if (compilerOptions.target >= ScriptTarget.ES6) { + forEachChild(node, emit); + return; + } + + Debug.assert(node.parent.kind !== SyntaxKind.TaggedTemplateExpression); + + var templateNeedsParens = isExpression(node.parent) + && node.parent.kind !== SyntaxKind.ParenExpression + && comparePrecedenceToBinaryPlus(node.parent) !== Comparison.LessThan; + + if (templateNeedsParens) { + write("("); + } + + emitLiteral(node.head); + + forEach(node.templateSpans, templateSpan => { + // Check if the expression has operands and binds its operands less closely than binary '+'. + // If it does, we need to wrap the expression in parentheses. Otherwise, something like + // `abc${ 1 << 2}` + // becomes + // "abc" + 1 << 2 + "" + // which is really + // ("abc" + 1) << (2 + "") + // rather than + // "abc" + (1 << 2) + "" + var needsParens = templateSpan.expression.kind !== SyntaxKind.ParenExpression + && comparePrecedenceToBinaryPlus(templateSpan.expression) !== Comparison.GreaterThan; + + write(" + "); + + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + + // Only emit if the literal is non-empty. + // The binary '+' operator is left-associative, so the first string concatenation will force + // the result up to this point to be a string. Emitting a '+ ""' has no semantic effect. + if (templateSpan.literal.text.length !== 0) { + write(" + ") + emitLiteral(templateSpan.literal); + } + }); + + if (templateNeedsParens) { + write(")"); + } + + /** + * Returns whether the expression has lesser, greater, + * or equal precedence to the binary '+' operator + */ + function comparePrecedenceToBinaryPlus(expression: Expression): Comparison { + // All binary expressions have lower precedence than '+' apart from '*', '/', and '%'. + // All unary operators have a higher precedence apart from yield. + // Arrow functions and conditionals have a lower precedence, + // although we convert the former into regular function expressions in ES5 mode, + // and in ES6 mode this function won't get called anyway. + // + // TODO (drosen): Note that we need to account for the upcoming 'yield' and + // spread ('...') unary operators that are anticipated for ES6. + Debug.assert(compilerOptions.target <= ScriptTarget.ES5); + switch (expression.kind) { + case SyntaxKind.BinaryExpression: + switch ((expression).operator) { + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + return Comparison.GreaterThan; + case SyntaxKind.PlusToken: + return Comparison.EqualTo; + default: + return Comparison.LessThan; + } + case SyntaxKind.ConditionalExpression: + return Comparison.LessThan; + default: + return Comparison.GreaterThan; + } + } + + } + + function emitTemplateSpan(span: TemplateSpan) { + emit(span.expression); + emit(span.literal); } // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. - function emitQuotedIdentifier(node: Identifier) { + function emitExpressionForPropertyName(node: DeclarationName) { if (node.kind === SyntaxKind.StringLiteral) { - emitLiteral(node); + emitLiteral(node); } else { write("\""); if (node.kind === SyntaxKind.NumericLiteral) { - write(node.text); + write((node).text); } else { write(getSourceTextOfLocalNode(node)); @@ -922,19 +1033,29 @@ module ts { emitTrailingComments(node); } - function emitPropertyAccess(node: PropertyAccess) { + function tryEmitConstantValue(node: PropertyAccess | IndexedAccess): boolean { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + identifierToString(node.right) + " */"); + var propertyName = node.kind === SyntaxKind.PropertyAccess ? declarationNameToString((node).right) : getTextOfNode((node).index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; } - else { - emit(node.left); - write("."); - emit(node.right); + return false; + } + + function emitPropertyAccess(node: PropertyAccess) { + if (tryEmitConstantValue(node)) { + return; } + emit(node.left); + write("."); + emit(node.right); } function emitIndexedAccess(node: IndexedAccess) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -977,6 +1098,13 @@ module ts { } } + function emitTaggedTemplateExpression(node: TaggedTemplateExpression): void { + Debug.assert(compilerOptions.target >= ScriptTarget.ES6, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } + function emitParenExpression(node: ParenExpression) { if (node.expression.kind === SyntaxKind.TypeAssertion) { var operand = (node.expression).operand; @@ -1225,6 +1353,10 @@ module ts { emitToken(SyntaxKind.CloseBraceToken, node.clauses.end); } + function isOnSameLine(node1: Node, node2: Node) { + return getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node2.pos)); + } + function emitCaseOrDefaultClause(node: CaseOrDefaultClause) { if (node.kind === SyntaxKind.CaseClause) { write("case "); @@ -1234,9 +1366,16 @@ module ts { else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node: ThrowStatement) { @@ -1327,7 +1466,7 @@ module ts { emitTrailingComments(node); } - function emitDefaultValueAssignments(node: FunctionDeclaration) { + function emitDefaultValueAssignments(node: FunctionLikeDeclaration) { forEach(node.parameters, param => { if (param.initializer) { writeLine(); @@ -1347,7 +1486,7 @@ module ts { }); } - function emitRestParameter(node: FunctionDeclaration) { + function emitRestParameter(node: FunctionLikeDeclaration) { if (hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; @@ -1393,7 +1532,7 @@ module ts { emitTrailingComments(node); } - function emitFunctionDeclaration(node: FunctionDeclaration) { + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { if (!node.body) { return emitPinnedOrTripleSlashComments(node); } @@ -1421,7 +1560,7 @@ module ts { } } - function emitSignatureParameters(node: FunctionDeclaration) { + function emitSignatureParameters(node: FunctionLikeDeclaration) { increaseIndent(); write("("); if (node) { @@ -1431,7 +1570,7 @@ module ts { decreaseIndent(); } - function emitSignatureAndBody(node: FunctionDeclaration) { + function emitSignatureAndBody(node: FunctionLikeDeclaration) { emitSignatureParameters(node); write(" {"); scopeEmitStart(node); @@ -1528,7 +1667,8 @@ module ts { }); } - function emitMemberAccess(memberName: Identifier) { + // TODO(jfreeman): Account for computed property name + function emitMemberAccess(memberName: DeclarationName) { if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { write("["); emitNode(memberName); @@ -1601,7 +1741,7 @@ module ts { write(".prototype"); } write(", "); - emitQuotedIdentifier((member).name); + emitExpressionForPropertyName((member).name); emitEnd((member).name); write(", {"); increaseIndent(); @@ -1760,6 +1900,11 @@ module ts { } function emitEnumDeclaration(node: EnumDeclaration) { + // const enums are completely erased during compilation. + var isConstEnum = isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & NodeFlags.Export)) { emitStart(node); @@ -1777,7 +1922,7 @@ module ts { write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); emitToken(SyntaxKind.CloseBraceToken, node.members.end); @@ -1800,7 +1945,7 @@ module ts { } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum: boolean) { forEach(node.members, member => { writeLine(); emitLeadingComments(member); @@ -1809,16 +1954,16 @@ module ts { write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -1834,7 +1979,7 @@ module ts { } function emitModuleDeclaration(node: ModuleDeclaration) { - if (!isInstantiated(node)) { + if (getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -1886,7 +2031,7 @@ module ts { // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when // - current file is not external module // - import declaration is top level and target is value imported by entity name - emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { @@ -1930,7 +2075,10 @@ module ts { function getExternalImportDeclarations(node: SourceFile): ImportDeclaration[] { var result: ImportDeclaration[] = []; forEach(node.statements, stat => { - if (stat.kind === SyntaxKind.ImportDeclaration && (stat).externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === SyntaxKind.ImportDeclaration + && (stat).externalModuleName + && resolver.isReferencedImportDeclaration(stat)) { + result.push(stat); } }); @@ -2085,7 +2233,15 @@ module ts { case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: return emitLiteral(node); + case SyntaxKind.TemplateExpression: + return emitTemplateExpression(node); + case SyntaxKind.TemplateSpan: + return emitTemplateSpan(node); case SyntaxKind.QualifiedName: return emitPropertyAccess(node); case SyntaxKind.ArrayLiteral: @@ -2102,6 +2258,8 @@ module ts { return emitCallExpression(node); case SyntaxKind.NewExpression: return emitNewExpression(node); + case SyntaxKind.TaggedTemplateExpression: + return emitTaggedTemplateExpression(node); case SyntaxKind.TypeAssertion: return emit((node).operand); case SyntaxKind.ParenExpression: @@ -2109,7 +2267,7 @@ module ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - return emitFunctionDeclaration(node); + return emitFunctionDeclaration(node); case SyntaxKind.PrefixOperator: case SyntaxKind.PostfixOperator: return emitUnaryExpression(node); @@ -2352,7 +2510,7 @@ module ts { var getSymbolVisibilityDiagnosticMessage: (symbolAccesibilityResult: SymbolAccessiblityResult) => { errorNode: Node; diagnosticMessage: DiagnosticMessage; - typeName?: Identifier + typeName?: DeclarationName } function createTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { @@ -2566,10 +2724,39 @@ module ts { } } + function emitTypeAliasDeclaration(node: TypeAliasDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitDeclarationFlags(node); + write("type "); + emitSourceTextOfNode(node.name); + write(" = "); + getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; + resolver.writeTypeAtLocation(node.type, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; + return { + diagnosticMessage: diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } + function emitEnumDeclaration(node: EnumDeclaration) { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (isConstEnumDeclaration(node)) { + write("const ") + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -2649,7 +2836,7 @@ module ts { break; default: - Debug.fail("This is unknown parent for type parameter: " + SyntaxKind[node.parent.kind]); + Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { @@ -2785,11 +2972,12 @@ module ts { function emitPropertyDeclaration(node: PropertyDeclaration) { emitJsDocComments(node); emitDeclarationFlags(node); - emitVariableDeclaration(node); + emitVariableDeclaration(node); write(";"); writeLine(); } + // TODO(jfreeman): Factor out common part of property definition, but treat name differently function emitVariableDeclaration(node: VariableDeclaration) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible @@ -2817,6 +3005,7 @@ module ts { } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit else if (node.kind === SyntaxKind.Property) { + // TODO(jfreeman): Deal with computed properties in error reporting. if (node.flags & NodeFlags.Static) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? @@ -2900,6 +3089,7 @@ module ts { return { diagnosticMessage: diagnosticMessage, errorNode: node.parameters[0], + // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name typeName: node.name }; } @@ -2927,7 +3117,7 @@ module ts { } } - function emitFunctionDeclaration(node: FunctionDeclaration) { + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting // so no need to verify if the declaration is visible if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) && @@ -3045,7 +3235,7 @@ module ts { break; default: - Debug.fail("This is unknown kind for signature: " + SyntaxKind[node.kind]); + Debug.fail("This is unknown kind for signature: " + node.kind); } return { @@ -3130,7 +3320,7 @@ module ts { break; default: - Debug.fail("This is unknown parent for parameter: " + SyntaxKind[node.parent.kind]); + Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { @@ -3146,7 +3336,7 @@ module ts { case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: case SyntaxKind.Method: - return emitFunctionDeclaration(node); + return emitFunctionDeclaration(node); case SyntaxKind.ConstructSignature: return emitConstructSignatureDeclaration(node); case SyntaxKind.CallSignature: @@ -3163,6 +3353,8 @@ module ts { return emitInterfaceDeclaration(node); case SyntaxKind.ClassDeclaration: return emitClassDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return emitTypeAliasDeclaration(node); case SyntaxKind.EnumMember: return emitEnumMemberDeclaration(node); case SyntaxKind.EnumDeclaration: diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 15383a0031b..9cb61feeea6 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -34,12 +34,16 @@ module ts { return file.filename + "(" + loc.line + "," + loc.character + ")"; } - export function getStartPosOfNode(node: Node): number { return node.pos; } export function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number { + // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* + // want to skip trivia because this will launch us forward to the next token. + if (node.pos === node.end) { + return node.pos; + } return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } @@ -62,80 +66,10 @@ module ts { return identifier.length >= 3 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ && identifier.charCodeAt(2) === CharacterCodes._ ? identifier.substr(1) : identifier; } + // TODO(jfreeman): Implement declarationNameToString for computed properties // Return display name of an identifier - export function identifierToString(identifier: Identifier) { - return identifier.kind === SyntaxKind.Missing ? "(Missing)" : getTextOfNode(identifier); - } - - export function isExpression(node: Node): boolean { - switch (node.kind) { - case SyntaxKind.ThisKeyword: - case SyntaxKind.SuperKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.FalseKeyword: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.ArrayLiteral: - case SyntaxKind.ObjectLiteral: - case SyntaxKind.PropertyAccess: - case SyntaxKind.IndexedAccess: - case SyntaxKind.CallExpression: - case SyntaxKind.NewExpression: - case SyntaxKind.TypeAssertion: - case SyntaxKind.ParenExpression: - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.PrefixOperator: - case SyntaxKind.PostfixOperator: - case SyntaxKind.BinaryExpression: - case SyntaxKind.ConditionalExpression: - case SyntaxKind.OmittedExpression: - return true; - case SyntaxKind.QualifiedName: - while (node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; - return node.parent.kind === SyntaxKind.TypeQuery; - case SyntaxKind.Identifier: - if (node.parent.kind === SyntaxKind.TypeQuery) { - return true; - } - // Fall through - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - var parent = node.parent; - switch (parent.kind) { - case SyntaxKind.VariableDeclaration: - case SyntaxKind.Parameter: - case SyntaxKind.Property: - case SyntaxKind.EnumMember: - case SyntaxKind.PropertyAssignment: - return (parent).initializer === node; - case SyntaxKind.ExpressionStatement: - case SyntaxKind.IfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.ReturnStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.SwitchStatement: - case SyntaxKind.CaseClause: - case SyntaxKind.ThrowStatement: - case SyntaxKind.SwitchStatement: - return (parent).expression === node; - case SyntaxKind.ForStatement: - return (parent).initializer === node || - (parent).condition === node || - (parent).iterator === node; - case SyntaxKind.ForInStatement: - return (parent).variable === node || - (parent).expression === node; - case SyntaxKind.TypeAssertion: - return node === (parent).operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; + export function declarationNameToString(name: DeclarationName) { + return name.kind === SyntaxKind.Missing ? "(Missing)" : getTextOfNode(name); } export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic { @@ -186,6 +120,10 @@ module ts { return (file.flags & NodeFlags.DeclarationFile) !== 0; } + export function isConstEnumDeclaration(node: EnumDeclaration): boolean { + return (node.flags & NodeFlags.Const) !== 0; + } + export function isPrologueDirective(node: Node): boolean { return node.kind === SyntaxKind.ExpressionStatement && (node).expression.kind === SyntaxKind.StringLiteral; } @@ -267,6 +205,8 @@ module ts { return child((node).name) || child((node).type) || child((node).initializer); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -280,11 +220,11 @@ module ts { case SyntaxKind.FunctionExpression: case SyntaxKind.FunctionDeclaration: case SyntaxKind.ArrowFunction: - return child((node).name) || - children((node).typeParameters) || - children((node).parameters) || - child((node).type) || - child((node).body); + return child((node).name) || + children((node).typeParameters) || + children((node).parameters) || + child((node).type) || + child((node).body); case SyntaxKind.TypeReference: return child((node).typeName) || children((node).typeArguments); @@ -315,6 +255,9 @@ module ts { return child((node).func) || children((node).typeArguments) || children((node).arguments); + case SyntaxKind.TaggedTemplateExpression: + return child((node).tag) || + child((node).template); case SyntaxKind.TypeAssertion: return child((node).type) || child((node).operand); @@ -404,6 +347,9 @@ module ts { children((node).typeParameters) || children((node).baseTypes) || children((node).members); + case SyntaxKind.TypeAliasDeclaration: + return child((node).name) || + child((node).type); case SyntaxKind.EnumDeclaration: return child((node).name) || children((node).members); @@ -419,6 +365,10 @@ module ts { child((node).externalModuleName); case SyntaxKind.ExportAssignment: return child((node).exportName); + case SyntaxKind.TemplateExpression: + return child((node).head) || children((node).templateSpans); + case SyntaxKind.TemplateSpan: + return child((node).expression) || child((node).literal); } } @@ -523,10 +473,98 @@ module ts { } } + export function isExpression(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.ThisKeyword: + case SyntaxKind.SuperKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.TypeAssertion: + case SyntaxKind.ParenExpression: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.PrefixOperator: + case SyntaxKind.PostfixOperator: + case SyntaxKind.BinaryExpression: + case SyntaxKind.ConditionalExpression: + case SyntaxKind.TemplateExpression: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.OmittedExpression: + return true; + case SyntaxKind.QualifiedName: + while (node.parent.kind === SyntaxKind.QualifiedName) node = node.parent; + return node.parent.kind === SyntaxKind.TypeQuery; + case SyntaxKind.Identifier: + if (node.parent.kind === SyntaxKind.TypeQuery) { + return true; + } + // fall through + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + var parent = node.parent; + switch (parent.kind) { + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Parameter: + case SyntaxKind.Property: + case SyntaxKind.EnumMember: + case SyntaxKind.PropertyAssignment: + return (parent).initializer === node; + case SyntaxKind.ExpressionStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.CaseClause: + case SyntaxKind.ThrowStatement: + case SyntaxKind.SwitchStatement: + return (parent).expression === node; + case SyntaxKind.ForStatement: + return (parent).initializer === node || + (parent).condition === node || + (parent).iterator === node; + case SyntaxKind.ForInStatement: + return (parent).variable === node || + (parent).expression === node; + case SyntaxKind.TypeAssertion: + return node === (parent).operand; + case SyntaxKind.TemplateSpan: + return node === (parent).expression; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + export function hasRestParameters(s: SignatureDeclaration): boolean { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & NodeFlags.Rest) !== 0; } + export function isLiteralKind(kind: SyntaxKind): boolean { + return SyntaxKind.FirstLiteralToken <= kind && kind <= SyntaxKind.LastLiteralToken; + } + + export function isTextualLiteralKind(kind: SyntaxKind): boolean { + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NoSubstitutionTemplateLiteral; + } + + export function isTemplateLiteralKind(kind: SyntaxKind): boolean { + return SyntaxKind.FirstTemplateToken <= kind && kind <= SyntaxKind.LastTemplateToken; + } + export function isInAmbientContext(node: Node): boolean { while (node) { if (node.flags & (NodeFlags.Ambient | NodeFlags.DeclarationFile)) return true; @@ -549,6 +587,7 @@ module ts { case SyntaxKind.SetAccessor: case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: @@ -611,6 +650,7 @@ module ts { return node; case SyntaxKind.EnumDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: // early exit cases - declarations cannot be nested in classes @@ -634,7 +674,7 @@ module ts { return undefined; } - enum ParsingContext { + const enum ParsingContext { SourceElements, // Elements in source file ModuleElements, // Elements in module declaration BlockStatements, // Statements in block @@ -655,7 +695,7 @@ module ts { Count // Number of parsing contexts } - enum Tristate { + const enum Tristate { False, True, Unknown @@ -683,13 +723,13 @@ module ts { } }; - enum LookAheadMode { + const enum LookAheadMode { NotLookingAhead, NoErrorYet, Error } - enum ModifierContext { + const enum ModifierContext { SourceElements, // Top level elements in a source file ModuleElements, // Elements in module declaration ClassMembers, // Members in class declaration @@ -698,7 +738,7 @@ module ts { // Tracks whether we nested (directly or indirectly) in a certain control block. // Used for validating break and continue statements. - enum ControlBlockContext { + const enum ControlBlockContext { NotNested, Nested, CrossingFunctionBoundary @@ -712,6 +752,47 @@ module ts { nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext; } + export interface ReferencePathMatchResult { + fileReference?: FileReference + diagnostic?: DiagnosticMessage + isNoDefaultLib?: boolean + } + + export function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.exec(comment)) { + if (isNoDefaultLibRegEx.exec(comment)) { + return { + isNoDefaultLib: true + } + } + else { + var matchResult = fullTripleSlashReferencePathRegEx.exec(comment); + if (matchResult) { + var start = commentRange.pos; + var end = commentRange.end; + var fileRef = { + pos: start, + end: end, + filename: matchResult[3] + }; + return { + fileReference: fileRef, + isNoDefaultLib: false + }; + } + else { + return { + diagnostic: Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + } + return undefined; + } + export function isKeyword(token: SyntaxKind): boolean { return SyntaxKind.FirstKeyword <= token && token <= SyntaxKind.LastKeyword; } @@ -720,6 +801,20 @@ module ts { return SyntaxKind.FirstTriviaToken <= token && token <= SyntaxKind.LastTriviaToken; } + export function isUnterminatedTemplateEnd(node: LiteralExpression) { + Debug.assert(node.kind === SyntaxKind.NoSubstitutionTemplateLiteral || node.kind === SyntaxKind.TemplateTail); + var sourceText = getSourceFileOfNode(node).text; + + // If we're not at the EOF, we know we must be terminated. + if (node.end !== sourceText.length) { + return false; + } + + // If we didn't end in a backtick, we must still be in the middle of a template. + // If we did, make sure that it's not the *initial* backtick. + return sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick || node.text.length === 0; + } + export function isModifier(token: SyntaxKind): boolean { switch (token) { case SyntaxKind.PublicKeyword: @@ -855,18 +950,16 @@ module ts { }; })(); - function getLineAndCharacterlFromSourcePosition(position: number) { - if (!lineStarts) { - lineStarts = getLineStarts(sourceText); - } - return getLineAndCharacterOfPosition(lineStarts, position); + function getLineStarts(): number[] { + return lineStarts || (lineStarts = computeLineStarts(sourceText)); + } + + function getLineAndCharacterFromSourcePosition(position: number) { + return getLineAndCharacterOfPosition(getLineStarts(), position); } function getPositionFromSourceLineAndCharacter(line: number, character: number): number { - if (!lineStarts) { - lineStarts = getLineStarts(sourceText); - } - return getPositionFromLineAndCharacter(lineStarts, line, character); + return getPositionFromLineAndCharacter(getLineStarts(), line, character); } function error(message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { @@ -894,7 +987,7 @@ module ts { } function reportInvalidUseInStrictMode(node: Identifier): void { - // identifierToString cannot be used here since it uses a backreference to 'parent' that is not yet set + // declarationNameToString cannot be used here since it uses a backreference to 'parent' that is not yet set var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end); grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name); } @@ -909,7 +1002,9 @@ module ts { ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; if (start !== lastErrorPos) { - file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + var diagnostic = createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + diagnostic.isParseError = true; + file.syntacticErrors.push(diagnostic); } if (lookAheadMode === LookAheadMode.NoErrorYet) { @@ -950,6 +1045,10 @@ module ts { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken(): SyntaxKind { + return token = scanner.reScanTemplateToken(); + } + function lookAheadHelper(callback: () => T, alwaysResetState: boolean): T { // Keep track of the state we'll need to rollback to if lookahead fails (or if the // caller asked us to always reset our state). @@ -1065,6 +1164,7 @@ module ts { } function internIdentifier(text: string): string { + text = escapeIdentifier(text); return hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } @@ -1075,13 +1175,11 @@ module ts { identifierCount++; if (isIdentifier) { var node = createNode(SyntaxKind.Identifier); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = internIdentifier(text); + node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } error(Diagnostics.Identifier_expected); - var node = createMissingNode(); node.text = ""; return node; @@ -1096,7 +1194,9 @@ module ts { } function isPropertyName(): boolean { - return token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral; + return token >= SyntaxKind.Identifier || + token === SyntaxKind.StringLiteral || + token === SyntaxKind.NumericLiteral; } function parsePropertyName(): Identifier { @@ -1132,7 +1232,7 @@ module ts { case ParsingContext.SwitchClauses: return token === SyntaxKind.CaseKeyword || token === SyntaxKind.DefaultKeyword; case ParsingContext.TypeMembers: - return isTypeMember(); + return isStartOfTypeMember(); case ParsingContext.ClassMembers: return lookAhead(isClassMemberStart); case ParsingContext.EnumMembers: @@ -1144,14 +1244,14 @@ module ts { case ParsingContext.TypeParameters: return isIdentifier(); case ParsingContext.ArgumentExpressions: - return token === SyntaxKind.CommaToken || isExpression(); + return token === SyntaxKind.CommaToken || isStartOfExpression(); case ParsingContext.ArrayLiteralMembers: - return token === SyntaxKind.CommaToken || isExpression(); + return token === SyntaxKind.CommaToken || isStartOfExpression(); case ParsingContext.Parameters: - return isParameter(); + return isStartOfParameter(); case ParsingContext.TypeArguments: case ParsingContext.TupleElementTypes: - return token === SyntaxKind.CommaToken || isType(); + return token === SyntaxKind.CommaToken || isStartOfType(); } Debug.fail("Non-exhaustive case in 'isListElement'."); @@ -1371,7 +1471,48 @@ module ts { return finishNode(node); } - function parseLiteralNode(internName?:boolean): LiteralExpression { + function parseTemplateExpression() { + var template = createNode(SyntaxKind.TemplateExpression); + + template.head = parseLiteralNode(); + Debug.assert(template.head.kind === SyntaxKind.TemplateHead, "Template head has wrong token kind"); + + var templateSpans = >[]; + templateSpans.pos = getNodePos(); + + do { + templateSpans.push(parseTemplateSpan()); + } + while (templateSpans[templateSpans.length - 1].literal.kind === SyntaxKind.TemplateMiddle) + + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + + return finishNode(template); + } + + function parseTemplateSpan(): TemplateSpan { + var span = createNode(SyntaxKind.TemplateSpan); + span.expression = parseExpression(/*noIn*/ false); + + var literal: LiteralExpression; + + if (token === SyntaxKind.CloseBraceToken) { + reScanTemplateToken() + literal = parseLiteralNode(); + } + else { + error(Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + + span.literal = literal; + + return finishNode(span); + } + + function parseLiteralNode(internName?: boolean): LiteralExpression { var node = createNode(token); var text = scanner.getTokenValue(); node.text = internName ? internIdentifier(text) : text; @@ -1383,7 +1524,7 @@ module ts { // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal.But because of how the scanner separates the tokens, we would - // never get a token like this.Instead, we would get 00 and 9 as two separate tokens. + // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. if (node.kind === SyntaxKind.NumericLiteral @@ -1402,7 +1543,9 @@ module ts { } function parseStringLiteral(): LiteralExpression { - if (token === SyntaxKind.StringLiteral) return parseLiteralNode(/*internName:*/ true); + if (token === SyntaxKind.StringLiteral) { + return parseLiteralNode(/*internName:*/ true); + } error(Diagnostics.String_literal_expected); return createMissingNode(); } @@ -1433,7 +1576,7 @@ module ts { // user writes a constraint that is an expression and not an actual type, then parse // it out as an expression (so we can recover well), but report that a type is needed // instead. - if (isType() || !isExpression()) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { @@ -1469,7 +1612,7 @@ module ts { return parseOptional(SyntaxKind.ColonToken) ? token === SyntaxKind.StringLiteral ? parseStringLiteral() : parseType() : undefined; } - function isParameter(): boolean { + function isStartOfParameter(): boolean { return token === SyntaxKind.DotDotDotToken || isIdentifier() || isModifier(token); } @@ -1551,7 +1694,7 @@ module ts { // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code // or if its FunctionBody is strict code(11.1.5). // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionDeclaration or FunctionExpression(13.1) + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { reportInvalidUseInStrictMode(parameter.name); return; @@ -1677,7 +1820,7 @@ module ts { return finishNode(node); } - function isTypeMember(): boolean { + function isStartOfTypeMember(): boolean { switch (token) { case SyntaxKind.OpenParenToken: case SyntaxKind.LessThanToken: @@ -1741,16 +1884,16 @@ module ts { return finishNode(node); } - function parseFunctionType(signatureKind: SyntaxKind): TypeLiteralNode { - var node = createNode(SyntaxKind.TypeLiteral); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, SyntaxKind.EqualsGreaterThanToken, /* returnTokenRequired */ true); + function parseFunctionType(typeKind: SyntaxKind): SignatureDeclaration { + var member = createNode(typeKind); + var sig = parseSignature(typeKind === SyntaxKind.FunctionType ? SyntaxKind.CallSignature : SyntaxKind.ConstructSignature, + SyntaxKind.EqualsGreaterThanToken, /* returnTokenRequired */ true); + member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); + return member; } function parseKeywordAndNoDot(): Node { @@ -1784,7 +1927,7 @@ module ts { return createMissingNode(); } - function isType(): boolean { + function isStartOfType(): boolean { switch (token) { case SyntaxKind.AnyKeyword: case SyntaxKind.StringKeyword: @@ -1802,7 +1945,7 @@ module ts { // or something that starts a type. We don't want to consider things like '(1)' a type. return lookAhead(() => { nextToken(); - return token === SyntaxKind.CloseParenToken || isParameter() || isType(); + return token === SyntaxKind.CloseParenToken || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); @@ -1836,7 +1979,7 @@ module ts { return type; } - function isFunctionType(): boolean { + function isStartOfFunctionType(): boolean { return token === SyntaxKind.LessThanToken || token === SyntaxKind.OpenParenToken && lookAhead(() => { nextToken(); if (token === SyntaxKind.CloseParenToken || token === SyntaxKind.DotDotDotToken) { @@ -1869,11 +2012,11 @@ module ts { } function parseType(): TypeNode { - if (isFunctionType()) { - return parseFunctionType(SyntaxKind.CallSignature); + if (isStartOfFunctionType()) { + return parseFunctionType(SyntaxKind.FunctionType); } if (token === SyntaxKind.NewKeyword) { - return parseFunctionType(SyntaxKind.ConstructSignature); + return parseFunctionType(SyntaxKind.ConstructorType); } return parseUnionType(); } @@ -1884,7 +2027,7 @@ module ts { // EXPRESSIONS - function isExpression(): boolean { + function isStartOfExpression(): boolean { switch (token) { case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: @@ -1893,6 +2036,8 @@ module ts { case SyntaxKind.FalseKeyword: case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateHead: case SyntaxKind.OpenParenToken: case SyntaxKind.OpenBracketToken: case SyntaxKind.OpenBraceToken: @@ -1917,9 +2062,9 @@ module ts { } } - function isExpressionStatement(): boolean { + function isStartOfExpressionStatement(): boolean { // As per the grammar, neither '{' nor 'function' can start an expression statement. - return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && isExpression(); + return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && isStartOfExpression(); } function parseExpression(noIn?: boolean): Expression { @@ -1940,7 +2085,7 @@ module ts { // it's more likely that a { would be a allowed (as an object literal). While this // is also allowed for parameters, the risk is that we consume the { as an object // literal when it really will be for the block following the parameter. - if (scanner.hasPrecedingLineBreak() || (inParameter && token === SyntaxKind.OpenBraceToken) || !isExpression()) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === SyntaxKind.OpenBraceToken) || !isStartOfExpression()) { // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - // do not try to parse initializer return undefined; @@ -1984,8 +2129,8 @@ module ts { } // Now see if we might be in cases '2' or '3'. - // If the expression was a LHS expression, and we have an assignment operator, then - // we're in '2' or '3'. Consume the assignment and return. + // If the expression was a LHS expression, and we have an assignment operator, then + // we're in '2' or '3'. Consume the assignment and return. if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an @@ -2008,6 +2153,7 @@ module ts { case SyntaxKind.IndexedAccess: case SyntaxKind.NewExpression: case SyntaxKind.CallExpression: + case SyntaxKind.TaggedTemplateExpression: case SyntaxKind.ArrayLiteral: case SyntaxKind.ParenExpression: case SyntaxKind.ObjectLiteral: @@ -2017,6 +2163,8 @@ module ts { case SyntaxKind.RegularExpressionLiteral: case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateExpression: case SyntaxKind.FalseKeyword: case SyntaxKind.NullKeyword: case SyntaxKind.ThisKeyword: @@ -2185,7 +2333,7 @@ module ts { if (token === SyntaxKind.OpenBraceToken) { body = parseBody(/* ignoreMissingOpenBrace */ false); } - else if (isStatement(/* inErrorRecovery */ true) && !isExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { + else if (isStatement(/* inErrorRecovery */ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) // // Here we try to recover from a potential error situation in the case where the @@ -2372,7 +2520,7 @@ module ts { function parseCallAndAccess(expr: Expression, inNewExpression: boolean): Expression { while (true) { - var dotStart = scanner.getTokenPos(); + var dotOrBracketStart = scanner.getTokenPos(); if (parseOptional(SyntaxKind.DotToken)) { var propertyAccess = createNode(SyntaxKind.PropertyAccess, expr.pos); // Technically a keyword is valid here as all keywords are identifier names. @@ -2395,7 +2543,7 @@ module ts { // In the first case though, ASI will not take effect because there is not a // line terminator after the keyword. if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(() => scanner.isReservedWord())) { - grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, Diagnostics.Identifier_expected); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.Identifier_expected); var id = createMissingNode(); } else { @@ -2408,7 +2556,6 @@ module ts { continue; } - var bracketStart = scanner.getTokenPos(); if (parseOptional(SyntaxKind.OpenBracketToken)) { var indexedAccess = createNode(SyntaxKind.IndexedAccess, expr.pos); @@ -2418,7 +2565,7 @@ module ts { // Check for that common pattern and report a better error message. if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); @@ -2451,6 +2598,22 @@ module ts { expr = finishNode(callExpr); continue; } + + if (token === SyntaxKind.NoSubstitutionTemplateLiteral || token === SyntaxKind.TemplateHead) { + var tagExpression = createNode(SyntaxKind.TaggedTemplateExpression, expr.pos); + tagExpression.tag = expr; + tagExpression.template = token === SyntaxKind.NoSubstitutionTemplateLiteral + ? parseLiteralNode() + : parseTemplateExpression(); + expr = finishNode(tagExpression); + + if (languageVersion < ScriptTarget.ES6) { + grammarErrorOnNode(expr, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + + continue; + } + return expr; } } @@ -2497,6 +2660,7 @@ module ts { return parseTokenNode(); case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: return parseLiteralNode(); case SyntaxKind.OpenParenToken: return parseParenExpression(); @@ -2514,6 +2678,9 @@ module ts { return parseLiteralNode(); } break; + case SyntaxKind.TemplateHead: + return parseTemplateExpression(); + default: if (isIdentifier()) { return parseIdentifier(); @@ -2608,9 +2775,13 @@ module ts { var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; forEach(node.properties, (p: Declaration) => { + // TODO(jfreeman): continue if we have a computed property if (p.kind === SyntaxKind.OmittedExpression) { return; } + + var name = p.name; + // ECMA-262 11.1.5 Object Initialiser // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true // a.This production is contained in strict code and IsDataDescriptor(previous) is true and @@ -2630,29 +2801,29 @@ module ts { currentKind = SetAccesor; } else { - Debug.fail("Unexpected syntax kind:" + SyntaxKind[p.kind]); + Debug.fail("Unexpected syntax kind:" + p.kind); } - if (!hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; + if (!hasProperty(seen, name.text)) { + seen[name.text] = currentKind; } else { - var existingKind = seen[p.name.text]; + var existingKind = seen[name.text]; if (currentKind === Property && existingKind === Property) { if (isInStrictMode) { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; + seen[name.text] = currentKind | existingKind; } else { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } }); @@ -2667,7 +2838,7 @@ module ts { var body = parseBody(/* ignoreMissingOpenBrace */ false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionDeclaration or FunctionExpression or as a formal parameter name(13.1) + // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) reportInvalidUseInStrictMode(name); } return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body); @@ -3146,7 +3317,6 @@ module ts { case SyntaxKind.OpenBraceToken: case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: - case SyntaxKind.ConstKeyword: case SyntaxKind.FunctionKeyword: case SyntaxKind.IfKeyword: case SyntaxKind.DoKeyword: @@ -3165,15 +3335,23 @@ module ts { case SyntaxKind.CatchKeyword: case SyntaxKind.FinallyKeyword: return true; + case SyntaxKind.ConstKeyword: + // const keyword can precede enum keyword when defining constant enums + // 'const enum' do not start statement. + // In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier + var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); + return !isConstEnum; case SyntaxKind.InterfaceKeyword: case SyntaxKind.ClassKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.EnumKeyword: + case SyntaxKind.TypeKeyword: // When followed by an identifier, these do not start a statement but might // instead be following declarations - if (isDeclaration()) { + if (isDeclarationStart()) { return false; } + case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: case SyntaxKind.ProtectedKeyword: @@ -3184,7 +3362,7 @@ module ts { return false; } default: - return isExpression(); + return isStartOfExpression(); } } @@ -3195,6 +3373,7 @@ module ts { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: case SyntaxKind.ConstKeyword: + // const here should always be parsed as const declaration because of check in 'isStatement' return parseVariableStatement(allowLetAndConstDeclarations); case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(); @@ -3325,8 +3504,8 @@ module ts { return node; } - function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionDeclaration { - var node = createNode(SyntaxKind.FunctionDeclaration, pos); + function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionLikeDeclaration { + var node = createNode(SyntaxKind.FunctionDeclaration, pos); if (flags) node.flags = flags; parseExpected(SyntaxKind.FunctionKeyword); node.name = parseIdentifier(); @@ -3335,10 +3514,10 @@ module ts { node.parameters = sig.parameters; node.type = sig.type; node.body = parseAndCheckFunctionBody(/*isConstructor*/ false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { + if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name) && node.name.kind === SyntaxKind.Identifier) { // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionDeclaration or FunctionExpression or as a formal parameter name(13.1) - reportInvalidUseInStrictMode(node.name); + // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) + reportInvalidUseInStrictMode(node.name); } return finishNode(node); } @@ -3455,7 +3634,7 @@ module ts { // A common error is to try to declare an accessor in an ambient class. if (inAmbientContext && canParseSemicolon()) { parseSemicolon(); - node.body = createMissingNode(); + node.body = createMissingNode(); } else { node.body = parseBody(/* ignoreMissingOpenBrace */ false); @@ -3746,8 +3925,20 @@ module ts { } return finishNode(node); } - + + function parseTypeAliasDeclaration(pos: number, flags: NodeFlags): TypeAliasDeclaration { + var node = createNode(SyntaxKind.TypeAliasDeclaration, pos); + node.flags = flags; + parseExpected(SyntaxKind.TypeKeyword); + node.name = parseIdentifier(); + parseExpected(SyntaxKind.EqualsToken); + node.type = parseType(); + parseSemicolon(); + return finishNode(node); + } + function parseAndCheckEnumDeclaration(pos: number, flags: NodeFlags): EnumDeclaration { + var enumIsConst = flags & NodeFlags.Const; function isIntegerLiteral(expression: Expression): boolean { function isInteger(literalExpression: LiteralExpression): boolean { // Allows for scientific notation since literalExpression.text was formed by @@ -3782,22 +3973,29 @@ module ts { node.name = parsePropertyName(); node.initializer = parseInitializer(/*inParameter*/ false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. + // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. + if (!enumIsConst) { + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { + grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer); } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer); } return finishNode(node); } var node = createNode(SyntaxKind.EnumDeclaration, pos); node.flags = flags; + if (enumIsConst) { + parseExpected(SyntaxKind.ConstKeyword); + } parseExpected(SyntaxKind.EnumKeyword); node.name = parseIdentifier(); if (parseExpected(SyntaxKind.OpenBraceToken)) { @@ -3897,7 +4095,7 @@ module ts { return finishNode(node); } - function isDeclaration(): boolean { + function isDeclarationStart(): boolean { switch (token) { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: @@ -3908,6 +4106,7 @@ module ts { case SyntaxKind.InterfaceKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.ImportKeyword: + case SyntaxKind.TypeKeyword: // Not true keywords so ensure an identifier follows return lookAhead(() => nextToken() >= SyntaxKind.Identifier); case SyntaxKind.ModuleKeyword: @@ -3915,14 +4114,14 @@ module ts { return lookAhead(() => nextToken() >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral); case SyntaxKind.ExportKeyword: // Check for export assignment or modifier on source element - return lookAhead(() => nextToken() === SyntaxKind.EqualsToken || isDeclaration()); + return lookAhead(() => nextToken() === SyntaxKind.EqualsToken || isDeclarationStart()); case SyntaxKind.DeclareKeyword: case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: // Check for modifier on source element - return lookAhead(() => { nextToken(); return isDeclaration(); }); + return lookAhead(() => { nextToken(); return isDeclarationStart(); }); } } @@ -3953,9 +4152,17 @@ module ts { switch (token) { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: - case SyntaxKind.ConstKeyword: result = parseVariableStatement(/*allowLetAndConstDeclarations*/ true, pos, flags); break; + case SyntaxKind.ConstKeyword: + var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | NodeFlags.Const); + } + else { + result = parseVariableStatement(/*allowLetAndConstDeclarations*/ true, pos, flags); + } + break; case SyntaxKind.FunctionKeyword: result = parseFunctionDeclaration(pos, flags); break; @@ -3965,6 +4172,9 @@ module ts { case SyntaxKind.InterfaceKeyword: result = parseInterfaceDeclaration(pos, flags); break; + case SyntaxKind.TypeKeyword: + result = parseTypeAliasDeclaration(pos, flags); + break; case SyntaxKind.EnumKeyword: result = parseAndCheckEnumDeclaration(pos, flags); break; @@ -3983,7 +4193,7 @@ module ts { } function isSourceElement(inErrorRecovery: boolean): boolean { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { @@ -3995,7 +4205,7 @@ module ts { } function parseSourceElementOrModuleElement(modifierContext: ModifierContext): Statement { - if (isDeclaration()) { + if (isDeclarationStart()) { return parseDeclaration(modifierContext); } @@ -4020,28 +4230,16 @@ module ts { for (var i = 0; i < commentRanges.length; i++) { var range = commentRanges[i]; var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); + if (referencePathMatchResult) { + var fileReference = referencePathMatchResult.fileReference; + file.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var diagnostic = referencePathMatchResult.diagnostic; + if (fileReference) { + referencedFiles.push(fileReference); } - else { - var matchResult = fullTripleSlashReferencePathRegEx.exec(comment); - var start = range.pos; - var end = range.end; - var length = end - start; - - if (!matchResult) { - errorAtPos(start, length, Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: start, - end: end, - filename: matchResult[3] - }); - } + if (diagnostic) { + errorAtPos(range.pos, range.end - range.pos, diagnostic); } } else { @@ -4077,8 +4275,9 @@ module ts { file = createRootNode(SyntaxKind.SourceFile, 0, sourceText.length, rootNodeFlags); file.filename = normalizePath(filename); file.text = sourceText; - file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; + file.getLineStarts = getLineStarts; file.syntacticErrors = []; file.semanticErrors = []; var referenceComments = processReferenceComments(); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 81d16b5f487..24ff3378d59 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -24,6 +24,7 @@ module ts { isReservedWord(): boolean; reScanGreaterToken(): SyntaxKind; reScanSlashToken(): SyntaxKind; + reScanTemplateToken(): SyntaxKind; scan(): SyntaxKind; setText(text: string): void; setTextPos(textPos: number): void; @@ -80,6 +81,7 @@ module ts { "throw": SyntaxKind.ThrowKeyword, "true": SyntaxKind.TrueKeyword, "try": SyntaxKind.TryKeyword, + "type": SyntaxKind.TypeKeyword, "typeof": SyntaxKind.TypeOfKeyword, "var": SyntaxKind.VarKeyword, "void": SyntaxKind.VoidKeyword, @@ -244,7 +246,7 @@ module ts { return tokenStrings[t]; } - export function getLineStarts(text: string): number[] { + export function computeLineStarts(text: string): number[] { var result: number[] = new Array(); var pos = 0; var lineStart = 0; @@ -292,7 +294,7 @@ module ts { } export function positionToLineAndCharacter(text: string, pos: number) { - var lineStarts = getLineStarts(text); + var lineStarts = computeLineStarts(text); return getLineAndCharacterOfPosition(lineStarts, pos); } @@ -465,7 +467,7 @@ module ts { var len: number; // Length of text var startPos: number; // Start position of whitespace before current token var tokenPos: number; // Start position of text of current token - var token: number; + var token: SyntaxKind; var tokenValue: string; var precedingLineBreak: boolean; @@ -518,10 +520,10 @@ module ts { return +(text.substring(start, pos)); } - function scanHexDigits(count: number, exact?: boolean): number { + function scanHexDigits(count: number, mustMatchCount?: boolean): number { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) { value = value * 16 + ch - CharacterCodes._0; @@ -562,60 +564,7 @@ module ts { } if (ch === CharacterCodes.backslash) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case CharacterCodes._0: - result += "\0"; - break; - case CharacterCodes.b: - result += "\b"; - break; - case CharacterCodes.t: - result += "\t"; - break; - case CharacterCodes.n: - result += "\n"; - break; - case CharacterCodes.v: - result += "\v"; - break; - case CharacterCodes.f: - result += "\f"; - break; - case CharacterCodes.r: - result += "\r"; - break; - case CharacterCodes.singleQuote: - result += "\'"; - break; - case CharacterCodes.doubleQuote: - result += "\""; - break; - case CharacterCodes.x: - case CharacterCodes.u: - var ch = scanHexDigits(ch === CharacterCodes.x ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(Diagnostics.Hexadecimal_digit_expected); - } - break; - case CharacterCodes.carriageReturn: - if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) pos++; - break; - case CharacterCodes.lineFeed: - case CharacterCodes.lineSeparator: - case CharacterCodes.paragraphSeparator: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -629,13 +578,136 @@ module ts { return result; } + /** + * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or + * a literal component of a TemplateExpression. + */ + function scanTemplateAndSetTokenValue(): SyntaxKind { + var startedWithBacktick = text.charCodeAt(pos) === CharacterCodes.backtick; + + pos++; + var start = pos; + var contents = "" + var resultingToken: SyntaxKind; + + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(Diagnostics.Unexpected_end_of_text); + resultingToken = startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateLiteral : SyntaxKind.TemplateTail; + break; + } + + var currChar = text.charCodeAt(pos); + + // '`' + if (currChar === CharacterCodes.backtick) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateLiteral : SyntaxKind.TemplateTail; + break; + } + + // '${' + if (currChar === CharacterCodes.$ && pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.openBrace) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? SyntaxKind.TemplateHead : SyntaxKind.TemplateMiddle; + break; + } + + // Escape character + if (currChar === CharacterCodes.backslash) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + + // Speculated ECMAScript 6 Spec 11.8.6.1: + // and LineTerminatorSequences are normalized to for Template Values + // An explicit EscapeSequence is needed to include a or sequence. + if (currChar === CharacterCodes.carriageReturn) { + contents += text.substring(start, pos); + + if (pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + + pos++; + } + + Debug.assert(resultingToken !== undefined); + + tokenValue = contents; + return resultingToken; + } + + function scanEscapeSequence(): string { + pos++; + if (pos >= len) { + error(Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case CharacterCodes._0: + return "\0"; + case CharacterCodes.b: + return "\b"; + case CharacterCodes.t: + return "\t"; + case CharacterCodes.n: + return "\n"; + case CharacterCodes.v: + return "\v"; + case CharacterCodes.f: + return "\f"; + case CharacterCodes.r: + return "\r"; + case CharacterCodes.singleQuote: + return "\'"; + case CharacterCodes.doubleQuote: + return "\""; + case CharacterCodes.x: + case CharacterCodes.u: + var ch = scanHexDigits(ch === CharacterCodes.x ? 2 : 4, /*mustMatchCount*/ true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(Diagnostics.Hexadecimal_digit_expected); + return "" + } + + // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), + // the line terminator is interpreted to be "the empty code unit sequence". + case CharacterCodes.carriageReturn: + if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) { + pos++; + } + // fall through + case CharacterCodes.lineFeed: + case CharacterCodes.lineSeparator: + case CharacterCodes.paragraphSeparator: + return "" + default: + return String.fromCharCode(ch); + } + } + // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' // and return code point value if valid Unicode escape is found. Otherwise return -1. function peekUnicodeEscape(): number { if (pos + 5 < len && text.charCodeAt(pos + 1) === CharacterCodes.u) { var start = pos; pos += 2; - var value = scanHexDigits(4, true); + var value = scanHexDigits(4, /*mustMatchCount*/ true); pos = start; return value; } @@ -734,6 +806,8 @@ module ts { case CharacterCodes.singleQuote: tokenValue = scanString(); return token = SyntaxKind.StringLiteral; + case CharacterCodes.backtick: + return token = scanTemplateAndSetTokenValue() case CharacterCodes.percent: if (text.charCodeAt(pos + 1) === CharacterCodes.equals) { return pos += 2, token = SyntaxKind.PercentEqualsToken; @@ -851,7 +925,7 @@ module ts { case CharacterCodes._0: if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) { pos += 2; - var value = scanHexDigits(1, false); + var value = scanHexDigits(1, /*mustMatchCount*/ false); if (value < 0) { error(Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -1037,6 +1111,15 @@ module ts { return token; } + /** + * Unconditionally back up and scan a template expression portion. + */ + function reScanTemplateToken(): SyntaxKind { + Debug.assert(token === SyntaxKind.CloseBraceToken, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } + function tryScan(callback: () => T): T { var savePos = pos; var saveStartPos = startPos; @@ -1085,10 +1168,11 @@ module ts { isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, scan: scan, setText: setText, setTextPos: setTextPos, - tryScan: tryScan + tryScan: tryScan, }; } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 694294d2d12..810b5a759e4 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1,5 +1,4 @@ /// -/// module ts { @@ -9,7 +8,7 @@ module ts { } // token > SyntaxKind.Identifer => token is a keyword - export enum SyntaxKind { + export const enum SyntaxKind { Unknown, EndOfFileToken, SingleLineCommentTrivia, @@ -20,6 +19,11 @@ module ts { NumericLiteral, StringLiteral, RegularExpressionLiteral, + NoSubstitutionTemplateLiteral, + // Pseudo-literals + TemplateHead, + TemplateMiddle, + TemplateTail, // Punctuation OpenBraceToken, CloseBraceToken, @@ -132,6 +136,7 @@ module ts { NumberKeyword, SetKeyword, StringKeyword, + TypeKeyword, // Parse tree nodes Missing, // Names @@ -150,6 +155,8 @@ module ts { IndexSignature, // Type TypeReference, + FunctionType, + ConstructorType, TypeQuery, TypeLiteral, ArrayType, @@ -164,6 +171,7 @@ module ts { IndexedAccess, CallExpression, NewExpression, + TaggedTemplateExpression, TypeAssertion, ParenExpression, FunctionExpression, @@ -172,6 +180,8 @@ module ts { PostfixOperator, BinaryExpression, ConditionalExpression, + TemplateExpression, + TemplateSpan, OmittedExpression, // Element Block, @@ -202,6 +212,7 @@ module ts { FunctionBlock, ClassDeclaration, InterfaceDeclaration, + TypeAliasDeclaration, EnumDeclaration, ModuleDeclaration, ModuleBlock, @@ -222,7 +233,7 @@ module ts { FirstReservedWord = BreakKeyword, LastReservedWord = WithKeyword, FirstKeyword = BreakKeyword, - LastKeyword = StringKeyword, + LastKeyword = TypeKeyword, FirstFutureReservedWord = ImplementsKeyword, LastFutureReservedWord = YieldKeyword, FirstTypeNode = TypeReference, @@ -230,12 +241,20 @@ module ts { FirstPunctuation = OpenBraceToken, LastPunctuation = CaretEqualsToken, FirstToken = EndOfFileToken, - LastToken = StringKeyword, + LastToken = TypeKeyword, FirstTriviaToken = SingleLineCommentTrivia, - LastTriviaToken = WhitespaceTrivia + LastTriviaToken = WhitespaceTrivia, + FirstLiteralToken = NumericLiteral, + LastLiteralToken = NoSubstitutionTemplateLiteral, + FirstTemplateToken = NoSubstitutionTemplateLiteral, + LastTemplateToken = TemplateTail, + FirstOperator = SemicolonToken, + LastOperator = CaretEqualsToken, + FirstBinaryOperator = LessThanToken, + LastBinaryOperator = CaretEqualsToken } - export enum NodeFlags { + export const enum NodeFlags { Export = 0x00000001, // Declarations Ambient = 0x00000002, // Declarations QuestionMark = 0x00000004, // Parameter/Property/Method @@ -280,9 +299,7 @@ module ts { right: Identifier; } - export interface EntityName extends Node { - // Identifier, QualifiedName, or Missing - } + export type EntityName = Identifier | QualifiedName; export interface ParsedSignature { typeParameters?: NodeArray; @@ -290,34 +307,66 @@ module ts { type?: TypeNode; } + export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName; + export interface Declaration extends Node { - name?: Identifier; + name?: DeclarationName; + } + + export interface ComputedPropertyName extends Node { + expression: Expression; } export interface TypeParameterDeclaration extends Declaration { + name: Identifier; constraint?: TypeNode; } export interface SignatureDeclaration extends Declaration, ParsedSignature { } export interface VariableDeclaration extends Declaration { + name: Identifier; type?: TypeNode; initializer?: Expression; } - export interface PropertyDeclaration extends VariableDeclaration { } + export interface PropertyDeclaration extends Declaration { + type?: TypeNode; + initializer?: Expression; + } export interface ParameterDeclaration extends VariableDeclaration { } - export interface FunctionDeclaration extends Declaration, ParsedSignature { - body?: Node; // Block or Expression + /** + * Several node kinds share function-like features such as a signature, + * a name, and a body. These nodes should extend FunctionLikeDeclaration. + * Examples: + * FunctionDeclaration + * MethodDeclaration + * ConstructorDeclaration + * AccessorDeclaration + * FunctionExpression + */ + export interface FunctionLikeDeclaration extends Declaration, ParsedSignature { + body?: Block | Expression; } - export interface MethodDeclaration extends FunctionDeclaration { } + export interface FunctionDeclaration extends FunctionLikeDeclaration { + name: Identifier; + body?: Block; + } - export interface ConstructorDeclaration extends FunctionDeclaration { } + export interface MethodDeclaration extends FunctionLikeDeclaration { + body?: Block; + } - export interface AccessorDeclaration extends FunctionDeclaration { } + export interface ConstructorDeclaration extends FunctionLikeDeclaration { + body?: Block; + } + + export interface AccessorDeclaration extends FunctionLikeDeclaration { + body?: Block; + } export interface TypeNode extends Node { } @@ -375,17 +424,30 @@ module ts { whenFalse: Expression; } - export interface FunctionExpression extends Expression, FunctionDeclaration { - body: Node; // Required, whereas the member inherited from FunctionDeclaration is optional + export interface FunctionExpression extends Expression, FunctionLikeDeclaration { + name?: Identifier; + body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional } - // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral - // this means quotes have been removed and escapes have been converted to actual characters. For a NumericLiteral, the - // stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1". + // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral, + // or any literal of a template, this means quotes have been removed and escapes have been converted to actual characters. + // For a NumericLiteral, the stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1". export interface LiteralExpression extends Expression { text: string; } + export interface TemplateExpression extends Expression { + head: LiteralExpression; + templateSpans: NodeArray; + } + + // Each of these corresponds to a substitution expression and a template literal, in that order. + // The template literal must have kind TemplateMiddleLiteral or TemplateTailLiteral. + export interface TemplateSpan extends Node { + expression: Expression; + literal: LiteralExpression; + } + export interface ParenExpression extends Expression { expression: Expression; } @@ -416,6 +478,13 @@ module ts { export interface NewExpression extends CallExpression { } + export interface TaggedTemplateExpression extends Expression { + tag: Expression; + template: LiteralExpression | TemplateExpression; + } + + export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; + export interface TypeAssertion extends Expression { type: TypeNode; operand: Expression; @@ -509,6 +578,7 @@ module ts { } export interface ClassDeclaration extends Declaration { + name: Identifier; typeParameters?: NodeArray; baseType?: TypeReferenceNode; implementedTypes?: NodeArray; @@ -516,24 +586,34 @@ module ts { } export interface InterfaceDeclaration extends Declaration { + name: Identifier; typeParameters?: NodeArray; baseTypes?: NodeArray; members: NodeArray; } + export interface TypeAliasDeclaration extends Declaration { + name: Identifier; + type: TypeNode; + } + export interface EnumMember extends Declaration { + name: Identifier | LiteralExpression; initializer?: Expression; } export interface EnumDeclaration extends Declaration { + name: Identifier; members: NodeArray; } export interface ModuleDeclaration extends Declaration { - body: Node; // Block or ModuleDeclaration + name: Identifier | LiteralExpression; + body: Block | ModuleDeclaration; } export interface ImportDeclaration extends Declaration { + name: Identifier; entityName?: EntityName; externalModuleName?: LiteralExpression; } @@ -553,8 +633,9 @@ module ts { export interface SourceFile extends Block { filename: string; text: string; - getLineAndCharacterFromPosition(position: number): { line: number; character: number }; + getLineAndCharacterFromPosition(position: number): LineAndCharacter; getPositionFromLineAndCharacter(line: number, character: number): number; + getLineStarts(): number[]; amdDependencies: string[]; referencedFiles: FileReference[]; syntacticErrors: Diagnostic[]; @@ -582,40 +663,24 @@ module ts { } export interface SourceMapSpan { - /** Line number in the js file*/ - emittedLine: number; - /** Column number in the js file */ - emittedColumn: number; - /** Line number in the ts file */ - sourceLine: number; - /** Column number in the ts file */ - sourceColumn: number; - /** Optional name (index into names array) associated with this span */ - nameIndex?: number; - /** ts file (index into sources array) associated with this span*/ - sourceIndex: number; + emittedLine: number; // Line number in the .js file + emittedColumn: number; // Column number in the .js file + sourceLine: number; // Line number in the .ts file + sourceColumn: number; // Column number in the .ts file + nameIndex?: number; // Optional name (index into names array) associated with this span + sourceIndex: number; // .ts file (index into sources array) associated with this span*/ } export interface SourceMapData { - /** Where the sourcemap file is written */ - sourceMapFilePath: string; - /** source map URL written in the js file */ - jsSourceMappingURL: string; - /** Source map's file field - js file name*/ - sourceMapFile: string; - /** Source map's sourceRoot field - location where the sources will be present if not "" */ - sourceMapSourceRoot: string; - /** Source map's sources field - list of sources that can be indexed in this source map*/ - sourceMapSources: string[]; - /** input source file (which one can use on program to get the file) - this is one to one mapping with the sourceMapSources list*/ - inputSourceFileNames: string[]; - /** Source map's names field - list of names that can be indexed in this source map*/ - sourceMapNames?: string[]; - /** Source map's mapping field - encoded source map spans*/ - sourceMapMappings: string; - /** Raw source map spans that were encoded into the sourceMapMappings*/ - sourceMapDecodedMappings: SourceMapSpan[]; + sourceMapFilePath: string; // Where the sourcemap file is written + jsSourceMappingURL: string; // source map URL written in the .js file + sourceMapFile: string; // Source map's file field - .js file name + sourceMapSourceRoot: string; // Source map's sourceRoot field - location where the sources will be present if not "" + sourceMapSources: string[]; // Source map's sources field - list of sources that can be indexed in this source map + inputSourceFileNames: string[]; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMapSources list + sourceMapNames?: string[]; // Source map's names field - list of names that can be indexed in this source map + sourceMapMappings: string; // Source map's mapping field - encoded source map spans + sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings } // Return code used by getEmitOutput function to indicate status of the function @@ -645,7 +710,8 @@ module ts { checkProgram(): void; emitFiles(targetSourceFile?: SourceFile): EmitResult; getParentOfSymbol(symbol: Symbol): Symbol; - getTypeOfSymbol(symbol: Symbol): Type; + getNarrowedTypeOfSymbol(symbol: Symbol, node: Node): Type; + getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol; getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; @@ -663,15 +729,12 @@ module ts { getContextualType(node: Node): Type; getResolvedSignature(node: CallExpression, candidatesOutArray?: Signature[]): Signature; getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionDeclaration): boolean; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; + isArgumentsSymbol(symbol: Symbol): boolean; isEmitBlocked(sourceFile?: SourceFile): boolean; - - // Returns the constant value of this enum member, or 'undefined' if the enum member has a - // computed value. + // Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value. getEnumMemberValue(node: EnumMember): number; - isValidPropertyAccess(node: PropertyAccess, propertyName: string): boolean; getAliasedSymbol(symbol: Symbol): Symbol; } @@ -707,7 +770,7 @@ module ts { trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; } - export enum TypeFormatFlags { + export const enum TypeFormatFlags { None = 0x00000000, WriteArrayAsGenericType = 0x00000001, // Write Array instead T[] UseTypeOfFunction = 0x00000002, // Write typeof instead of function type literal @@ -718,7 +781,7 @@ module ts { InElementType = 0x00000040, // Writing an array or union element type } - export enum SymbolFormatFlags { + export const enum SymbolFormatFlags { None = 0x00000000, WriteTypeParametersOrArguments = 0x00000001, // Write symbols's type argument if it is instantiated symbol // eg. class C { p: T } <-- Show p as C.p here @@ -729,7 +792,7 @@ module ts { // When this flag is specified m.c will be used to refer to the class instead of alias symbol x } - export enum SymbolAccessibility { + export const enum SymbolAccessibility { Accessible, NotAccessible, CannotBeNamed @@ -744,78 +807,76 @@ module ts { export interface EmitResolver { getProgram(): Program; - getLocalNameOfContainer(container: Declaration): string; + getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; getExportAssignmentName(node: SourceFile): string; isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean; + isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; getEnumMemberValue(node: EnumMember): number; hasSemanticErrors(): boolean; isDeclarationVisible(node: Declaration): boolean; - isImplementationOfOverload(node: FunctionDeclaration): boolean; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult; - - // Returns the constant value this property access resolves to, or 'undefined' if it does - // resolve to a constant. - getConstantValue(node: PropertyAccess): number; + // Returns the constant value this property access resolves to, or 'undefined' for a non-constant + getConstantValue(node: PropertyAccess | IndexedAccess): number; isEmitBlocked(sourceFile?: SourceFile): boolean; } - export enum SymbolFlags { - FunctionScopedVariable = 0x00000001, // Variable (var) or parameter - Property = 0x00000002, // Property or enum member - EnumMember = 0x00000004, // Enum member - Function = 0x00000008, // Function - Class = 0x00000010, // Class - Interface = 0x00000020, // Interface - Enum = 0x00000040, // Enum - ValueModule = 0x00000080, // Instantiated module - NamespaceModule = 0x00000100, // Uninstantiated module - TypeLiteral = 0x00000200, // Type Literal - ObjectLiteral = 0x00000400, // Object Literal - Method = 0x00000800, // Method - Constructor = 0x00001000, // Constructor - GetAccessor = 0x00002000, // Get accessor - SetAccessor = 0x00004000, // Set accessor - CallSignature = 0x00008000, // Call signature - ConstructSignature = 0x00010000, // Construct signature - IndexSignature = 0x00020000, // Index signature - TypeParameter = 0x00040000, // Type parameter + export const enum SymbolFlags { + FunctionScopedVariable = 0x00000001, // Variable (var) or parameter + BlockScopedVariable = 0x00000002, // A block-scoped variable (let or const) + Property = 0x00000004, // Property or enum member + EnumMember = 0x00000008, // Enum member + Function = 0x00000010, // Function + Class = 0x00000020, // Class + Interface = 0x00000040, // Interface + ConstEnum = 0x00000080, // Const enum + RegularEnum = 0x00000100, // Enum + ValueModule = 0x00000200, // Instantiated module + NamespaceModule = 0x00000400, // Uninstantiated module + TypeLiteral = 0x00000800, // Type Literal + ObjectLiteral = 0x00001000, // Object Literal + Method = 0x00002000, // Method + Constructor = 0x00004000, // Constructor + GetAccessor = 0x00008000, // Get accessor + SetAccessor = 0x00010000, // Set accessor + CallSignature = 0x00020000, // Call signature + ConstructSignature = 0x00040000, // Construct signature + IndexSignature = 0x00080000, // Index signature + TypeParameter = 0x00100000, // Type parameter + TypeAlias = 0x00200000, // Type alias // Export markers (see comment in declareModuleMember in binder) - ExportValue = 0x00080000, // Exported value marker - ExportType = 0x00100000, // Exported type marker - ExportNamespace = 0x00200000, // Exported namespace marker - - Import = 0x00400000, // Import - Instantiated = 0x00800000, // Instantiated symbol - Merged = 0x01000000, // Merged symbol (created during program binding) - Transient = 0x02000000, // Transient symbol (created during type check) - Prototype = 0x04000000, // Prototype property (no source representation) - UnionProperty = 0x08000000, // Property in union type - - BlockScopedVariable = 0x10000000, // A block-scoped variable (let ot const) + ExportValue = 0x00400000, // Exported value marker + ExportType = 0x00800000, // Exported type marker + ExportNamespace = 0x01000000, // Exported namespace marker + Import = 0x02000000, // Import + Instantiated = 0x04000000, // Instantiated symbol + Merged = 0x08000000, // Merged symbol (created during program binding) + Transient = 0x10000000, // Transient symbol (created during type check) + Prototype = 0x20000000, // Prototype property (no source representation) + UnionProperty = 0x40000000, // Property in union type + Enum = RegularEnum | ConstEnum, Variable = FunctionScopedVariable | BlockScopedVariable, Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor, - Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter, + Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias, Namespace = ValueModule | NamespaceModule, Module = ValueModule | NamespaceModule, Accessor = GetAccessor | SetAccessor, Signature = CallSignature | ConstructSignature | IndexSignature, - // Variables can be redeclared, but can not redeclare a block-scoped declaration with the // same name, or any other value that is not a variable, e.g. ValueModule or Class FunctionScopedVariableExcludes = Value & ~FunctionScopedVariable, // Block-scoped declarations are not allowed to be re-declared // they can not merge with anything in the value space - BlockScopedVariableExcludes = Value, + BlockScopedVariableExcludes = Value, ParameterExcludes = Value, PropertyExcludes = Value, @@ -823,19 +884,18 @@ module ts { FunctionExcludes = Value & ~(Function | ValueModule), ClassExcludes = (Value | Type) & ~ValueModule, InterfaceExcludes = Type & ~Interface, - EnumExcludes = (Value | Type) & ~(Enum | ValueModule), - ValueModuleExcludes = Value & ~(Function | Class | Enum | ValueModule), + RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule), // regular enums merge only with regular enums and modules + ConstEnumExcludes = (Value | Type) & ~ConstEnum, // const enums merge only with const enums + ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule), NamespaceModuleExcludes = 0, MethodExcludes = Value & ~Method, GetAccessorExcludes = Value & ~SetAccessor, SetAccessorExcludes = Value & ~GetAccessor, TypeParameterExcludes = Type & ~TypeParameter, + TypeAliasExcludes = Type, + ImportExcludes = Import, // Imports collide with all other imports with the same name - - // Imports collide with all other imports with the same name. - ImportExcludes = Import, - - ModuleMember = Variable | Function | Class | Interface | Enum | Module | Import, + ModuleMember = Variable | Function | Class | Interface | Enum | Module | TypeAlias | Import, ExportHasLocal = Function | Class | Enum | ValueModule, @@ -843,9 +903,9 @@ module ts { HasExports = Class | Enum | Module, HasMembers = Class | Interface | TypeLiteral | ObjectLiteral, - IsContainer = HasLocals | HasExports | HasMembers, - PropertyOrAccessor = Property | Accessor, - Export = ExportNamespace | ExportType | ExportValue, + IsContainer = HasLocals | HasExports | HasMembers, + PropertyOrAccessor = Property | Accessor, + Export = ExportNamespace | ExportType | ExportValue, } export interface Symbol { @@ -858,7 +918,8 @@ module ts { members?: SymbolTable; // Class, interface or literal instance members exports?: SymbolTable; // Module exports exportSymbol?: Symbol; // Exported symbol associated with this symbol - valueDeclaration?: Declaration // First value declaration of the symbol + valueDeclaration?: Declaration // First value declaration of the symbol, + constEnumOnlyModule?: boolean // For modules - if true - module contains only const enums or other modules with only const enums. } export interface SymbolLinks { @@ -877,7 +938,7 @@ module ts { [index: string]: Symbol; } - export enum NodeCheckFlags { + export const enum NodeCheckFlags { TypeChecked = 0x00000001, // Node has been type checked LexicalThis = 0x00000002, // Lexical 'this' reference CaptureThis = 0x00000004, // Lexical 'this' used in body @@ -902,7 +963,7 @@ module ts { assignmentChecks?: Map; // Cache of assignment checks } - export enum TypeFlags { + export const enum TypeFlags { Any = 0x00000001, String = 0x00000002, Number = 0x00000004, @@ -999,7 +1060,7 @@ module ts { mapper?: TypeMapper; // Instantiation mapper } - export enum SignatureKind { + export const enum SignatureKind { Call, Construct, } @@ -1019,7 +1080,7 @@ module ts { isolatedSignatureType?: ObjectType; // A manufactured type that just contains the signature for purposes of signature comparison } - export enum IndexKind { + export const enum IndexKind { String, Number, } @@ -1028,12 +1089,18 @@ module ts { (t: Type): Type; } + export interface TypeInferences { + primary: Type[]; // Inferences made directly to a type parameter + secondary: Type[]; // Inferences made to a type parameter in a union type + } + export interface InferenceContext { - typeParameters: TypeParameter[]; // Type parameters for which inferences are made - inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) - inferenceCount: number; // Incremented for every inference made (whether new or not) - inferences: Type[][]; // Inferences made for each type parameter - inferredTypes: Type[]; // Inferred type for each type parameter + typeParameters: TypeParameter[]; // Type parameters for which inferences are made + inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) + inferences: TypeInferences[]; // Inferences made for each type parameter + inferredTypes: Type[]; // Inferred type for each type parameter + failedTypeParameterIndex?: number; // Index of type parameter for which inference failed + // It is optional because in contextual signature instantiation, nothing fails } export interface DiagnosticMessage { @@ -1061,7 +1128,16 @@ module ts { messageText: string; category: DiagnosticCategory; code: number; + /** + * Early error - any error (can be produced at parsing\binding\typechecking step) that blocks emit + */ isEarly?: boolean; + /** + * Parse error - error produced by parser when it scanner returns a token + * that parser does not understand in its current state + * (as opposed to grammar error when parser can interpret the token but interpretation is not legal from the grammar perespective) + */ + isParseError?: boolean; } export enum DiagnosticCategory { @@ -1094,10 +1170,11 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; - [option: string]: any; + preserveConstEnums?: boolean; + [option: string]: string | number | boolean; } - export enum ModuleKind { + export const enum ModuleKind { None, CommonJS, AMD, @@ -1112,7 +1189,7 @@ module ts { } - export enum ScriptTarget { + export const enum ScriptTarget { ES3, ES5, ES6, @@ -1127,14 +1204,14 @@ module ts { export interface CommandLineOption { name: string; - type: any; // "string", "number", "boolean", or an object literal mapping named values to actual values + type: string | Map; // "string", "number", "boolean", or an object literal mapping named values to actual values shortName?: string; // A short pneumonic for convenience - for instance, 'h' can be used in place of 'help'. description?: DiagnosticMessage; // The message describing what the command line switch does paramName?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter. error?: DiagnosticMessage; // The error given when the argument does not fit a customized 'type'. } - export enum CharacterCodes { + export const enum CharacterCodes { nullCharacter = 0, maxAsciiCharacter = 0x7F, @@ -1236,6 +1313,7 @@ module ts { asterisk = 0x2A, // * at = 0x40, // @ backslash = 0x5C, // \ + backtick = 0x60, // ` bar = 0x7C, // | caret = 0x5E, // ^ closeBrace = 0x7D, // } diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 01dc1208010..cc04d4813a1 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -3,7 +3,7 @@ /// /// -enum CompilerTestType { +const enum CompilerTestType { Conformance, Regressions, Test262 @@ -296,12 +296,10 @@ class CompilerBaselineRunner extends RunnerBase { typeLines.push('=== ' + file.unitName + ' ===\r\n'); for (var i = 0; i < codeLines.length; i++) { var currentCodeLine = codeLines[i]; - var lastLine = typeLines[typeLines.length]; typeLines.push(currentCodeLine + '\r\n'); if (typeMap[file.unitName]) { var typeInfo = typeMap[file.unitName][i]; if (typeInfo) { - var leadingSpaces = ''; typeInfo.forEach(ty => { typeLines.push('>' + ty + '\r\n'); }); diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 33f435ce76b..ffb0ed16cb8 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -136,10 +136,11 @@ module FourSlash { outDir: 'outDir', sourceMap: 'sourceMap', sourceRoot: 'sourceRoot', + resolveReference: 'ResolveReference', // This flag is used to specify entry file for resolve file references. The flag is only allow once per test file }; // List of allowed metadata names - var fileMetadataNames = [testOptMetadataNames.filename, testOptMetadataNames.emitThisFile]; + var fileMetadataNames = [testOptMetadataNames.filename, testOptMetadataNames.emitThisFile, testOptMetadataNames.resolveReference]; var globalMetadataNames = [testOptMetadataNames.baselineFile, testOptMetadataNames.declaration, testOptMetadataNames.mapRoot, testOptMetadataNames.module, testOptMetadataNames.out, testOptMetadataNames.outDir, testOptMetadataNames.sourceMap, testOptMetadataNames.sourceRoot] @@ -236,6 +237,25 @@ module FourSlash { throw new Error("Operation should be cancelled"); } + // This function creates IScriptSnapshot object for testing getPreProcessedFileInfo + // Return object may lack some functionalities for other purposes. + function createScriptSnapShot(sourceText: string): TypeScript.IScriptSnapshot { + return { + getText: (start: number, end: number) => { + return sourceText.substr(start, end - start); + }, + getLength: () => { + return sourceText.length; + }, + getLineStartPositions: () => { + return []; + }, + getChangeRange: (oldSnapshot: TypeScript.IScriptSnapshot) => { + return undefined; + } + }; + } + export class TestState { // Language service instance public languageServiceShimHost: Harness.LanguageService.TypeScriptLS; @@ -264,6 +284,16 @@ module FourSlash { private scenarioActions: string[] = []; private taoInvalidReason: string = null; + private inputFiles: ts.Map = {}; // Map between inputFile's filename and its content for easily looking up when resolving references + + // Add input file which has matched file name with the given reference-file path. + // This is necessary when resolveReference flag is specified + private addMatchedInputFile(referenceFilePath: string) { + var inputFile = this.inputFiles[referenceFilePath]; + if (inputFile && !Harness.isLibraryFile(referenceFilePath)) { + this.languageServiceShimHost.addScript(referenceFilePath, inputFile); + } + } constructor(public testData: FourSlashData) { // Initialize the language service with all the scripts @@ -273,57 +303,57 @@ module FourSlash { var compilationSettings = convertGlobalOptionsToCompilationSettings(this.testData.globalOptions); this.languageServiceShimHost.setCompilationSettings(compilationSettings); - var inputFiles: { unitName: string; content: string }[] = []; + var startResolveFileRef: FourSlashFile = undefined; - testData.files.forEach(file => { - var fixedPath = file.fileName.substr(file.fileName.indexOf('tests/')); - }); - - // NEWTODO: disable resolution for now. - // If the last unit contains require( or /// reference then consider it the only input file - // and the rest will be added via resolution. If not, then assume we have multiple files - // with 0 references in any of them. We could be smarter here to allow scenarios like - // 2 files without references and 1 file with a reference but we have 0 tests like that - // at the moment and an exhaustive search of the test files for that content could be quite slow. - var lastFile = testData.files[testData.files.length - 1]; - //if (/require\(/.test(lastFile.content) || /reference\spath/.test(lastFile.content)) { - // inputFiles.push({ unitName: lastFile.fileName, content: lastFile.content }); - //} else { - inputFiles = testData.files.map(file => { - return { unitName: file.fileName, content: file.content }; - }); - //} - - - // NEWTODO: Re-implement commented-out section - //harnessCompiler.addInputFiles(inputFiles); - //try { - // var resolvedFiles = harnessCompiler.resolve(); - - // resolvedFiles.forEach(file => { - // if (!Harness.isLibraryFile(file.path)) { - // var fixedPath = file.path.substr(file.path.indexOf('tests/')); - // var content = harnessCompiler.getContentForFile(fixedPath); - // this.languageServiceShimHost.addScript(fixedPath, content); - // } - // }); - - // this.languageServiceShimHost.addScript('lib.d.ts', Harness.Compiler.libTextMinimal); - //} - //finally { - // // harness no longer needs the results of the above work, make sure the next test operations are in a clean state - // harnessCompiler.reset(); - //} - - /// NEWTODO: For now do not resolve, just use the input files - inputFiles.forEach(file => { - if (!Harness.isLibraryFile(file.unitName)) { - this.languageServiceShimHost.addScript(file.unitName, file.content); + ts.forEach(testData.files, file => { + // Create map between fileName and its content for easily looking up when resolveReference flag is specified + this.inputFiles[file.fileName] = file.content; + if (!startResolveFileRef && file.fileOptions[testOptMetadataNames.resolveReference]) { + startResolveFileRef = file; + } else if (startResolveFileRef) { + // If entry point for resolving file references is already specified, report duplication error + throw new Error("There exists a Fourslash file which has resolveReference flag specified; remove duplicated resolveReference flag"); } }); - this.languageServiceShimHost.addDefaultLibrary(); + if (startResolveFileRef) { + // Add the entry-point file itself into the languageServiceShimHost + this.languageServiceShimHost.addScript(startResolveFileRef.fileName, startResolveFileRef.content); + var jsonResolvedResult = JSON.parse(this.languageServiceShimHost.getCoreService().getPreProcessedFileInfo(startResolveFileRef.fileName, + createScriptSnapShot(startResolveFileRef.content))); + var resolvedResult = jsonResolvedResult.result; + var referencedFiles: ts.IFileReference[] = resolvedResult.referencedFiles; + var importedFiles: ts.IFileReference[] = resolvedResult.importedFiles; + + // Add triple reference files into language-service host + ts.forEach(referencedFiles, referenceFile => { + // Fourslash insert tests/cases/fourslash into inputFile.unitName so we will properly append the same base directory to refFile path + var referenceFilePath = "tests/cases/fourslash/" + referenceFile.path; + this.addMatchedInputFile(referenceFilePath); + }); + + // Add import files into language-service host + ts.forEach(importedFiles, importedFile => { + // Fourslash insert tests/cases/fourslash into inputFile.unitName and import statement doesn't require ".ts" + // so convert them before making appropriate comparison + var importedFilePath = "tests/cases/fourslash/" + importedFile.path + ".ts"; + this.addMatchedInputFile(importedFilePath); + }); + + // Check if no-default-lib flag is false and if so add default library + if (!resolvedResult.isLibFile) { + this.languageServiceShimHost.addDefaultLibrary(); + } + } else { + // resolveReference file-option is not specified then do not resolve any files and include all inputFiles + ts.forEachKey(this.inputFiles, fileName => { + if (!Harness.isLibraryFile(fileName)) { + this.languageServiceShimHost.addScript(fileName, this.inputFiles[fileName]); + } + }); + this.languageServiceShimHost.addDefaultLibrary(); + } // Sneak into the language service and get its compiler so we can examine the syntax trees this.languageService = this.languageServiceShimHost.getLanguageService().languageService; @@ -991,7 +1021,7 @@ module FourSlash { var resultString = "SpanInfo: " + JSON.stringify(spanInfo); if (spanInfo) { var spanString = this.activeFile.content.substr(spanInfo.start(), spanInfo.length()); - var spanLineMap = ts.getLineStarts(spanString); + var spanLineMap = ts.computeLineStarts(spanString); for (var i = 0; i < spanLineMap.length; i++) { if (!i) { resultString += "\n"; @@ -1005,7 +1035,7 @@ module FourSlash { } private baselineCurrentFileLocations(getSpanAtPos: (pos: number) => TypeScript.TextSpan): string { - var fileLineMap = ts.getLineStarts(this.activeFile.content); + var fileLineMap = ts.computeLineStarts(this.activeFile.content); var nextLine = 0; var resultString = ""; var currentLine: string; @@ -2044,10 +2074,6 @@ module FourSlash { } } - private getEOF(): number { - return this.languageServiceShimHost.getScriptSnapshot(this.activeFile.fileName).getLength(); - } - // Get the text of the entire line the caret is currently at private getCurrentLineContent() { // The current caret position (in line/col terms) @@ -2163,14 +2189,6 @@ module FourSlash { return result; } - private getCurrentLineNumberZeroBased() { - return this.getCurrentLineNumberOneBased() - 1; - } - - private getCurrentLineNumberOneBased() { - return this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, this.currentCaretPosition).line + 1; - } - private getLineColStringAtPosition(position: number) { var pos = this.languageServiceShimHost.positionToZeroBasedLineCol(this.activeFile.fileName, position); return 'line ' + (pos.line + 1) + ', col ' + pos.character; @@ -2368,7 +2386,7 @@ module FourSlash { }; } - enum State { + const enum State { none, inSlashStarMarker, inObjectMarker diff --git a/src/harness/fourslashRunner.ts b/src/harness/fourslashRunner.ts index 102d4433b10..b7e59437456 100644 --- a/src/harness/fourslashRunner.ts +++ b/src/harness/fourslashRunner.ts @@ -20,7 +20,7 @@ class FourslashRunner extends RunnerBase { }); this.tests.forEach((fn: string) => { - fn = Harness.Path.switchToForwardSlashes(fn); + fn = ts.normalizeSlashes(fn); var justName = fn.replace(/^.*[\\\/]/, ''); // Convert to relative path diff --git a/src/harness/harness.ts b/src/harness/harness.ts index b39682913b1..d5eaa3828a1 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -15,6 +15,7 @@ /// /// +/// /// /// /// @@ -30,7 +31,7 @@ module Utils { var global = Function("return this").call(null); // Setup some globals based on the current environment - export enum ExecutionEnvironment { + export const enum ExecutionEnvironment { Node, Browser, CScript @@ -117,15 +118,11 @@ module Harness.Path { } export function filePath(fullPath: string) { - fullPath = switchToForwardSlashes(fullPath); + fullPath = ts.normalizeSlashes(fullPath); var components = fullPath.split("/"); var path: string[] = components.slice(0, components.length - 1); return path.join("/") + "/"; } - - export function switchToForwardSlashes(path: string) { - return path.replace(/\\/g, "/").replace(/\/\//g, '/'); - } } module Harness { @@ -564,7 +561,7 @@ module Harness { // Register input files function register(file: { unitName: string; content: string; }) { if (file.content !== undefined) { - var filename = Path.switchToForwardSlashes(file.unitName); + var filename = ts.normalizeSlashes(file.unitName); filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, scriptTarget, /*version:*/ "0"); } }; @@ -761,7 +758,6 @@ module Harness { case 'codepage': case 'createFileLog': case 'filename': - case 'propagateenumconstants': case 'removecomments': case 'watch': case 'allowautomaticsemicoloninsertion': @@ -776,7 +772,9 @@ module Harness { case 'errortruncation': options.noErrorTruncation = setting.value === 'false'; break; - + case 'preserveconstenums': + options.preserveConstEnums = setting.value === 'true'; + break; default: throw new Error('Unsupported compiler setting ' + setting.flag); } @@ -785,7 +783,7 @@ module Harness { var filemap: { [name: string]: ts.SourceFile; } = {}; var register = (file: { unitName: string; content: string; }) => { if (file.content !== undefined) { - var filename = Path.switchToForwardSlashes(file.unitName); + var filename = ts.normalizeSlashes(file.unitName); filemap[getCanonicalFileName(filename)] = ts.createSourceFile(filename, file.content, options.target, /*version:*/ "0"); } }; @@ -962,7 +960,7 @@ module Harness { // Note: IE JS engine incorrectly handles consecutive delimiters here when using RegExp split, so // we have to string-based splitting instead and try to figure out the delimiting chars - var lineStarts = ts.getLineStarts(inputFile.content); + var lineStarts = ts.computeLineStarts(inputFile.content); var lines = inputFile.content.split('\n'); lines.forEach((line, lineIndex) => { if (line.length > 0 && line.charAt(line.length - 1) === '\r') { @@ -1007,8 +1005,12 @@ module Harness { assert.equal(markedErrorCount, fileErrors.length, 'count of errors in ' + inputFile.unitName); }); + var numLibraryDiagnostics = ts.countWhere(diagnostics, diagnostic => { + return diagnostic.filename && isLibraryFile(diagnostic.filename); + }); + // Verify we didn't miss any errors in total - assert.equal(totalErrorsReported, diagnostics.length, 'total number of errors'); + assert.equal(totalErrorsReported + numLibraryDiagnostics, diagnostics.length, 'total number of errors'); return minimalDiagnosticsToString(diagnostics) + sys.newLine + sys.newLine + outputLines.join('\r\n'); @@ -1093,7 +1095,6 @@ module Harness { /** @param fileResults an array of strings for the fileName and an ITextWriter with its code */ constructor(fileResults: GeneratedFile[], errors: HarnessDiagnostic[], public program: ts.Program, public currentDirectoryForProgram: string, private sourceMapData: ts.SourceMapData[]) { - var lines: string[] = []; fileResults.forEach(emittedFile => { if (isDTS(emittedFile.fileName)) { @@ -1149,7 +1150,7 @@ module Harness { var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines // List of allowed metadata names - var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames"]; + var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noemitonerror","noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums"]; function extractCompilerSettings(content: string): CompilerSetting[] { @@ -1247,7 +1248,6 @@ module Harness { /** Support class for baseline files */ export module Baseline { - var firstRun = true; export interface BaselineOptions { LineEndingSensitive?: boolean; @@ -1288,8 +1288,7 @@ module Harness { IO.createDirectory(dirName); fileCache[dirName] = true; } - var parentDir = IO.directoryName(actualFilename); // .../tests/baselines/local - var parentParentDir = IO.directoryName(IO.directoryName(actualFilename)) // .../tests/baselines + // Create folders if needed createDirectoryStructure(Harness.IO.directoryName(actualFilename)); diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 6307c4d1e78..6163dfd0e79 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -258,6 +258,10 @@ module Harness.LanguageService { return new TypeScript.Services.TypeScriptServicesFactory().createClassifierShim(this); } + public getCoreService(): ts.CoreServicesShim { + return new TypeScript.Services.TypeScriptServicesFactory().createCoreServicesShim(this); + } + /** Parse file given its source text */ public parseSourceText(fileName: string, sourceText: TypeScript.IScriptSnapshot): TypeScript.SourceUnitSyntax { return TypeScript.Parser.parse(fileName, TypeScript.SimpleText.fromScriptSnapshot(sourceText), ts.ScriptTarget.Latest, TypeScript.isDTSFile(fileName)).sourceUnit(); diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index fc33d08b334..c6305c50c10 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -175,10 +175,10 @@ module Playback { } function findResultByPath(wrapper: { resolvePath(s: string): string }, logArray: { path: string; result?: T }[], expectedPath: string, defaultValue?: T): T { - var normalizedName = Harness.Path.switchToForwardSlashes(expectedPath).toLowerCase(); + var normalizedName = ts.normalizeSlashes(expectedPath).toLowerCase(); // Try to find the result through normal filename for (var i = 0; i < logArray.length; i++) { - if (Harness.Path.switchToForwardSlashes(logArray[i].path).toLowerCase() === normalizedName) { + if (ts.normalizeSlashes(logArray[i].path).toLowerCase() === normalizedName) { return logArray[i].result; } } @@ -203,7 +203,7 @@ module Playback { function pathsAreEquivalent(left: string, right: string, wrapper: { resolvePath(s: string): string }) { var key = left + '-~~-' + right; function areSame(a: string, b: string) { - return Harness.Path.switchToForwardSlashes(a).toLowerCase() === Harness.Path.switchToForwardSlashes(b).toLowerCase(); + return ts.normalizeSlashes(a).toLowerCase() === ts.normalizeSlashes(b).toLowerCase(); } function check() { if (Harness.Path.getFileName(left).toLowerCase() === Harness.Path.getFileName(right).toLowerCase()) { diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 6590344a8dd..bfb139fa719 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -23,7 +23,7 @@ module RWC { function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[], clean?: (s: string) => string) { // Collect, test, and sort the filenames function cleanName(fn: string) { - var lastSlash = Harness.Path.switchToForwardSlashes(fn).lastIndexOf('/'); + var lastSlash = ts.normalizeSlashes(fn).lastIndexOf('/'); return fn.substr(lastSlash + 1).toLowerCase(); } outputFiles.sort((a, b) => cleanName(a.fileName).localeCompare(cleanName(b.fileName))); @@ -52,7 +52,7 @@ module RWC { var compilerResult: Harness.Compiler.CompilerResult; var compilerOptions: ts.CompilerOptions; var baselineOpts: Harness.Baseline.BaselineOptions = { Subfolder: 'rwc' }; - var baseName = /(.*)\/(.*).json/.exec(Harness.Path.switchToForwardSlashes(jsonPath))[2]; + var baseName = /(.*)\/(.*).json/.exec(ts.normalizeSlashes(jsonPath))[2]; // Compile .d.ts files var declFileCompilationResult: { declInputFiles: { unitName: string; content: string }[]; @@ -99,7 +99,7 @@ module RWC { } ts.forEach(ioLog.filesRead, fileRead => { - var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileRead.path)); + var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileRead.path)); var inInputList = ts.forEach(inputFiles, inputFile=> inputFile.unitName === resolvedPath); if (!inInputList) { // Add the file to other files @@ -117,7 +117,7 @@ module RWC { }); function getHarnessCompilerInputUnit(fileName: string) { - var resolvedPath = Harness.Path.switchToForwardSlashes(sys.resolvePath(fileName)); + var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileName)); try { var content = sys.readFile(resolvedPath); } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index f7a6bdbf3e5..f7d6bcfeaa1 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -223,7 +223,7 @@ module Harness.SourceMapRecoder { sourceMapNames = sourceMapData.sourceMapNames; jsFile = currentJsFile; - jsLineMap = ts.getLineStarts(jsFile.code); + jsLineMap = ts.computeLineStarts(jsFile.code); spansOnSingleLine = []; prevWrittenSourcePos = 0; @@ -294,7 +294,7 @@ module Harness.SourceMapRecoder { sourceMapRecoder.WriteLine("sourceFile:" + sourceMapSources[spansOnSingleLine[0].sourceMapSpan.sourceIndex]); sourceMapRecoder.WriteLine("-------------------------------------------------------------------"); - tsLineMap = ts.getLineStarts(newSourceFileCode); + tsLineMap = ts.computeLineStarts(newSourceFileCode); tsCode = newSourceFileCode; prevWrittenSourcePos = 0; } @@ -390,7 +390,7 @@ module Harness.SourceMapRecoder { } } - var tsCodeLineMap = ts.getLineStarts(sourceText); + var tsCodeLineMap = ts.computeLineStarts(sourceText); for (var i = 0; i < tsCodeLineMap.length; i++) { writeSourceMapIndent(prevEmittedCol, i == 0 ? markerIds[index] : " >"); sourceMapRecoder.Write(getTextOfLine(i, tsCodeLineMap, sourceText)); diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 5dfc75b29a5..ed8d37c9c7e 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -1,7 +1,7 @@ interface TypeWriterResult { line: number; column: number; - syntaxKind: string; + syntaxKind: number; sourceText: string; type: string; } @@ -84,7 +84,7 @@ class TypeWriterWalker { this.results.push({ line: lineAndCharacter.line - 1, column: lineAndCharacter.character, - syntaxKind: ts.SyntaxKind[node.kind], + syntaxKind: node.kind, sourceText: sourceText, type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteOwnNameForAnyLike) }); @@ -92,7 +92,7 @@ class TypeWriterWalker { private getTypeOfNode(node: ts.Node): ts.Type { var type = this.checker.getTypeOfNode(node); - ts.Debug.assert(type, "type doesn't exist"); + ts.Debug.assert(type !== undefined, "type doesn't exist"); return type; } } diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 8e16e4bdd6c..7f498488f21 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -484,6 +484,10 @@ declare var Number: { POSITIVE_INFINITY: number; } +interface TemplateStringsArray extends Array { + raw: string[]; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 3a72ee9bfa6..f8688b3c479 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -74,7 +74,7 @@ module ts.BreakpointResolver { return textSpan(node); } - if (node.parent.kind == SyntaxKind.ArrowFunction && (node.parent).body == node) { + if (node.parent.kind == SyntaxKind.ArrowFunction && (node.parent).body == node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } @@ -99,7 +99,7 @@ module ts.BreakpointResolver { case SyntaxKind.Constructor: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - return spanInFunctionDeclaration(node); + return spanInFunctionDeclaration(node); case SyntaxKind.FunctionBlock: return spanInFunctionBlock(node); @@ -178,7 +178,7 @@ module ts.BreakpointResolver { case SyntaxKind.ModuleDeclaration: // span on complete module if it is instantiated - if (!isInstantiated(node)) { + if (getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return undefined; } @@ -194,8 +194,9 @@ module ts.BreakpointResolver { // span in statement return spanInNode((node).statement); - // No breakpoint in interface + // No breakpoint in interface, type alias case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: return undefined; // Tokens: @@ -246,7 +247,7 @@ module ts.BreakpointResolver { } // return type of function go to previous token - if (isAnyFunction(node.parent) && (node.parent).type === node) { + if (isAnyFunction(node.parent) && (node.parent).type === node) { return spanInPreviousNode(node); } @@ -305,7 +306,7 @@ module ts.BreakpointResolver { return textSpan(parameter); } else { - var functionDeclaration = parameter.parent; + var functionDeclaration = parameter.parent; var indexOfParameter = indexOf(functionDeclaration.parameters, parameter); if (indexOfParameter) { // Not a first parameter, go to previous parameter @@ -318,12 +319,12 @@ module ts.BreakpointResolver { } } - function canFunctionHaveSpanInWholeDeclaration(functionDeclaration: FunctionDeclaration) { + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration: FunctionLikeDeclaration) { return !!(functionDeclaration.flags & NodeFlags.Export) || (functionDeclaration.parent.kind === SyntaxKind.ClassDeclaration && functionDeclaration.kind !== SyntaxKind.Constructor); } - function spanInFunctionDeclaration(functionDeclaration: FunctionDeclaration): TypeScript.TextSpan { + function spanInFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration): TypeScript.TextSpan { // No breakpoints in the function signature if (!functionDeclaration.body) { return undefined; @@ -340,7 +341,7 @@ module ts.BreakpointResolver { function spanInFunctionBlock(block: Block): TypeScript.TextSpan { var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); - if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); } @@ -350,7 +351,7 @@ module ts.BreakpointResolver { function spanInBlock(block: Block): TypeScript.TextSpan { switch (block.parent.kind) { case SyntaxKind.ModuleDeclaration: - if (!isInstantiated(block.parent)) { + if (getModuleInstanceState(block.parent) !== ModuleInstanceState.Instantiated) { return undefined; } @@ -407,7 +408,7 @@ module ts.BreakpointResolver { switch (node.parent.kind) { case SyntaxKind.ModuleBlock: // If this is not instantiated module block no bp span - if (!isInstantiated(node.parent.parent)) { + if (getModuleInstanceState(node.parent.parent) !== ModuleInstanceState.Instantiated) { return undefined; } diff --git a/src/services/compiler/ast.ts b/src/services/compiler/ast.ts index 76b4903768d..e69de29bb2d 100644 --- a/src/services/compiler/ast.ts +++ b/src/services/compiler/ast.ts @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript { - export class Comment { - constructor(private _trivia: ISyntaxTrivia, - public endsLine: boolean, - public _start: number, - public _end: number) { - } - - public start(): number { - return this._start; - } - - public end(): number { - return this._end; - } - - public fullText(): string { - return this._trivia.fullText(); - } - - public kind(): SyntaxKind { - return this._trivia.kind(); - } - - public structuralEquals(ast: Comment, includingPosition: boolean): boolean { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - - return this._trivia.fullText() === ast._trivia.fullText() && - this.endsLine === ast.endsLine; - } - } -} \ No newline at end of file diff --git a/src/services/compiler/astHelpers.ts b/src/services/compiler/astHelpers.ts index 589ef4b6340..e69de29bb2d 100644 --- a/src/services/compiler/astHelpers.ts +++ b/src/services/compiler/astHelpers.ts @@ -1,759 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.ASTHelpers { - - - var sentinelEmptyArray: any[] = []; - - //export function scriptIsElided(sourceUnit: SourceUnitSyntax): boolean { - // return isDTSFile(sourceUnit.syntaxTree.fileName()) || moduleMembersAreElided(sourceUnit.moduleElements); - //} - - //export function moduleIsElided(declaration: ModuleDeclarationSyntax): boolean { - // return hasModifier(declaration.modifiers, PullElementFlags.Ambient) || moduleMembersAreElided(declaration.moduleElements); - //} - - //function moduleMembersAreElided(members: IModuleElementSyntax[]): boolean { - // for (var i = 0, n = members.length; i < n; i++) { - // var member = members[i]; - - // // We should emit *this* module if it contains any non-interface types. - // // Caveat: if we have contain a module, then we should be emitted *if we want to - // // emit that inner module as well. - // if (member.kind() === SyntaxKind.ModuleDeclaration) { - // if (!moduleIsElided(member)) { - // return false; - // } - // } - // else if (member.kind() !== SyntaxKind.InterfaceDeclaration) { - // return false; - // } - // } - - // return true; - //} - - //export function enumIsElided(declaration: EnumDeclarationSyntax): boolean { - // if (hasModifier(declaration.modifiers, PullElementFlags.Ambient)) { - // return true; - // } - - // return false; - //} - - export function isValidAstNode(ast: ISyntaxElement): boolean { - return ast && !isShared(ast) && start(ast) !== -1 && end(ast) !== -1; - } - - export function isValidSpan(ast: ISpan): boolean { - if (!ast) - return false; - - if (ast.start() === -1 || ast.end() === -1) - return false; - - return true; - } - - /// - /// Return the ISyntaxElement containing "position" - /// - export function getAstAtPosition(script: ISyntaxElement, pos: number, useTrailingTriviaAsLimChar: boolean = true, forceInclusive: boolean = false): ISyntaxElement { - var top: ISyntaxElement = null; - - var pre = function (cur: ISyntaxElement, walker: IAstWalker) { - if (!isShared(cur) && isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === SyntaxKind.ExpressionStatement && width(cur) === 0; - - if (isInvalid1) { - walker.options.goChildren = false; - } - else { - // Add "cur" to the stack if it contains our position - // For "identifier" nodes, we need a special case: A position equal to "limChar" is - // valid, since the position corresponds to a caret position (in between characters) - // For example: - // bar - // 0123 - // If "position === 3", the caret is at the "right" of the "r" character, which should be considered valid - var inclusive = - forceInclusive || - cur.kind() === SyntaxKind.IdentifierName || - cur.kind() === SyntaxKind.MemberAccessExpression || - cur.kind() === SyntaxKind.QualifiedName || - //cur.kind() === SyntaxKind.TypeRef || - cur.kind() === SyntaxKind.VariableDeclaration || - cur.kind() === SyntaxKind.VariableDeclarator || - cur.kind() === SyntaxKind.InvocationExpression || - pos === end(script) + lastToken(script).trailingTriviaWidth(); // Special "EOF" case - - var minChar = start(cur); - var limChar = end(cur) + (useTrailingTriviaAsLimChar ? trailingTriviaWidth(cur) : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - - // Ignore empty lists - if ((cur.kind() !== SyntaxKind.List && cur.kind() !== SyntaxKind.SeparatedList) || end(cur) > start(cur)) { - // TODO: Since ISyntaxElement is sometimes not correct wrt to position, only add "cur" if it's better - // than top of the stack. - if (top === null) { - top = cur; - } - else if (start(cur) >= start(top) && - (end(cur) + (useTrailingTriviaAsLimChar ? trailingTriviaWidth(cur) : 0)) <= (end(top) + (useTrailingTriviaAsLimChar ? trailingTriviaWidth(top) : 0))) { - // this new node appears to be better than the one we're - // storing. Make this the new node. - - // However, If the current top is a missing identifier, we - // don't want to replace it with another missing identifier. - // We want to return the first missing identifier found in a - // depth first walk of the tree. - if (width(top) !== 0 || width(cur) !== 0) { - top = cur; - } - } - } - } - - // Don't go further down the tree if pos is outside of [minChar, limChar] - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - - getAstWalkerFactory().walk(script, pre); - return top; - } - - export function getExtendsHeritageClause(clauses: HeritageClauseSyntax[]): HeritageClauseSyntax { - return getHeritageClause(clauses, SyntaxKind.ExtendsHeritageClause); - } - - export function getImplementsHeritageClause(clauses: HeritageClauseSyntax[]): HeritageClauseSyntax { - return getHeritageClause(clauses, SyntaxKind.ImplementsHeritageClause); - } - - function getHeritageClause(clauses: HeritageClauseSyntax[], kind: SyntaxKind): HeritageClauseSyntax { - if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - var child = clauses[i]; - - if (child.typeNames.length > 0 && child.kind() === kind) { - return child; - } - } - } - - return null; - } - - export function isCallExpression(ast: ISyntaxElement): boolean { - return (ast && ast.kind() === SyntaxKind.InvocationExpression) || - (ast && ast.kind() === SyntaxKind.ObjectCreationExpression); - } - - export function isCallExpressionTarget(ast: ISyntaxElement): boolean { - return !!getCallExpressionTarget(ast); - } - - export function getCallExpressionTarget(ast: ISyntaxElement): ISyntaxElement { - if (!ast) { - return null; - } - - var current = ast; - - while (current && current.parent) { - if (current.parent.kind() === SyntaxKind.MemberAccessExpression && - (current.parent).name === current) { - current = current.parent; - continue; - } - - break; - } - - if (current && current.parent) { - if (current.parent.kind() === SyntaxKind.InvocationExpression || current.parent.kind() === SyntaxKind.ObjectCreationExpression) { - return current === (current.parent).expression ? current : null; - } - } - return null; - } - - function isNameOfSomeDeclaration(ast: ISyntaxElement) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== SyntaxKind.IdentifierName) { - return false; - } - - switch (ast.parent.kind()) { - case SyntaxKind.ClassDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.InterfaceDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.EnumDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.ModuleDeclaration: - return (ast.parent).name === ast || (ast.parent).stringLiteral === ast; - case SyntaxKind.VariableDeclarator: - return (ast.parent).propertyName === ast; - case SyntaxKind.FunctionDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.MemberFunctionDeclaration: - return (ast.parent).propertyName === ast; - case SyntaxKind.Parameter: - return (ast.parent).identifier === ast; - case SyntaxKind.TypeParameter: - return (ast.parent).identifier === ast; - case SyntaxKind.SimplePropertyAssignment: - return (ast.parent).propertyName === ast; - case SyntaxKind.FunctionPropertyAssignment: - return (ast.parent).propertyName === ast; - case SyntaxKind.EnumElement: - return (ast.parent).propertyName === ast; - case SyntaxKind.ImportDeclaration: - return (ast.parent).identifier === ast; - case SyntaxKind.MethodSignature: - return (ast.parent).propertyName === ast; - case SyntaxKind.PropertySignature: - return (ast.parent).propertyName === ast; - } - - return false; - } - - export function isDeclarationASTOrDeclarationNameAST(ast: ISyntaxElement) { - return isNameOfSomeDeclaration(ast) || ASTHelpers.isDeclarationAST(ast); - } - - export function getEnclosingParameterForInitializer(ast: ISyntaxElement): ParameterSyntax { - var current = ast; - while (current) { - switch (current.kind()) { - case SyntaxKind.EqualsValueClause: - if (current.parent && current.parent.kind() === SyntaxKind.Parameter) { - return current.parent; - } - break; - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.ModuleDeclaration: - // exit early - return null; - } - - current = current.parent; - } - return null; - } - - export function getEnclosingMemberDeclaration(ast: ISyntaxElement): ISyntaxElement { - var current = ast; - - while (current) { - switch (current.kind()) { - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - return current; - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.ModuleDeclaration: - // exit early - return null; - } - current = current.parent; - } - - return null; - } - - export function isNameOfFunction(ast: ISyntaxElement) { - return ast - && ast.parent - && ast.kind() === SyntaxKind.IdentifierName - && ast.parent.kind() === SyntaxKind.FunctionDeclaration - && (ast.parent).identifier === ast; - } - - export function isNameOfMemberFunction(ast: ISyntaxElement) { - return ast - && ast.parent - && ast.kind() === SyntaxKind.IdentifierName - && ast.parent.kind() === SyntaxKind.MemberFunctionDeclaration - && (ast.parent).propertyName === ast; - } - - export function isNameOfMemberAccessExpression(ast: ISyntaxElement) { - if (ast && - ast.parent && - ast.parent.kind() === SyntaxKind.MemberAccessExpression && - (ast.parent).name === ast) { - - return true; - } - - return false; - } - - export function isRightSideOfQualifiedName(ast: ISyntaxElement) { - if (ast && - ast.parent && - ast.parent.kind() === SyntaxKind.QualifiedName && - (ast.parent).right === ast) { - - return true; - } - - return false; - } - - export function parentIsModuleDeclaration(ast: ISyntaxElement) { - return ast.parent && ast.parent.kind() === SyntaxKind.ModuleDeclaration; - } - - export function isDeclarationAST(ast: ISyntaxElement): boolean { - switch (ast.kind()) { - case SyntaxKind.VariableDeclarator: - return getVariableStatement(ast) !== null; - - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.Parameter: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: - case SyntaxKind.IndexSignature: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ArrayType: - case SyntaxKind.ObjectType: - case SyntaxKind.TypeParameter: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.IndexMemberDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.EnumElement: - case SyntaxKind.SimplePropertyAssignment: - case SyntaxKind.FunctionPropertyAssignment: - case SyntaxKind.FunctionExpression: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.MethodSignature: - case SyntaxKind.PropertySignature: - return true; - default: - return false; - } - } - - export function preComments(element: ISyntaxElement, text: ISimpleText): Comment[]{ - if (element) { - switch (element.kind()) { - case SyntaxKind.VariableStatement: - case SyntaxKind.ExpressionStatement: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ImportDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.IfStatement: - case SyntaxKind.SimplePropertyAssignment: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.ReturnStatement: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.EnumElement: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.PropertySignature: - case SyntaxKind.MethodSignature: - case SyntaxKind.FunctionPropertyAssignment: - case SyntaxKind.Parameter: - return convertNodeLeadingComments(element, text); - } - } - - return null; - } - - export function postComments(element: ISyntaxElement, text: ISimpleText): Comment[] { - if (element) { - switch (element.kind()) { - case SyntaxKind.ExpressionStatement: - return convertNodeTrailingComments(element, text, /*allowWithNewLine:*/ true); - case SyntaxKind.VariableStatement: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ImportDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.IfStatement: - case SyntaxKind.SimplePropertyAssignment: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.ReturnStatement: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.MemberVariableDeclaration: - case SyntaxKind.EnumElement: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.PropertySignature: - case SyntaxKind.MethodSignature: - case SyntaxKind.FunctionPropertyAssignment: - case SyntaxKind.Parameter: - return convertNodeTrailingComments(element, text); - } - } - - return null; - } - - function convertNodeTrailingComments(node: ISyntaxElement, text: ISimpleText, allowWithNewLine = false): Comment[]{ - // Bail out quickly before doing any expensive math computation. - var _lastToken = lastToken(node); - if (_lastToken === null || !_lastToken.hasTrailingTrivia()) { - return null; - } - - if (!allowWithNewLine && SyntaxUtilities.isLastTokenOnLine(_lastToken, text)) { - return null; - } - - return convertComments(_lastToken.trailingTrivia(text), fullStart(node) + fullWidth(node) - _lastToken.trailingTriviaWidth(text)); - } - - function convertNodeLeadingComments(element: ISyntaxElement, text: ISimpleText): Comment[]{ - if (element) { - return convertTokenLeadingComments(firstToken(element), text); - } - - return null; - } - - export function convertTokenLeadingComments(token: ISyntaxToken, text: ISimpleText): Comment[]{ - if (token === null) { - return null; - } - - return token.hasLeadingTrivia() - ? convertComments(token.leadingTrivia(text), token.fullStart()) - : null; - } - - export function convertTokenTrailingComments(token: ISyntaxToken, text: ISimpleText): Comment[] { - if (token === null) { - return null; - } - - return token.hasTrailingTrivia() - ? convertComments(token.trailingTrivia(text), fullEnd(token) - token.trailingTriviaWidth(text)) - : null; - } - - function convertComments(triviaList: ISyntaxTriviaList, commentStartPosition: number): Comment[]{ - var result: Comment[] = null; - - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result = result || []; - result.push(convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - - commentStartPosition += trivia.fullWidth(); - } - - return result; - } - - function convertComment(trivia: ISyntaxTrivia, commentStartPosition: number, hasTrailingNewLine: boolean): Comment { - var comment = new Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - - return comment; - } - - export function docComments(ast: ISyntaxElement, text: ISimpleText): Comment[] { - if (isDeclarationAST(ast)) { - var comments: Comment[] = null; - - if (ast.kind() === SyntaxKind.VariableDeclarator) { - // Get the doc comments for a variable off of the variable statement. That's what - // they'll be attached to in the tree. - comments = TypeScript.ASTHelpers.preComments(getVariableStatement(ast), text); - } - else if (ast.kind() === SyntaxKind.Parameter) { - // First check if the parameter was written like so: - // ( - // /** blah */ a, - // /** blah */ b); - comments = TypeScript.ASTHelpers.preComments(ast, text); - if (!comments) { - // Now check if it was written like so: - // (/** blah */ a, /** blah */ b); - // In this case, the comment will belong to the preceding token. - var previousToken = findToken(syntaxTree(ast).sourceUnit(), firstToken(ast).fullStart() - 1); - if (previousToken && (previousToken.kind() === SyntaxKind.OpenParenToken || previousToken.kind() === SyntaxKind.CommaToken)) { - comments = convertTokenTrailingComments(previousToken, text); - } - } - } - else { - comments = TypeScript.ASTHelpers.preComments(ast, text); - } - - if (comments && comments.length > 0) { - return comments.filter(c => isDocComment(c)); - } - } - - return sentinelEmptyArray; - } - - export function isDocComment(comment: Comment) { - if (comment.kind() === SyntaxKind.MultiLineCommentTrivia) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - - return false; - } - - export function getParameterList(ast: ISyntaxElement): ParameterListSyntax { - if (ast) { - switch (ast.kind()) { - case SyntaxKind.ConstructorDeclaration: - return getParameterList((ast).callSignature); - case SyntaxKind.FunctionDeclaration: - return getParameterList((ast).callSignature); - case SyntaxKind.ParenthesizedArrowFunctionExpression: - return getParameterList((ast).callSignature); - case SyntaxKind.ConstructSignature: - return getParameterList((ast).callSignature); - case SyntaxKind.MemberFunctionDeclaration: - return getParameterList((ast).callSignature); - case SyntaxKind.FunctionPropertyAssignment: - return getParameterList((ast).callSignature); - case SyntaxKind.FunctionExpression: - return getParameterList((ast).callSignature); - case SyntaxKind.MethodSignature: - return getParameterList((ast).callSignature); - case SyntaxKind.ConstructorType: - return (ast).parameterList; - case SyntaxKind.FunctionType: - return (ast).parameterList; - case SyntaxKind.CallSignature: - return (ast).parameterList; - case SyntaxKind.GetAccessor: - return getParameterList((ast).callSignature); - case SyntaxKind.SetAccessor: - return getParameterList((ast).callSignature); - } - } - - return null; - } - - export function getType(ast: ISyntaxElement): ITypeSyntax { - if (ast) { - switch (ast.kind()) { - case SyntaxKind.FunctionDeclaration: - return getType((ast).callSignature); - case SyntaxKind.ParenthesizedArrowFunctionExpression: - return getType((ast).callSignature); - case SyntaxKind.ConstructSignature: - return getType((ast).callSignature); - case SyntaxKind.MemberFunctionDeclaration: - return getType((ast).callSignature); - case SyntaxKind.FunctionPropertyAssignment: - return getType((ast).callSignature); - case SyntaxKind.FunctionExpression: - return getType((ast).callSignature); - case SyntaxKind.MethodSignature: - return getType((ast).callSignature); - case SyntaxKind.CallSignature: - return getType((ast).typeAnnotation); - case SyntaxKind.IndexSignature: - return getType((ast).typeAnnotation); - case SyntaxKind.PropertySignature: - return getType((ast).typeAnnotation); - case SyntaxKind.GetAccessor: - return getType((ast).callSignature); - case SyntaxKind.Parameter: - return getType((ast).typeAnnotation); - case SyntaxKind.MemberVariableDeclaration: - return getType((ast).variableDeclarator); - case SyntaxKind.VariableDeclarator: - return getType((ast).typeAnnotation); - case SyntaxKind.CatchClause: - return getType((ast).typeAnnotation); - case SyntaxKind.ConstructorType: - return (ast).type; - case SyntaxKind.FunctionType: - return (ast).type; - case SyntaxKind.TypeAnnotation: - return (ast).type; - } - } - - return null; - } - - function getVariableStatement(variableDeclarator: VariableDeclaratorSyntax): VariableStatementSyntax { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && - variableDeclarator.parent.kind() === SyntaxKind.SeparatedList && - variableDeclarator.parent.parent.kind() === SyntaxKind.VariableDeclaration && - variableDeclarator.parent.parent.parent.kind() === SyntaxKind.VariableStatement) { - - return variableDeclarator.parent.parent.parent; - } - - return null; - } - - export function getVariableDeclaratorModifiers(variableDeclarator: VariableDeclaratorSyntax): ISyntaxToken[] { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : Syntax.emptyList(); - } - - export function isIntegerLiteralAST(expression: ISyntaxElement): boolean { - if (expression) { - switch (expression.kind()) { - case SyntaxKind.PlusExpression: - case SyntaxKind.NegateExpression: - // Note: if there is a + or - sign, we can only allow a normal integer following - // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a - // *literal*. - expression = (expression).operand; - return expression.kind() === SyntaxKind.NumericLiteral && IntegerUtilities.isInteger((expression).text()); - - case SyntaxKind.NumericLiteral: - // If it doesn't have a + or -, then either an integer literal or a hex literal - // is acceptable. - var text = (expression).text(); - return IntegerUtilities.isInteger(text) || IntegerUtilities.isHexInteger(text); - } - } - - return false; - } - - export function getEnclosingModuleDeclaration(ast: ISyntaxElement): ModuleDeclarationSyntax { - while (ast) { - if (ast.kind() === SyntaxKind.ModuleDeclaration) { - return ast; - } - - ast = ast.parent; - } - - return null; - } - - function isEntireNameOfModuleDeclaration(nameAST: ISyntaxElement) { - return parentIsModuleDeclaration(nameAST) && (nameAST.parent).name === nameAST; - } - - export function getModuleDeclarationFromNameAST(ast: ISyntaxElement): ModuleDeclarationSyntax { - if (ast) { - switch (ast.kind()) { - case SyntaxKind.StringLiteral: - if (parentIsModuleDeclaration(ast) && (ast.parent).stringLiteral === ast) { - return ast.parent; - } - return null; - - case SyntaxKind.IdentifierName: - case SyntaxKind.QualifiedName: - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - break; - - default: - return null; - } - - // Only qualified names can be name of module declaration if they didnt satisfy above conditions - for (ast = ast.parent; ast && ast.kind() === SyntaxKind.QualifiedName; ast = ast.parent) { - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - } - } - - return null; - } - - export function isLastNameOfModule(ast: ModuleDeclarationSyntax, astName: ISyntaxElement): boolean { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } - else if (ast.name.kind() === SyntaxKind.QualifiedName) { - return astName === (ast.name).right; - } - else { - return astName === ast.name; - } - } - - return false; - } - - export function getNameOfIdentifierOrQualifiedName(name: ISyntaxElement): string { - if (name.kind() === SyntaxKind.IdentifierName) { - return (name).text(); - } - else { - Debug.assert(name.kind() == SyntaxKind.QualifiedName); - var dotExpr = name; - return getNameOfIdentifierOrQualifiedName(dotExpr.left) + "." + getNameOfIdentifierOrQualifiedName(dotExpr.right); - } - } - - export function getModuleNames(name: ISyntaxElement, result?: ISyntaxToken[]): ISyntaxToken[] { - result = result || []; - - if (name.kind() === SyntaxKind.QualifiedName) { - getModuleNames((name).left, result); - result.push((name).right); - } - else { - result.push(name); - } - - return result; - } -} \ No newline at end of file diff --git a/src/services/compiler/astWalker.ts b/src/services/compiler/astWalker.ts index 9f6897c4e1e..e69de29bb2d 100644 --- a/src/services/compiler/astWalker.ts +++ b/src/services/compiler/astWalker.ts @@ -1,721 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript { - function walkListChildren(preAst: ISyntaxNodeOrToken[], walker: AstWalker): void { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - - function walkThrowStatementChildren(preAst: ThrowStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkPrefixUnaryExpressionChildren(preAst: PrefixUnaryExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.operand); - } - - function walkPostfixUnaryExpressionChildren(preAst: PostfixUnaryExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.operand); - } - - function walkDeleteExpressionChildren(preAst: DeleteExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkTypeArgumentListChildren(preAst: TypeArgumentListSyntax, walker: AstWalker): void { - walker.walk(preAst.typeArguments); - } - - function walkTupleTypeChildren(preAst: TupleTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.types); - } - - function walkTypeOfExpressionChildren(preAst: TypeOfExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkVoidExpressionChildren(preAst: VoidExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkArgumentListChildren(preAst: ArgumentListSyntax, walker: AstWalker): void { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - - function walkArrayLiteralExpressionChildren(preAst: ArrayLiteralExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expressions); - } - - function walkSimplePropertyAssignmentChildren(preAst: SimplePropertyAssignmentSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - - function walkFunctionPropertyAssignmentChildren(preAst: FunctionPropertyAssignmentSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkGetAccessorChildren(preAst: GetAccessorSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkSeparatedListChildren(preAst: ISyntaxNodeOrToken[], walker: AstWalker): void { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - - function walkSetAccessorChildren(preAst: SetAccessorSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkObjectLiteralExpressionChildren(preAst: ObjectLiteralExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyAssignments); - } - - function walkCastExpressionChildren(preAst: CastExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - - function walkParenthesizedExpressionChildren(preAst: ParenthesizedExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkElementAccessExpressionChildren(preAst: ElementAccessExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - - function walkMemberAccessExpressionChildren(preAst: MemberAccessExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - - function walkQualifiedNameChildren(preAst: QualifiedNameSyntax, walker: AstWalker): void { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkBinaryExpressionChildren(preAst: BinaryExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkEqualsValueClauseChildren(preAst: EqualsValueClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.value); - } - - function walkTypeParameterChildren(preAst: TypeParameterSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - - function walkTypeParameterListChildren(preAst: TypeParameterListSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameters); - } - - function walkGenericTypeChildren(preAst: GenericTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - - function walkTypeAnnotationChildren(preAst: TypeAnnotationSyntax, walker: AstWalker): void { - walker.walk(preAst.type); - } - - function walkTypeQueryChildren(preAst: TypeQuerySyntax, walker: AstWalker): void { - walker.walk(preAst.name); - } - - function walkInvocationExpressionChildren(preAst: InvocationExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkObjectCreationExpressionChildren(preAst: ObjectCreationExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkTrinaryExpressionChildren(preAst: ConditionalExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - - function walkFunctionExpressionChildren(preAst: FunctionExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFunctionTypeChildren(preAst: FunctionTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkParenthesizedArrowFunctionExpressionChildren(preAst: ParenthesizedArrowFunctionExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkSimpleArrowFunctionExpressionChildren(preAst: SimpleArrowFunctionExpressionSyntax, walker: AstWalker): void { - walker.walk(preAst.parameter); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkMemberFunctionDeclarationChildren(preAst: MemberFunctionDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFuncDeclChildren(preAst: FunctionDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkIndexMemberDeclarationChildren(preAst: IndexMemberDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.indexSignature); - } - - function walkIndexSignatureChildren(preAst: IndexSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.parameters); - walker.walk(preAst.typeAnnotation); - } - - function walkCallSignatureChildren(preAst: CallSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - - function walkConstraintChildren(preAst: ConstraintSyntax, walker: AstWalker): void { - walker.walk(preAst.typeOrExpression); - } - - function walkConstructorDeclarationChildren(preAst: ConstructorDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkConstructorTypeChildren(preAst: FunctionTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkConstructSignatureChildren(preAst: ConstructSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.callSignature); - } - - function walkParameterChildren(preAst: ParameterSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkParameterListChildren(preAst: ParameterListSyntax, walker: AstWalker): void { - walker.walk(preAst.parameters); - } - - function walkPropertySignatureChildren(preAst: PropertySignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - - function walkVariableDeclaratorChildren(preAst: VariableDeclaratorSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkMemberVariableDeclarationChildren(preAst: MemberVariableDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclarator); - } - - function walkMethodSignatureChildren(preAst: MethodSignatureSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - - function walkReturnStatementChildren(preAst: ReturnStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkForStatementChildren(preAst: ForStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - - function walkForInStatementChildren(preAst: ForInStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - - function walkIfStatementChildren(preAst: IfStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - - function walkElseClauseChildren(preAst: ElseClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.statement); - } - - function walkWhileStatementChildren(preAst: WhileStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkDoStatementChildren(preAst: DoStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkBlockChildren(preAst: BlockSyntax, walker: AstWalker): void { - walker.walk(preAst.statements); - } - - function walkVariableDeclarationChildren(preAst: VariableDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclarators); - } - - function walkCaseSwitchClauseChildren(preAst: CaseSwitchClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - - function walkDefaultSwitchClauseChildren(preAst: DefaultSwitchClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.statements); - } - - function walkSwitchStatementChildren(preAst: SwitchStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - - function walkTryStatementChildren(preAst: TryStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - - function walkCatchClauseChildren(preAst: CatchClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - - function walkExternalModuleReferenceChildren(preAst: ExternalModuleReferenceSyntax, walker: AstWalker): void { - walker.walk(preAst.stringLiteral); - } - - function walkFinallyClauseChildren(preAst: FinallyClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.block); - } - - function walkClassDeclChildren(preAst: ClassDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - - function walkScriptChildren(preAst: SourceUnitSyntax, walker: AstWalker): void { - walker.walk(preAst.moduleElements); - } - - function walkHeritageClauseChildren(preAst: HeritageClauseSyntax, walker: AstWalker): void { - walker.walk(preAst.typeNames); - } - - function walkInterfaceDeclerationChildren(preAst: InterfaceDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - - function walkObjectTypeChildren(preAst: ObjectTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.typeMembers); - } - - function walkArrayTypeChildren(preAst: ArrayTypeSyntax, walker: AstWalker): void { - walker.walk(preAst.type); - } - - function walkModuleDeclarationChildren(preAst: ModuleDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - - function walkModuleNameModuleReferenceChildren(preAst: ModuleNameModuleReferenceSyntax, walker: AstWalker): void { - walker.walk(preAst.moduleName); - } - - function walkEnumDeclarationChildren(preAst: EnumDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - - function walkEnumElementChildren(preAst: EnumElementSyntax, walker: AstWalker): void { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - - function walkImportDeclarationChildren(preAst: ImportDeclarationSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - - function walkExportAssignmentChildren(preAst: ExportAssignmentSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - } - - function walkWithStatementChildren(preAst: WithStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkExpressionStatementChildren(preAst: ExpressionStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.expression); - } - - function walkLabeledStatementChildren(preAst: LabeledStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - - function walkVariableStatementChildren(preAst: VariableStatementSyntax, walker: AstWalker): void { - walker.walk(preAst.variableDeclaration); - } - - var childrenWalkers: IAstWalkChildren[] = new Array(SyntaxKind.LastNode + 1); - - // Tokens/trivia can't ever be walked into. - for (var i = SyntaxKind.FirstToken, n = SyntaxKind.LastToken; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = SyntaxKind.FirstTrivia, n = SyntaxKind.LastTrivia; i <= n; i++) { - childrenWalkers[i] = null; - } - - childrenWalkers[SyntaxKind.AddAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.AddExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.AndAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.AnyKeyword] = null; - childrenWalkers[SyntaxKind.ArgumentList] = walkArgumentListChildren; - childrenWalkers[SyntaxKind.ArrayLiteralExpression] = walkArrayLiteralExpressionChildren; - childrenWalkers[SyntaxKind.ArrayType] = walkArrayTypeChildren; - childrenWalkers[SyntaxKind.SimpleArrowFunctionExpression] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[SyntaxKind.ParenthesizedArrowFunctionExpression] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[SyntaxKind.AssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseAndExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseExclusiveOrExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseNotExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.BitwiseOrExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.Block] = walkBlockChildren; - childrenWalkers[SyntaxKind.BooleanKeyword] = null; - childrenWalkers[SyntaxKind.BreakStatement] = null; - childrenWalkers[SyntaxKind.CallSignature] = walkCallSignatureChildren; - childrenWalkers[SyntaxKind.CaseSwitchClause] = walkCaseSwitchClauseChildren; - childrenWalkers[SyntaxKind.CastExpression] = walkCastExpressionChildren; - childrenWalkers[SyntaxKind.CatchClause] = walkCatchClauseChildren; - childrenWalkers[SyntaxKind.ClassDeclaration] = walkClassDeclChildren; - childrenWalkers[SyntaxKind.CommaExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ConditionalExpression] = walkTrinaryExpressionChildren; - childrenWalkers[SyntaxKind.Constraint] = walkConstraintChildren; - childrenWalkers[SyntaxKind.ConstructorDeclaration] = walkConstructorDeclarationChildren; - childrenWalkers[SyntaxKind.ConstructSignature] = walkConstructSignatureChildren; - childrenWalkers[SyntaxKind.ContinueStatement] = null; - childrenWalkers[SyntaxKind.ConstructorType] = walkConstructorTypeChildren; - childrenWalkers[SyntaxKind.DebuggerStatement] = null; - childrenWalkers[SyntaxKind.DefaultSwitchClause] = walkDefaultSwitchClauseChildren; - childrenWalkers[SyntaxKind.DeleteExpression] = walkDeleteExpressionChildren; - childrenWalkers[SyntaxKind.DivideAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.DivideExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.DoStatement] = walkDoStatementChildren; - childrenWalkers[SyntaxKind.ElementAccessExpression] = walkElementAccessExpressionChildren; - childrenWalkers[SyntaxKind.ElseClause] = walkElseClauseChildren; - childrenWalkers[SyntaxKind.EmptyStatement] = null; - childrenWalkers[SyntaxKind.EnumDeclaration] = walkEnumDeclarationChildren; - childrenWalkers[SyntaxKind.EnumElement] = walkEnumElementChildren; - childrenWalkers[SyntaxKind.EqualsExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.EqualsValueClause] = walkEqualsValueClauseChildren; - childrenWalkers[SyntaxKind.EqualsWithTypeConversionExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ExclusiveOrAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ExportAssignment] = walkExportAssignmentChildren; - childrenWalkers[SyntaxKind.ExpressionStatement] = walkExpressionStatementChildren; - childrenWalkers[SyntaxKind.ExtendsHeritageClause] = walkHeritageClauseChildren; - childrenWalkers[SyntaxKind.ExternalModuleReference] = walkExternalModuleReferenceChildren; - childrenWalkers[SyntaxKind.FalseKeyword] = null; - childrenWalkers[SyntaxKind.FinallyClause] = walkFinallyClauseChildren; - childrenWalkers[SyntaxKind.ForInStatement] = walkForInStatementChildren; - childrenWalkers[SyntaxKind.ForStatement] = walkForStatementChildren; - childrenWalkers[SyntaxKind.FunctionDeclaration] = walkFuncDeclChildren; - childrenWalkers[SyntaxKind.FunctionExpression] = walkFunctionExpressionChildren; - childrenWalkers[SyntaxKind.FunctionPropertyAssignment] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[SyntaxKind.FunctionType] = walkFunctionTypeChildren; - childrenWalkers[SyntaxKind.GenericType] = walkGenericTypeChildren; - childrenWalkers[SyntaxKind.GetAccessor] = walkGetAccessorChildren; - childrenWalkers[SyntaxKind.GreaterThanExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.GreaterThanOrEqualExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.IfStatement] = walkIfStatementChildren; - childrenWalkers[SyntaxKind.ImplementsHeritageClause] = walkHeritageClauseChildren; - childrenWalkers[SyntaxKind.ImportDeclaration] = walkImportDeclarationChildren; - childrenWalkers[SyntaxKind.IndexMemberDeclaration] = walkIndexMemberDeclarationChildren; - childrenWalkers[SyntaxKind.IndexSignature] = walkIndexSignatureChildren; - childrenWalkers[SyntaxKind.InExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.InstanceOfExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.InterfaceDeclaration] = walkInterfaceDeclerationChildren; - childrenWalkers[SyntaxKind.InvocationExpression] = walkInvocationExpressionChildren; - childrenWalkers[SyntaxKind.LabeledStatement] = walkLabeledStatementChildren; - childrenWalkers[SyntaxKind.LeftShiftAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LeftShiftExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LessThanExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LessThanOrEqualExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.List] = walkListChildren; - childrenWalkers[SyntaxKind.LogicalAndExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.LogicalNotExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.LogicalOrExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.MemberAccessExpression] = walkMemberAccessExpressionChildren; - childrenWalkers[SyntaxKind.MemberFunctionDeclaration] = walkMemberFunctionDeclarationChildren; - childrenWalkers[SyntaxKind.MemberVariableDeclaration] = walkMemberVariableDeclarationChildren; - childrenWalkers[SyntaxKind.MethodSignature] = walkMethodSignatureChildren; - childrenWalkers[SyntaxKind.ModuleDeclaration] = walkModuleDeclarationChildren; - childrenWalkers[SyntaxKind.ModuleNameModuleReference] = walkModuleNameModuleReferenceChildren; - childrenWalkers[SyntaxKind.ModuloAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.ModuloExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.MultiplyAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.MultiplyExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.IdentifierName] = null; - childrenWalkers[SyntaxKind.NegateExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.None] = null; - childrenWalkers[SyntaxKind.NotEqualsExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.NotEqualsWithTypeConversionExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.NullKeyword] = null; - childrenWalkers[SyntaxKind.NumberKeyword] = null; - childrenWalkers[SyntaxKind.NumericLiteral] = null; - childrenWalkers[SyntaxKind.ObjectCreationExpression] = walkObjectCreationExpressionChildren; - childrenWalkers[SyntaxKind.ObjectLiteralExpression] = walkObjectLiteralExpressionChildren; - childrenWalkers[SyntaxKind.ObjectType] = walkObjectTypeChildren; - childrenWalkers[SyntaxKind.OmittedExpression] = null; - childrenWalkers[SyntaxKind.OrAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.Parameter] = walkParameterChildren; - childrenWalkers[SyntaxKind.ParameterList] = walkParameterListChildren; - childrenWalkers[SyntaxKind.ParenthesizedExpression] = walkParenthesizedExpressionChildren; - childrenWalkers[SyntaxKind.PlusExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PostDecrementExpression] = walkPostfixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PostIncrementExpression] = walkPostfixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PreDecrementExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PreIncrementExpression] = walkPrefixUnaryExpressionChildren; - childrenWalkers[SyntaxKind.PropertySignature] = walkPropertySignatureChildren; - childrenWalkers[SyntaxKind.QualifiedName] = walkQualifiedNameChildren; - childrenWalkers[SyntaxKind.RegularExpressionLiteral] = null; - childrenWalkers[SyntaxKind.ReturnStatement] = walkReturnStatementChildren; - childrenWalkers[SyntaxKind.SourceUnit] = walkScriptChildren; - childrenWalkers[SyntaxKind.SeparatedList] = walkSeparatedListChildren; - childrenWalkers[SyntaxKind.SetAccessor] = walkSetAccessorChildren; - childrenWalkers[SyntaxKind.SignedRightShiftAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SignedRightShiftExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SimplePropertyAssignment] = walkSimplePropertyAssignmentChildren; - childrenWalkers[SyntaxKind.StringLiteral] = null; - childrenWalkers[SyntaxKind.StringKeyword] = null; - childrenWalkers[SyntaxKind.SubtractAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SubtractExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.SuperKeyword] = null; - childrenWalkers[SyntaxKind.SwitchStatement] = walkSwitchStatementChildren; - childrenWalkers[SyntaxKind.ThisKeyword] = null; - childrenWalkers[SyntaxKind.ThrowStatement] = walkThrowStatementChildren; - childrenWalkers[SyntaxKind.TriviaList] = null; - childrenWalkers[SyntaxKind.TrueKeyword] = null; - childrenWalkers[SyntaxKind.TryStatement] = walkTryStatementChildren; - childrenWalkers[SyntaxKind.TupleType] = walkTupleTypeChildren; - childrenWalkers[SyntaxKind.TypeAnnotation] = walkTypeAnnotationChildren; - childrenWalkers[SyntaxKind.TypeArgumentList] = walkTypeArgumentListChildren; - childrenWalkers[SyntaxKind.TypeOfExpression] = walkTypeOfExpressionChildren; - childrenWalkers[SyntaxKind.TypeParameter] = walkTypeParameterChildren; - childrenWalkers[SyntaxKind.TypeParameterList] = walkTypeParameterListChildren; - childrenWalkers[SyntaxKind.TypeQuery] = walkTypeQueryChildren; - childrenWalkers[SyntaxKind.UnsignedRightShiftAssignmentExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.UnsignedRightShiftExpression] = walkBinaryExpressionChildren; - childrenWalkers[SyntaxKind.VariableDeclaration] = walkVariableDeclarationChildren; - childrenWalkers[SyntaxKind.VariableDeclarator] = walkVariableDeclaratorChildren; - childrenWalkers[SyntaxKind.VariableStatement] = walkVariableStatementChildren; - childrenWalkers[SyntaxKind.VoidExpression] = walkVoidExpressionChildren; - childrenWalkers[SyntaxKind.VoidKeyword] = null; - childrenWalkers[SyntaxKind.WhileStatement] = walkWhileStatementChildren; - childrenWalkers[SyntaxKind.WithStatement] = walkWithStatementChildren; - - // Verify the code is up to date with the enum - for (var e in SyntaxKind) { - if (SyntaxKind.hasOwnProperty(e) && StringUtilities.isString(SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + SyntaxKind[e]); - } - } - - export class AstWalkOptions { - public goChildren = true; - public stopWalking = false; - } - - interface IAstWalkChildren { - (preAst: ISyntaxElement, walker: AstWalker): void; - } - - export interface IAstWalker { - options: AstWalkOptions; - state: any - } - - interface AstWalker { - walk(ast: ISyntaxElement): void; - } - - class SimplePreAstWalker implements AstWalker { - public options: AstWalkOptions = new AstWalkOptions(); - - constructor( - private pre: (ast: ISyntaxElement, state: any) => void, - public state: any) { - } - - public walk(ast: ISyntaxElement): void { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - } - - class SimplePrePostAstWalker implements AstWalker { - public options: AstWalkOptions = new AstWalkOptions(); - - constructor( - private pre: (ast: ISyntaxElement, state: any) => void, - private post: (ast: ISyntaxElement, state: any) => void, - public state: any) { - } - - public walk(ast: ISyntaxElement): void { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - - this.post(ast, this.state); - } - } - - class NormalAstWalker implements AstWalker { - public options: AstWalkOptions = new AstWalkOptions(); - - constructor( - private pre: (ast: ISyntaxElement, walker: IAstWalker) => void, - private post: (ast: ISyntaxElement, walker: IAstWalker) => void, - public state: any) { - } - - public walk(ast: ISyntaxElement): void { - if (!ast) { - return; - } - - // If we're stopping, then bail out immediately. - if (this.options.stopWalking) { - return; - } - - this.pre(ast, this); - - // If we were asked to stop, then stop. - if (this.options.stopWalking) { - return; - } - - if (this.options.goChildren) { - // Call the "walkChildren" function corresponding to "nodeType". - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - else { - // no go only applies to children of node issuing it - this.options.goChildren = true; - } - - if (this.post) { - this.post(ast, this); - } - } - } - - export class AstWalkerFactory { - public walk(ast: ISyntaxElement, pre: (ast: ISyntaxElement, walker: IAstWalker) => void, post?: (ast: ISyntaxElement, walker: IAstWalker) => void, state?: any): void { - new NormalAstWalker(pre, post, state).walk(ast); - } - - public simpleWalk(ast: ISyntaxElement, pre: (ast: ISyntaxElement, state: any) => void, post?: (ast: ISyntaxElement, state: any) => void, state?: any): void { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } - else { - new SimplePreAstWalker(pre, state).walk(ast); - } - } - } - - var globalAstWalkerFactory = new AstWalkerFactory(); - - export function getAstWalkerFactory(): AstWalkerFactory { - return globalAstWalkerFactory; - } -} \ No newline at end of file diff --git a/src/services/compiler/pathUtils.ts b/src/services/compiler/pathUtils.ts index 3868881fc75..88aa3e4f30c 100644 --- a/src/services/compiler/pathUtils.ts +++ b/src/services/compiler/pathUtils.ts @@ -16,56 +16,6 @@ /// module TypeScript { - export function stripStartAndEndQuotes(str: string) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { - return str.substring(1, str.length - 1); - } - - return str; - } - - export function isSingleQuoted(str: string) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === CharacterCodes.singleQuote; - } - - export function isDoubleQuoted(str: string) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === CharacterCodes.doubleQuote; - } - - export function isQuoted(str: string) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - - export function quoteStr(str: string) { - return "\"" + str + "\""; - } - - var switchToForwardSlashesRegEx = /\\/g; - export function switchToForwardSlashes(path: string) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - - export function trimModName(modName: string) { - // in case's it's a declare file... - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - // in case's it's a .js file - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - - return modName; - } - - export function getDeclareFilePath(fname: string) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - function isFileOfExtension(fname: string, ext: string) { var invariantFname = fname.toLocaleUpperCase(); var invariantExt = ext.toLocaleUpperCase(); @@ -73,121 +23,7 @@ module TypeScript { return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; } - export function isTSFile(fname: string) { - return isFileOfExtension(fname, ".ts"); - } - export function isDTSFile(fname: string) { return isFileOfExtension(fname, ".d.ts"); } - - export function getPrettyName(modPath: string, quote=true, treatAsFileName=false): any { - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - - export function getPathComponents(path: string) { - return path.split("/"); - } - - export function getRelativePathToFixedPath(fixedModFilePath: string, absoluteModPath: string, isAbsoultePathURL = true) { - absoluteModPath = switchToForwardSlashes(absoluteModPath); - - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - - // Find the component that differs - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length ; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - - // Get the relative path - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - - return relativePath + relativePathComponents.join("/"); - } - - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - - return absoluteModPath; - } - - export function changePathToDTS(modPath: string) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - - export function isRelative(path: string) { - return path.length > 0 && path.charAt(0) === "."; - } - export function isRooted(path: string) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - - export function getRootFilePath(outFname: string) { - if (outFname === "") { - return outFname; - } - else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - - export function filePathComponents(fullPath: string) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - - export function filePath(fullPath: string) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - - export function convertToDirectoryPath(dirPath: string) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - - return dirPath; - } - - var normalizePathRegEx = /^\\\\[^\\]/; - export function normalizePath(path: string): string { - // If it's a UNC style path (i.e. \\server\share), convert to a URI style (i.e. file://server/share) - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = this.getPathComponents(switchToForwardSlashes(path)); - var normalizedParts: string[] = []; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - - if (normalizedParts.length > 0 && ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - - normalizedParts.push(part); - } - - return normalizedParts.join("/"); - } } \ No newline at end of file diff --git a/src/services/compiler/precompile.ts b/src/services/compiler/precompile.ts deleted file mode 100644 index 08a919a65b5..00000000000 --- a/src/services/compiler/precompile.ts +++ /dev/null @@ -1,208 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -module TypeScript { - export interface ILineAndCharacter { - line: number; - character: number; - } - - // Note: This is being using by the host (VS) and is marshaled back and forth. When changing this make sure the changes - // are reflected in the managed side as well. - export interface IFileReference extends ILineAndCharacter { - path: string; - isResident: boolean; - position: number; - length: number; - } - - /// - /// Preprocessing - /// - export interface IPreProcessedFileInfo { - referencedFiles: IFileReference[]; - importedFiles: IFileReference[]; - diagnostics: Diagnostic[]; - isLibFile: boolean; - } - - interface ITripleSlashDirectiveProperties { - noDefaultLib: boolean; - diagnostics: Diagnostic[]; - referencedFiles: IFileReference[]; - } - - function isNoDefaultLibMatch(comment: string): RegExpExecArray { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - - export var tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - - function getFileReferenceFromReferencePath(fileName: string, text: ISimpleText, position: number, comment: string, diagnostics: Diagnostic[]): IFileReference { - // First, just see if they've written: /// = 7 && fullReference[6] === "true"; - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: switchToForwardSlashes(adjustedPath), - isResident: isResident - }; - } - } - } - - return null; - } - - var reportDiagnostic = () => { }; - - function processImports(text: ISimpleText, scanner: Scanner.IScanner, token: ISyntaxToken, importedFiles: IFileReference[]): void { - var lineChar = { line: -1, character: -1 }; - - var lineMap = text.lineMap(); - var start = new Date().getTime(); - // Look for: - // import foo = module("foo") - while (token.kind() !== SyntaxKind.EndOfFileToken) { - if (token.kind() === SyntaxKind.ImportKeyword) { - var importToken = token; - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (token.kind() === SyntaxKind.EqualsToken) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (token.kind() === SyntaxKind.ModuleKeyword || token.kind() === SyntaxKind.RequireKeyword) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - if (token.kind() === SyntaxKind.OpenParenToken) { - token = scanner.scan(/*allowRegularExpression:*/ false); - - lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - - if (token.kind() === SyntaxKind.StringLiteral) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: TypeScript.start(token, text), - length: width(token), - path: stripStartAndEndQuotes(switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } - } - } - } - } - } - - token = scanner.scan(/*allowRegularExpression:*/ false); - } - - var totalTime = new Date().getTime() - start; - //TypeScript.fileResolutionScanImportsTime += totalTime; - } - - function processTripleSlashDirectives(fileName: string, text: ISimpleText, firstToken: ISyntaxToken): ITripleSlashDirectiveProperties { - var leadingTrivia = firstToken.leadingTrivia(text); - - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics: Diagnostic[] = []; - var referencedFiles: IFileReference[] = []; - var lineMap = text.lineMap(); - - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - - if (trivia.kind() === SyntaxKind.SingleLineCommentTrivia) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); - - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - - referencedFiles.push(referencedCode); - } - - // is it a lib file? - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; - } - } - - position += trivia.fullWidth(); - } - - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - - export function preProcessFile(fileName: string, sourceText: IScriptSnapshot, readImportFiles = true): IPreProcessedFileInfo { - var text = SimpleText.fromScriptSnapshot(sourceText); - var scanner = Scanner.createScanner(ts.ScriptTarget.Latest, text, reportDiagnostic); - - var firstToken = scanner.scan(/*allowRegularExpression:*/ false); - - // only search out dynamic mods - // if you find a dynamic mod, ignore every other mod inside, until you balance rcurlies - // var position - - var importedFiles: IFileReference[] = []; - if (readImportFiles) { - processImports(text, scanner, firstToken, importedFiles); - } - - var properties = processTripleSlashDirectives(fileName, text, firstToken); - - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - - export function getReferencedFiles(fileName: string, sourceText: IScriptSnapshot): IFileReference[] { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } -} // Tools \ No newline at end of file diff --git a/src/services/core/arrayUtilities.ts b/src/services/core/arrayUtilities.ts index 4bfec137664..cfb9a1fd4a2 100644 --- a/src/services/core/arrayUtilities.ts +++ b/src/services/core/arrayUtilities.ts @@ -7,7 +7,7 @@ module TypeScript { return true; } - if (array1 === null || array2 === null) { + if (!array1 || !array2) { return false; } @@ -71,7 +71,7 @@ module TypeScript { } } - return null; + return undefined; } public static firstOrDefault(array: T[], func: (v: T, index: number) => boolean): T { @@ -82,7 +82,7 @@ module TypeScript { } } - return null; + return undefined; } public static first(array: T[], func?: (v: T, index: number) => boolean): T { diff --git a/src/services/core/debug.ts b/src/services/core/debug.ts index e57f9745353..d9e20c27870 100644 --- a/src/services/core/debug.ts +++ b/src/services/core/debug.ts @@ -14,13 +14,14 @@ module TypeScript { return this.currentAssertionLevel >= level; } - public static assert(expression: any, message: string = "", verboseDebugInfo: () => string = null): void { + public static assert(expression: any, message?: string, verboseDebugInfo?: () => string): void { if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); } + message = message || ""; throw new Error("Debug Failure. False expression: " + message + verboseDebugString); } } diff --git a/src/services/core/diagnosticCore.ts b/src/services/core/diagnosticCore.ts index 369b8114eac..5b860dcd31f 100644 --- a/src/services/core/diagnosticCore.ts +++ b/src/services/core/diagnosticCore.ts @@ -50,11 +50,11 @@ module TypeScript { private _arguments: any[]; private _additionalLocations: Location[]; - constructor(fileName: string, lineMap: LineMap, start: number, length: number, diagnosticKey: string, _arguments: any[]= null, additionalLocations: Location[] = null) { + constructor(fileName: string, lineMap: LineMap, start: number, length: number, diagnosticKey: string, _arguments?: any[], additionalLocations?: Location[]) { super(fileName, lineMap, start, length); this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; + this._arguments = (_arguments && _arguments.length > 0) ? _arguments : undefined; + this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : undefined; } public toJSON(key: any): any { diff --git a/src/services/core/lineMap.ts b/src/services/core/lineMap.ts index 8820f55b920..947a4fb0bb2 100644 --- a/src/services/core/lineMap.ts +++ b/src/services/core/lineMap.ts @@ -1,9 +1,14 @@ /// module TypeScript { + export interface ILineAndCharacter { + line: number; + character: number; + } + export class LineMap { public static empty = new LineMap(() => [0], 0); - private _lineStarts: number[] = null; + private _lineStarts: number[] = undefined; constructor(private _computeLineStarts: () => number[], private length: number) { } @@ -18,7 +23,7 @@ module TypeScript { } public lineStarts(): number[] { - if (this._lineStarts === null) { + if (!this._lineStarts) { this._lineStarts = this._computeLineStarts(); } diff --git a/src/services/formatting.ts b/src/services/formatting.ts new file mode 100644 index 00000000000..dbe85fc4c64 --- /dev/null +++ b/src/services/formatting.ts @@ -0,0 +1,953 @@ +/// +/// +/// +/// + +module ts.formatting { + + export interface TextRangeWithKind extends TextRange { + kind: SyntaxKind; + } + + export interface TokenInfo { + leadingTrivia: TextRangeWithKind[]; + token: TextRangeWithKind; + trailingTrivia: TextRangeWithKind[]; + } + + const enum Constants { + Unknown = -1 + } + + /* + * Indentation for the scope that can be dynamically recomputed. + * i.e + * while(true) + * { var x; + * } + * Normally indentation is applied only to the first token in line so at glance 'var' should not be touched. + * However if some format rule adds new line between '}' and 'var' 'var' will become + * the first token in line so it should be indented + */ + interface DynamicIndentation { + getIndentationForToken(tokenLine: number, tokenKind: SyntaxKind): number; + getIndentationForComment(owningToken: SyntaxKind): number; + /** + * Indentation for open and close tokens of the node if it is block or another node that needs special indentation + * ... { + * ......... + * ....} + * ____ - indentation + * ____ - delta + **/ + getIndentation(): number; + /** + * Prefered relative indentation for child nodes. + * Delta is used to carry the indentation info + * foo(bar({ + * $ + * })) + * Both 'foo', 'bar' introduce new indentation with delta = 4, but total indentation in $ is not 8. + * foo: { indentation: 0, delta: 4 } + * bar: { indentation: foo.indentation + foo.delta = 4, delta: 4} however 'foo' and 'bar' are on the same line + * so bar inherits indentation from foo and bar.delta will be 4 + * + */ + getDelta(): number; + /** + * Formatter calls this function when rule adds or deletes new lines from the text + * so indentation scope can adjust values of indentation and delta. + */ + recomputeIndentation(lineAddedByFormatting: boolean): void; + } + + interface Indentation { + indentation: number; + delta: number + } + + export function formatOnEnter(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + Debug.assert(line >= 2); + // get the span for the previous\current line + var span = { + // get start position for the previous line + pos: getStartPositionOfLine(line - 1, sourceFile), + // get end position for the current line (end value is exclusive so add 1 to the result) + end: getEndLinePosition(line, sourceFile) + 1 + } + return formatSpan(span, sourceFile, options, rulesProvider, FormattingRequestKind.FormatOnEnter); + } + + export function formatOnSemicolon(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + return formatOutermostParent(position, SyntaxKind.SemicolonToken, sourceFile, options, rulesProvider, FormattingRequestKind.FormatOnSemicolon); + } + + export function formatOnClosingCurly(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + return formatOutermostParent(position, SyntaxKind.CloseBraceToken, sourceFile, options, rulesProvider, FormattingRequestKind.FormatOnClosingCurlyBrace); + } + + export function formatDocument(sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + var span = { + pos: 0, + end: sourceFile.text.length + }; + return formatSpan(span, sourceFile, options, rulesProvider, FormattingRequestKind.FormatDocument); + } + + export function formatSelection(start: number, end: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { + // format from the beginning of the line + var span = { + pos: getStartLinePositionForPosition(start, sourceFile), + end: end + }; + return formatSpan(span, sourceFile, options, rulesProvider, FormattingRequestKind.FormatSelection); + } + + function formatOutermostParent(position: number, expectedLastToken: SyntaxKind, sourceFile: SourceFile, options: FormatCodeOptions, rulesProvider: RulesProvider, requestKind: FormattingRequestKind): TextChange[] { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { + return []; + } + var span = { + pos: getStartLinePositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end + }; + return formatSpan(span, sourceFile, options, rulesProvider, requestKind); + } + + function findOutermostParent(position: number, expectedTokenKind: SyntaxKind, sourceFile: SourceFile): Node { + var precedingToken = findPrecedingToken(position, sourceFile); + if (!precedingToken || precedingToken.kind !== expectedTokenKind) { + return undefined; + } + + // walk up and search for the parent node that ends at the same position with precedingToken. + // for cases like this + // + // var x = 1; + // while (true) { + // } + // after typing close curly in while statement we want to reformat just the while statement. + // However if we just walk upwards searching for the parent that has the same end value - + // we'll end up with the whole source file. isListElement allows to stop on the list element level + var current = precedingToken; + while (current && + current.parent && + current.parent.end === precedingToken.end && + !isListElement(current.parent, current)) { + current = current.parent; + } + + return current; + } + + // Returns true if node is a element in some list in parent + // i.e. parent is class declaration with the list of members and node is one of members. + function isListElement(parent: Node, node: Node): boolean { + switch (parent.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + return rangeContainsRange((parent).members, node); + case SyntaxKind.ModuleDeclaration: + var body = (parent).body; + return body && body.kind === SyntaxKind.Block && rangeContainsRange((body).statements, node); + case SyntaxKind.SourceFile: + case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ModuleBlock: + return rangeContainsRange((parent).statements, node) + } + + return false; + } + + /** find node that fully contains given text range */ + function findEnclosingNode(range: TextRange, sourceFile: SourceFile): Node { + return find(sourceFile); + + function find(n: Node): Node { + var candidate = forEachChild(n, c => startEndContainsRange(c.getStart(sourceFile), c.end, range) && c); + if (candidate) { + var result = find(candidate); + if (result) { + return result; + } + } + + return n; + } + } + + /** formatting is not applied to ranges that contain parse errors. + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ + function prepareRangeContainsErrorFunction(errors: Diagnostic[], originalRange: TextRange): (r: TextRange) => boolean { + if (!errors.length) { + return rangeHasNoErrors; + } + + // pick only errors that fall in range + var sorted = errors + .filter(d => d.isParseError && rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)) + .sort((e1, e2) => e1.start - e2.start); + + if (!sorted.length) { + return rangeHasNoErrors; + } + + var index = 0; + + return r => { + // in current implementation sequence of arguments [r1, r2...] is monotonically increasing. + // 'index' tracks the index of the most recent error that was checked. + while (true) { + if (index >= sorted.length) { + // all errors in the range were already checked -> no error in specified range + return false; + } + + var error = sorted[index]; + if (r.end <= error.start) { + // specified range ends before the error refered by 'index' - no error in range + return false; + } + + if (startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + // specified range overlaps with error range + return true; + } + + index++; + } + }; + + function rangeHasNoErrors(r: TextRange): boolean { + return false; + } + } + + /** + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ + function getScanStartPosition(enclosingNode: Node, originalRange: TextRange, sourceFile: SourceFile): number { + var start = enclosingNode.getStart(sourceFile); + if (start === originalRange.pos && enclosingNode.end === originalRange.end) { + return start; + } + + var precedingToken = findPrecedingToken(originalRange.pos, sourceFile); + // no preceding token found - start from the beginning of enclosing node + return precedingToken ? precedingToken.end : enclosingNode.pos; + } + + function formatSpan(originalRange: TextRange, + sourceFile: SourceFile, + options: FormatCodeOptions, + rulesProvider: RulesProvider, + requestKind: FormattingRequestKind): TextChange[] { + + var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.syntacticErrors, originalRange); + + // formatting context is used by rules provider + var formattingContext = new FormattingContext(sourceFile, requestKind); + + // find the smallest node that fully wraps the range and compute the initial indentation for the node + var enclosingNode = findEnclosingNode(originalRange, sourceFile); + + var formattingScanner = getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); + + var initialIndentation = SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + + var previousRangeHasError: boolean; + var previousRange: TextRangeWithKind; + var previousParent: Node; + var previousRangeStartLine: number; + + var edits: TextChange[] = []; + + formattingScanner.advance(); + + if (formattingScanner.isOnToken()) { + var startLine = sourceFile.getLineAndCharacterFromPosition(enclosingNode.getStart(sourceFile)).line; + var delta = SmartIndenter.shouldIndentChildNode(enclosingNode.kind, SyntaxKind.Unknown) ? options.IndentSize : 0; + processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + } + + formattingScanner.close(); + + return edits; + + // local functions + + /** Tries to compute the indentation for a list element. + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ + function tryComputeIndentationForListItem(startPos: number, + endPos: number, + parentStartLine: number, + range: TextRange, + inheritedIndentation: number): number { + + if (rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (inheritedIndentation !== Constants.Unknown) { + return inheritedIndentation; + } + } + else { + var startLine = sourceFile.getLineAndCharacterFromPosition(startPos).line; + var startLinePosition = getStartLinePositionForPosition(startPos, sourceFile); + var column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + if (startLine !== parentStartLine || startPos === column) { + return column + } + } + + return Constants.Unknown; + } + + function computeIndentation( + node: TextRangeWithKind, + startLine: number, + inheritedIndentation: number, + parent: Node, + parentDynamicIndentation: DynamicIndentation, + effectiveParentStartLine: number): Indentation { + + var indentation = inheritedIndentation; + if (indentation === Constants.Unknown) { + if (isSomeBlock(node.kind)) { + // blocks should be indented in + // - other blocks + // - source file + // - switch\default clauses + if (isSomeBlock(parent.kind) || + parent.kind === SyntaxKind.SourceFile || + parent.kind === SyntaxKind.CaseClause || + parent.kind === SyntaxKind.DefaultClause) { + + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + else { + indentation = parentDynamicIndentation.getIndentation(); + } + } + else { + if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + } + } + + var delta = SmartIndenter.shouldIndentChildNode(node.kind, SyntaxKind.Unknown) ? options.IndentSize : 0; + + if (effectiveParentStartLine === startLine) { + // if node is located on the same line with the parent + // - inherit indentation from the parent + // - push children if either parent of node itself has non-zero delta + indentation = parentDynamicIndentation.getIndentation(); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + } + return { + indentation: indentation, + delta: delta + } + } + + function getDynamicIndentation(node: Node, nodeStartLine: number, indentation: number, delta: number): DynamicIndentation { + return { + getIndentationForComment: kind => { + switch (kind) { + // preceding comment to the token that closes the indentation scope inherits the indentation from the scope + // .. { + // // comment + // } + case SyntaxKind.CloseBraceToken: + case SyntaxKind.CloseBracketToken: + return indentation + delta; + } + return indentation; + }, + getIndentationForToken: (line, kind) => { + switch (kind) { + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case SyntaxKind.OpenBraceToken: + case SyntaxKind.CloseBraceToken: + case SyntaxKind.OpenBracketToken: + case SyntaxKind.CloseBracketToken: + case SyntaxKind.ElseKeyword: + case SyntaxKind.WhileKeyword: + return indentation; + default: + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line ? indentation + delta : indentation; + } + }, + getIndentation: () => indentation, + getDelta: () => delta, + recomputeIndentation: lineAdded => { + if (node.parent && SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (lineAdded) { + indentation += options.IndentSize; + } + else { + indentation -= options.IndentSize; + } + + if (SmartIndenter.shouldIndentChildNode(node.kind, SyntaxKind.Unknown)) { + delta = options.IndentSize; + } + else { + delta = 0; + } + } + }, + } + } + + function processNode(node: Node, contextNode: Node, nodeStartLine: number, indentation: number, delta: number) { + if (!rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { + return; + } + + var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + + // a useful observations when tracking context node + // / + // [a] + // / | \ + // [b] [c] [d] + // node 'a' is a context node for nodes 'b', 'c', 'd' + // except for the leftmost leaf token in [b] - in this case context node ('e') is located somewhere above 'a' + // this rule can be applied recursively to child nodes of 'a'. + // + // context node is set to parent node value after processing every child node + // context node is set to parent of the token after processing every token + + var childContextNode = contextNode; + + // if there are any tokens that logically belong to node and interleave child nodes + // such tokens will be consumed in processChildNode for for the child that follows them + forEachChild( + node, + child => { + processChildNode(child, /*inheritedIndentation*/ Constants.Unknown, node, nodeDynamicIndentation, nodeStartLine, /*isListElement*/ false) + }, + (nodes: NodeArray) => { + processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); + }); + + // proceed any tokens in the node that are located after child nodes + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > node.end) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + } + + function processChildNode( + child: Node, + inheritedIndentation: number, + parent: Node, + parentDynamicIndentation: DynamicIndentation, + parentStartLine: number, + isListItem: boolean): number { + + var childStartPos = child.getStart(sourceFile); + + var childStart = sourceFile.getLineAndCharacterFromPosition(childStartPos); + + // if child is a list item - try to get its indentation + var childIndentationAmount = Constants.Unknown; + if (isListItem) { + childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); + if (childIndentationAmount !== Constants.Unknown) { + inheritedIndentation = childIndentationAmount; + } + } + + // child node is outside the target range - do not dive inside + if (!rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { + return inheritedIndentation; + } + + if (child.kind === SyntaxKind.Missing) { + return inheritedIndentation; + } + + while (formattingScanner.isOnToken()) { + // proceed any parent tokens that are located prior to child.getStart() + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { + // stop when formatting scanner advances past the beginning of the child + break; + } + + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + } + + if (!formattingScanner.isOnToken()) { + return inheritedIndentation; + } + + if (isToken(child)) { + // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules + var tokenInfo = formattingScanner.readTokenInfo(node); + Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + return inheritedIndentation; + } + + var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + + processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + + childContextNode = node; + + return inheritedIndentation; + } + + function processChildNodes(nodes: NodeArray, + parent: Node, + parentStartLine: number, + parentDynamicIndentation: DynamicIndentation): void { + + var listStartToken = getOpenTokenForList(parent, nodes); + var listEndToken = getCloseTokenForOpenToken(listStartToken); + + var listDynamicIndentation = parentDynamicIndentation; + var startLine = parentStartLine; + + if (listStartToken !== SyntaxKind.Unknown) { + // introduce a new indentation scope for lists (including list start and end tokens) + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { + // stop when formatting scanner moves past the beginning of node list + break; + } + else if (tokenInfo.token.kind === listStartToken) { + // consume list start token + startLine = sourceFile.getLineAndCharacterFromPosition(tokenInfo.token.pos).line; + var indentation = + computeIndentation(tokenInfo.token, startLine, Constants.Unknown, parent, parentDynamicIndentation, startLine); + + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + else { + // consume any tokens that precede the list as child elements of 'node' using its indentation scope + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + } + } + } + + var inheritedIndentation = Constants.Unknown; + for (var i = 0, len = nodes.length; i < len; ++i) { + inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, /*isListElement*/ true) + } + + if (listEndToken !== SyntaxKind.Unknown) { + if (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken) { + // consume list end token + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + } + } + } + + function consumeTokenAndAdvanceScanner(currentTokenInfo: TokenInfo, parent: Node, dynamicIndentation: DynamicIndentation): void { + Debug.assert(rangeContainsRange(parent, currentTokenInfo.token)); + + var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + var indentToken = false; + + if (currentTokenInfo.leadingTrivia) { + processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation); + } + + var lineAdded: boolean; + var isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); + + var tokenStart = sourceFile.getLineAndCharacterFromPosition(currentTokenInfo.token.pos); + if (isTokenInRange) { + // save prevStartLine since processRange will overwrite this value with current ones + var prevStartLine = previousRangeStartLine; + lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); + if (lineAdded !== undefined) { + indentToken = lineAdded; + } + else { + indentToken = lastTriviaWasNewLine && tokenStart.line !== prevStartLine; + } + } + + if (currentTokenInfo.trailingTrivia) { + processTrivia(currentTokenInfo.trailingTrivia, parent, childContextNode, dynamicIndentation); + } + + if (indentToken) { + var indentNextTokenOrTrivia = true; + if (currentTokenInfo.leadingTrivia) { + for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { + var triviaItem = currentTokenInfo.leadingTrivia[i]; + if (!rangeContainsRange(originalRange, triviaItem)) { + continue; + } + + var triviaStartLine = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos).line; + switch (triviaItem.kind) { + case SyntaxKind.MultiLineCommentTrivia: + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + indentMultilineComment(triviaItem, commentIndentation, /*firstLineIsIndented*/ !indentNextTokenOrTrivia); + indentNextTokenOrTrivia = false; + break; + case SyntaxKind.SingleLineCommentTrivia: + if (indentNextTokenOrTrivia) { + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation, /*lineAdded*/ false); + indentNextTokenOrTrivia = false; + } + break; + case SyntaxKind.NewLineTrivia: + indentNextTokenOrTrivia = true; + break; + } + } + } + + // indent token only if is it is in target range and does not overlap with any error ranges + if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { + var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + } + } + + formattingScanner.advance(); + + childContextNode = parent; + } + } + + function processTrivia(trivia: TextRangeWithKind[], parent: Node, contextNode: Node, dynamicIndentation: DynamicIndentation): void { + for (var i = 0, len = trivia.length; i < len; ++i) { + var triviaItem = trivia[i]; + if (isComment(triviaItem.kind) && rangeContainsRange(originalRange, triviaItem)) { + var triviaItemStart = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos); + processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); + } + } + } + + function processRange(range: TextRangeWithKind, + rangeStart: LineAndCharacter, + parent: Node, + contextNode: Node, + dynamicIndentation: DynamicIndentation): boolean { + + var rangeHasError = rangeContainsError(range); + var lineAdded: boolean; + if (!rangeHasError && !previousRangeHasError) { + if (!previousRange) { + // trim whitespaces starting from the beginning of the span up to the current line + var originalStart = sourceFile.getLineAndCharacterFromPosition(originalRange.pos); + trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); + } + else { + lineAdded = + processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation) + } + } + + previousRange = range; + previousParent = parent; + previousRangeStartLine = rangeStart.line; + previousRangeHasError = rangeHasError; + + return lineAdded; + } + + function processPair(currentItem: TextRangeWithKind, + currentStartLine: number, + currentParent: Node, + previousItem: TextRangeWithKind, + previousStartLine: number, + previousParent: Node, + contextNode: Node, + dynamicIndentation: DynamicIndentation): boolean { + + formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); + + var rule = rulesProvider.getRulesMap().GetRule(formattingContext); + + var trimTrailingWhitespaces: boolean; + var lineAdded: boolean; + if (rule) { + applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + + if (rule.Operation.Action & (RuleAction.Space | RuleAction.Delete) && currentStartLine !== previousStartLine) { + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = false; + } + } + else if (rule.Operation.Action & RuleAction.NewLine && currentStartLine === previousStartLine) { + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = true; + } + } + + if (lineAdded !== undefined) { + dynamicIndentation.recomputeIndentation(lineAdded); + } + + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line + trimTrailingWhitespaces = + (rule.Operation.Action & (RuleAction.NewLine | RuleAction.Space)) && + rule.Flag !== RuleFlags.CanDeleteNewLines; + } + else { + trimTrailingWhitespaces = true; + } + + if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line + trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); + } + + return lineAdded; + } + + function insertIndentation(pos: number, indentation: number, lineAdded: boolean): void { + var indentationString = getIndentationString(indentation, options); + if (lineAdded) { + // new line is added before the token by the formatting rules + // insert indentation string at the very beginning of the token + recordReplace(pos, 0, indentationString); + } + else { + var tokenStart = sourceFile.getLineAndCharacterFromPosition(pos); + if (indentation !== tokenStart.character - 1) { + var startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile); + recordReplace(startLinePosition, tokenStart.character - 1, indentationString); + } + } + } + + function indentMultilineComment(commentRange: TextRange, indentation: number, firstLineIsIndented: boolean) { + // split comment in lines + var startLine = sourceFile.getLineAndCharacterFromPosition(commentRange.pos).line; + var endLine = sourceFile.getLineAndCharacterFromPosition(commentRange.end).line; + + if (startLine === endLine) { + if (!firstLineIsIndented) { + // treat as single line comment + insertIndentation(commentRange.pos, indentation, /*lineAdded*/ false); + } + return; + } + else { + var parts: TextRange[] = []; + var startPos = commentRange.pos; + for (var line = startLine; line < endLine; ++line) { + var endOfLine = getEndLinePosition(line, sourceFile); + parts.push({ pos: startPos, end: endOfLine }); + startPos = getStartPositionOfLine(line + 1, sourceFile); + } + + parts.push({ pos: startPos, end: commentRange.end }); + } + + var startLinePos = getStartPositionOfLine(startLine, sourceFile); + + var nonWhitespaceColumnInFirstPart = + SmartIndenter.findFirstNonWhitespaceColumn(startLinePos, parts[0].pos, sourceFile, options); + + if (indentation === nonWhitespaceColumnInFirstPart) { + return; + } + + var startIndex = 0; + if (firstLineIsIndented) { + startIndex = 1; + startLine++; + } + + // shift all parts on the delta size + var delta = indentation - nonWhitespaceColumnInFirstPart; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos = getStartPositionOfLine(startLine, sourceFile); + var nonWhitespaceColumn = + i === 0 + ? nonWhitespaceColumnInFirstPart + : SmartIndenter.findFirstNonWhitespaceColumn(parts[i].pos, parts[i].end, sourceFile, options); + + var newIndentation = nonWhitespaceColumn + delta; + if (newIndentation > 0) { + var indentationString = getIndentationString(newIndentation, options); + recordReplace(startLinePos, nonWhitespaceColumn, indentationString); + } + else { + recordDelete(startLinePos, nonWhitespaceColumn); + } + } + } + + function trimTrailingWhitespacesForLines(line1: number, line2: number, range?: TextRangeWithKind) { + for (var line = line1; line < line2; ++line) { + var lineStartPosition = getStartPositionOfLine(line, sourceFile); + var lineEndPosition = getEndLinePosition(line, sourceFile); + + // do not trim whitespaces in comments + if (range && isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { + continue; + } + + var pos = lineEndPosition; + while (pos >= lineStartPosition && isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== lineEndPosition) { + Debug.assert(pos === lineStartPosition || !isWhiteSpace(sourceFile.text.charCodeAt(pos))); + recordDelete(pos + 1, lineEndPosition - pos); + } + } + } + + function newTextChange(start: number, len: number, newText: string): TextChange { + return { span: new TypeScript.TextSpan(start, len), newText: newText } + } + + function recordDelete(start: number, len: number) { + if (len) { + edits.push(newTextChange(start, len, "")); + } + } + + function recordReplace(start: number, len: number, newText: string) { + if (len || newText) { + edits.push(newTextChange(start, len, newText)); + } + } + + function applyRuleEdits(rule: Rule, + previousRange: TextRangeWithKind, + previousStartLine: number, + currentRange: TextRangeWithKind, + currentStartLine: number): void { + + var between: TextRange; + switch (rule.Operation.Action) { + case RuleAction.Ignore: + // no action required + return; + case RuleAction.Delete: + if (previousRange.end !== currentRange.pos) { + // delete characters starting from t1.end up to t2.pos exclusive + recordDelete(previousRange.end, currentRange.pos - previousRange.end); + } + break; + case RuleAction.NewLine: + // exit early if we on different lines and rule cannot change number of newlines + // if line1 and line2 are on subsequent lines then no edits are required - ok to exit + // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines + if (rule.Flag !== RuleFlags.CanDeleteNewLines && previousStartLine !== currentStartLine) { + return; + } + + // edit should not be applied only if we have one line feed between elements + var lineDelta = currentStartLine - previousStartLine; + if (lineDelta !== 1) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); + } + break; + case RuleAction.Space: + // exit early if we on different lines and rule cannot change number of newlines + if (rule.Flag !== RuleFlags.CanDeleteNewLines && previousStartLine !== currentStartLine) { + return; + } + + var posDelta = currentRange.pos - previousRange.end; + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== CharacterCodes.space) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + } + break; + } + } + } + + function isSomeBlock(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.Block: + case SyntaxKind.FunctionBlock: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.ModuleBlock: + return true; + } + return false; + } + + function getOpenTokenForList(node: Node, list: Node[]) { + switch (node.kind) { + case SyntaxKind.Constructor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Method: + case SyntaxKind.ArrowFunction: + if ((node).typeParameters === list) { + return SyntaxKind.LessThanToken; + } + else if ((node).parameters === list) { + return SyntaxKind.OpenParenToken; + } + break; + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + if ((node).typeArguments === list) { + return SyntaxKind.LessThanToken; + } + else if ((node).arguments === list) { + return SyntaxKind.OpenParenToken; + } + break; + case SyntaxKind.TypeReference: + if ((node).typeArguments === list) { + return SyntaxKind.LessThanToken; + } + } + + return SyntaxKind.Unknown; + } + + function getCloseTokenForOpenToken(kind: SyntaxKind) { + switch (kind) { + case SyntaxKind.OpenParenToken: + return SyntaxKind.CloseParenToken; + case SyntaxKind.LessThanToken: + return SyntaxKind.GreaterThanToken; + } + + return SyntaxKind.Unknown; + } +} \ No newline at end of file diff --git a/src/services/formatting/formatter.ts b/src/services/formatting/formatter.ts deleted file mode 100644 index e4a1229abef..00000000000 --- a/src/services/formatting/formatter.ts +++ /dev/null @@ -1,320 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class Formatter extends MultipleTokenIndenter { - private previousTokenSpan: TokenSpan = null; - private previousTokenParent: IndentationNodeContext = null; - - // TODO: implement it with skipped tokens in Fidelity - private scriptHasErrors: boolean = false; - - private rulesProvider: RulesProvider; - private formattingRequestKind: FormattingRequestKind; - private formattingContext: FormattingContext; - - constructor(textSpan: TextSpan, - sourceUnit: SourceUnitSyntax, - indentFirstToken: boolean, - options: FormattingOptions, - snapshot: ITextSnapshot, - rulesProvider: RulesProvider, - formattingRequestKind: FormattingRequestKind) { - - super(textSpan, sourceUnit, snapshot, indentFirstToken, options); - - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - - this.rulesProvider = rulesProvider; - this.formattingRequestKind = formattingRequestKind; - this.formattingContext = new FormattingContext(this.snapshot(), this.formattingRequestKind); - } - - public static getEdits(textSpan: TextSpan, - sourceUnit: SourceUnitSyntax, - options: FormattingOptions, - indentFirstToken: boolean, - snapshot: ITextSnapshot, - rulesProvider: RulesProvider, - formattingRequestKind: FormattingRequestKind): TextEditInfo[] { - var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - visitNodeOrToken(walker, sourceUnit); - return walker.edits(); - } - - public visitTokenInSpan(token: ISyntaxToken): void { - if (token.fullWidth() !== 0) { - var tokenSpan = new TextSpan(this.position() + token.leadingTriviaWidth(), width(token)); - if (this.textSpan().containsTextSpan(tokenSpan)) { - this.processToken(token); - } - } - - // Call the base class to process the token and indent it if needed - super.visitTokenInSpan(token); - } - - private processToken(token: ISyntaxToken): void { - var position = this.position(); - - // Extract any leading comments - if (token.leadingTriviaWidth() !== 0) { - this.processTrivia(token.leadingTrivia(), position); - position += token.leadingTriviaWidth(); - } - - // Push the token - var currentTokenSpan = new TokenSpan(token.kind(), position, width(token)); - if (!this.parent().hasSkippedOrMissingTokenChild()) { - if (this.previousTokenSpan) { - // Note that formatPair calls TrimWhitespaceInLineRange in between the 2 tokens - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - // We still want to trim whitespace even if it is the first trivia of the first token. Trim from the beginning of the span to the trivia - this.trimWhitespaceInLineRange(this.getLineNumber(this.textSpan()), this.getLineNumber(currentTokenSpan)); - } - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - // Make sure to clear the previous parent before assigning a new value to it - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, /* recursive */true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - position += width(token); - - // Extract any trailing comments - if (token.trailingTriviaWidth() !== 0) { - this.processTrivia(token.trailingTrivia(), position); - } - } - - private processTrivia(triviaList: ISyntaxTriviaList, fullStart: number) { - var position = fullStart; - - for (var i = 0, n = triviaList.count(); i < n ; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - // For a comment, format it like it is a token. For skipped text, eat it up as a token, but skip the formatting - if (trivia.isComment() || trivia.isSkippedToken()) { - var currentTokenSpan = new TokenSpan(trivia.kind(), position, trivia.fullWidth()); - if (this.textSpan().containsTextSpan(currentTokenSpan)) { - if (trivia.isComment() && this.previousTokenSpan) { - // Note that formatPair calls TrimWhitespaceInLineRange in between the 2 tokens - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - // We still want to trim whitespace even if it is the first trivia of the first token. Trim from the beginning of the span to the trivia - var startLine = this.getLineNumber(this.previousTokenSpan || this.textSpan()); - this.trimWhitespaceInLineRange(startLine, this.getLineNumber(currentTokenSpan)); - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - // Make sure to clear the previous parent before assigning a new value to it - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, /* recursive */true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - } - } - - position += trivia.fullWidth(); - } - } - - private findCommonParents(parent1: IndentationNodeContext, parent2: IndentationNodeContext): IndentationNodeContext { - // TODO: disable debug assert message - - var shallowParent: IndentationNodeContext; - var shallowParentDepth: number; - var deepParent: IndentationNodeContext; - var deepParentDepth: number; - - if (parent1.depth() < parent2.depth()) { - shallowParent = parent1; - shallowParentDepth = parent1.depth(); - deepParent = parent2; - deepParentDepth = parent2.depth(); - } - else { - shallowParent = parent2; - shallowParentDepth = parent2.depth(); - deepParent = parent1; - deepParentDepth = parent1.depth(); - } - - Debug.assert(shallowParentDepth >= 0, "Expected shallowParentDepth >= 0"); - Debug.assert(deepParentDepth >= 0, "Expected deepParentDepth >= 0"); - Debug.assert(deepParentDepth >= shallowParentDepth, "Expected deepParentDepth >= shallowParentDepth"); - - while (deepParentDepth > shallowParentDepth) { - deepParent = deepParent.parent(); - deepParentDepth--; - } - - Debug.assert(deepParentDepth === shallowParentDepth, "Expected deepParentDepth === shallowParentDepth"); - - while (deepParent.node() && shallowParent.node()) { - if (deepParent.node() === shallowParent.node()) { - return deepParent; - } - deepParent = deepParent.parent(); - shallowParent = shallowParent.parent(); - } - - // The root should be the first element in the parent chain, we can not be here unless something wrong - // happened along the way - throw Errors.invalidOperation(); - } - - private formatPair(t1: TokenSpan, t1Parent: IndentationNodeContext, t2: TokenSpan, t2Parent: IndentationNodeContext): void { - var token1Line = this.getLineNumber(t1); - var token2Line = this.getLineNumber(t2); - - // Find common parent - var commonParent= this.findCommonParents(t1Parent, t2Parent); - - // Update the context - this.formattingContext.updateContext(t1, t1Parent, t2, t2Parent, commonParent); - - // Find rules matching the current context - var rule = this.rulesProvider.getRulesMap().GetRule(this.formattingContext); - - if (rule != null) { - // Record edits from the rule - this.RecordRuleEdits(rule, t1, t2); - - // Handle the case where the next line is moved to be the end of this line. - // In this case we don't indent the next line in the next pass. - if ((rule.Operation.Action == RuleAction.Space || rule.Operation.Action == RuleAction.Delete) && - token1Line != token2Line) { - this.forceSkipIndentingNextToken(t2.start()); - } - - // Handle the case where token2 is moved to the new line. - // In this case we indent token2 in the next pass but we set - // sameLineIndent flag to notify the indenter that the indentation is within the line. - if (rule.Operation.Action == RuleAction.NewLine && token1Line == token2Line) { - this.forceIndentNextToken(t2.start()); - } - } - - // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - if (token1Line != token2Line && (!rule || (rule.Operation.Action != RuleAction.Delete && rule.Flag != RuleFlags.CanDeleteNewLines))) { - this.trimWhitespaceInLineRange(token1Line, token2Line, t1); - } - } - - private getLineNumber(span: TextSpan): number { - return this.snapshot().getLineNumberFromPosition(span.start()); - } - - private trimWhitespaceInLineRange(startLine: number, endLine: number, token?: TokenSpan): void { - for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) { - var line = this.snapshot().getLineFromLineNumber(lineNumber); - - this.trimWhitespace(line, token); - } - } - - private trimWhitespace(line: ITextSnapshotLine, token?: TokenSpan): void { - // Don't remove the trailing spaces inside comments (this includes line comments and block comments) - if (token && (token.kind == SyntaxKind.MultiLineCommentTrivia || token.kind == SyntaxKind.SingleLineCommentTrivia) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) - return; - - var text = line.getText(); - var index = 0; - - for (index = text.length - 1; index >= 0; --index) { - if (!CharacterInfo.isWhitespace(text.charCodeAt(index))) { - break; - } - } - - ++index; - - if (index < text.length) { - this.recordEdit(line.startPosition() + index, line.length() - index, ""); - } - } - - private RecordRuleEdits(rule: Rule, t1: TokenSpan, t2: TokenSpan): void { - if (rule.Operation.Action == RuleAction.Ignore) { - return; - } - - var betweenSpan: TextSpan; - - switch (rule.Operation.Action) { - case RuleAction.Delete: - { - betweenSpan = new TextSpan(t1.end(), t2.start() - t1.end()); - - if (betweenSpan.length() > 0) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), ""); - return; - } - } - break; - - case RuleAction.NewLine: - { - if (!(rule.Flag == RuleFlags.CanDeleteNewLines || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - - betweenSpan = new TextSpan(t1.end(), t2.start() - t1.end()); - - var doEdit = false; - var betweenText = this.snapshot().getText(betweenSpan); - - var lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter); - if (lineFeedLoc < 0) { - // no linefeeds, do the edit - doEdit = true; - } - else { - // We only require one line feed. If there is another one, do the edit - lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter, lineFeedLoc + 1); - if (lineFeedLoc >= 0) { - doEdit = true; - } - } - - if (doEdit) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), this.options.newLineCharacter); - return; - } - } - break; - - case RuleAction.Space: - { - if (!(rule.Flag == RuleFlags.CanDeleteNewLines || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - - betweenSpan = new TextSpan(t1.end(), t2.start() - t1.end()); - - if (betweenSpan.length() > 1 || this.snapshot().getText(betweenSpan) != " ") { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), " "); - return; - } - } - break; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 9ced31ecef2..2bfb155921e 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -13,48 +13,48 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class FormattingContext { - public currentTokenSpan: TokenSpan = null; - public nextTokenSpan: TokenSpan = null; - public contextNode: IndentationNodeContext = null; - public currentTokenParent: IndentationNodeContext = null; - public nextTokenParent: IndentationNodeContext = null; + public currentTokenSpan: TextRangeWithKind; + public nextTokenSpan: TextRangeWithKind; + public contextNode: Node; + public currentTokenParent: Node; + public nextTokenParent: Node; - private contextNodeAllOnSameLine: boolean = null; - private nextNodeAllOnSameLine: boolean = null; - private tokensAreOnSameLine: boolean = null; - private contextNodeBlockIsOnOneLine: boolean = null; - private nextNodeBlockIsOnOneLine: boolean = null; + private contextNodeAllOnSameLine: boolean; + private nextNodeAllOnSameLine: boolean; + private tokensAreOnSameLine: boolean; + private contextNodeBlockIsOnOneLine: boolean; + private nextNodeBlockIsOnOneLine: boolean; - constructor(private snapshot: ITextSnapshot, public formattingRequestKind: FormattingRequestKind) { - Debug.assert(this.snapshot != null, "snapshot is null"); + constructor(private sourceFile: SourceFile, public formattingRequestKind: FormattingRequestKind) { } - public updateContext(currentTokenSpan: TokenSpan, currentTokenParent: IndentationNodeContext, nextTokenSpan: TokenSpan, nextTokenParent: IndentationNodeContext, commonParent: IndentationNodeContext) { - Debug.assert(currentTokenSpan != null, "currentTokenSpan is null"); - Debug.assert(currentTokenParent != null, "currentTokenParent is null"); - Debug.assert(nextTokenSpan != null, "nextTokenSpan is null"); - Debug.assert(nextTokenParent != null, "nextTokenParent is null"); - Debug.assert(commonParent != null, "commonParent is null"); + public updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node) { + Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); + Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); + Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); + Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); + Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentTokenSpan; + this.currentTokenSpan = currentRange; this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextTokenSpan; + this.nextTokenSpan = nextRange; this.nextTokenParent = nextTokenParent; this.contextNode = commonParent; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; + // drop cached results + this.contextNodeAllOnSameLine = undefined; + this.nextNodeAllOnSameLine = undefined; + this.tokensAreOnSameLine = undefined; + this.contextNodeBlockIsOnOneLine = undefined; + this.nextNodeBlockIsOnOneLine = undefined; } public ContextNodeAllOnSameLine(): boolean { - if (this.contextNodeAllOnSameLine === null) { + if (this.contextNodeAllOnSameLine === undefined) { this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); } @@ -62,7 +62,7 @@ module TypeScript.Services.Formatting { } public NextNodeAllOnSameLine(): boolean { - if (this.nextNodeAllOnSameLine === null) { + if (this.nextNodeAllOnSameLine === undefined) { this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); } @@ -70,10 +70,9 @@ module TypeScript.Services.Formatting { } public TokensAreOnSameLine(): boolean { - if (this.tokensAreOnSameLine === null) { - var startLine = this.snapshot.getLineNumberFromPosition(this.currentTokenSpan.start()); - var endLine = this.snapshot.getLineNumberFromPosition(this.nextTokenSpan.start()); - + if (this.tokensAreOnSameLine === undefined) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(this.currentTokenSpan.pos).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(this.nextTokenSpan.pos).line; this.tokensAreOnSameLine = (startLine == endLine); } @@ -81,7 +80,7 @@ module TypeScript.Services.Formatting { } public ContextNodeBlockIsOnOneLine() { - if (this.contextNodeBlockIsOnOneLine === null) { + if (this.contextNodeBlockIsOnOneLine === undefined) { this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); } @@ -89,28 +88,28 @@ module TypeScript.Services.Formatting { } public NextNodeBlockIsOnOneLine() { - if (this.nextNodeBlockIsOnOneLine === null) { + if (this.nextNodeBlockIsOnOneLine === undefined) { this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); } return this.nextNodeBlockIsOnOneLine; } - public NodeIsOnOneLine(node: IndentationNodeContext): boolean { - var startLine = this.snapshot.getLineNumberFromPosition(node.start()); - var endLine = this.snapshot.getLineNumberFromPosition(node.end()); - + private NodeIsOnOneLine(node: Node): boolean { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(node.getStart(this.sourceFile)).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(node.getEnd()).line; return startLine == endLine; } - // Now we know we have a block (or a fake block represented by some other kind of node with an open and close brace as children). - // IMPORTANT!!! This relies on the invariant that IsBlockContext must return true ONLY for nodes with open and close braces as immediate children - public BlockIsOnOneLine(node: IndentationNodeContext): boolean { - var block = node.node(); - - // Now check if they are on the same line - return this.snapshot.getLineNumberFromPosition(end(block.openBraceToken)) === - this.snapshot.getLineNumberFromPosition(start(block.closeBraceToken)); + private BlockIsOnOneLine(node: Node): boolean { + var openBrace = findChildOfKind(node, SyntaxKind.OpenBraceToken, this.sourceFile); + var closeBrace = findChildOfKind(node, SyntaxKind.CloseBraceToken, this.sourceFile); + if (openBrace && closeBrace) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(openBrace.getEnd()).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(closeBrace.getStart(this.sourceFile)).line; + return startLine === endLine; + } + return false; } } } \ No newline at end of file diff --git a/src/services/formatting/formattingManager.ts b/src/services/formatting/formattingManager.ts deleted file mode 100644 index 727c97cce30..00000000000 --- a/src/services/formatting/formattingManager.ts +++ /dev/null @@ -1,125 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class FormattingManager { - private options: FormattingOptions; - - constructor(private syntaxTree: SyntaxTree, - private snapshot: ITextSnapshot, - private rulesProvider: RulesProvider, - editorOptions: ts.EditorOptions) { - // - // TODO: convert to use FormattingOptions instead of EditorOptions - this.options = new FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter) - } - - public formatSelection(minChar: number, limChar: number): ts.TextChange[] { - var span = TextSpan.fromBounds(minChar, limChar); - return this.formatSpan(span, FormattingRequestKind.FormatSelection); - } - - public formatDocument(): ts.TextChange[] { - var span = TextSpan.fromBounds(0, this.snapshot.getLength()); - return this.formatSpan(span, FormattingRequestKind.FormatDocument); - } - - public formatOnSemicolon(caretPosition: number): ts.TextChange[] { - var sourceUnit = this.syntaxTree.sourceUnit(); - var semicolonPositionedToken = findToken(sourceUnit, caretPosition - 1); - - if (semicolonPositionedToken.kind() === SyntaxKind.SemicolonToken) { - // Find the outer most parent that this semicolon terminates - var current: ISyntaxElement = semicolonPositionedToken; - while (current.parent !== null && - end(current.parent) === end(semicolonPositionedToken) && - current.parent.kind() !== SyntaxKind.List) { - current = current.parent; - } - - // Compute the span - var span = new TextSpan(fullStart(current), fullWidth(current)); - - // Format the span - return this.formatSpan(span, FormattingRequestKind.FormatOnSemicolon); - } - - return []; - } - - public formatOnClosingCurlyBrace(caretPosition: number): ts.TextChange[] { - var sourceUnit = this.syntaxTree.sourceUnit(); - var closeBracePositionedToken = findToken(sourceUnit, caretPosition - 1); - - if (closeBracePositionedToken.kind() === SyntaxKind.CloseBraceToken) { - // Find the outer most parent that this closing brace terminates - var current: ISyntaxElement = closeBracePositionedToken; - while (current.parent !== null && - end(current.parent) === end(closeBracePositionedToken) && - current.parent.kind() !== SyntaxKind.List) { - current = current.parent; - } - - // Compute the span - var span = new TextSpan(fullStart(current), fullWidth(current)); - - // Format the span - return this.formatSpan(span, FormattingRequestKind.FormatOnClosingCurlyBrace); - } - - return []; - } - - public formatOnEnter(caretPosition: number): ts.TextChange[] { - var lineNumber = this.snapshot.getLineNumberFromPosition(caretPosition); - - if (lineNumber > 0) { - // Format both lines - var prevLine = this.snapshot.getLineFromLineNumber(lineNumber - 1); - var currentLine = this.snapshot.getLineFromLineNumber(lineNumber); - var span = TextSpan.fromBounds(prevLine.startPosition(), currentLine.endPosition()); - - // Format the span - return this.formatSpan(span, FormattingRequestKind.FormatOnEnter); - - } - - return []; - } - - private formatSpan(span: TextSpan, formattingRequestKind: FormattingRequestKind): ts.TextChange[] { - // Always format from the beginning of the line - var startLine = this.snapshot.getLineFromPosition(span.start()); - span = TextSpan.fromBounds(startLine.startPosition(), span.end()); - - var result: ts.TextChange[] = []; - - var formattingEdits = Formatter.getEdits(span, this.syntaxTree.sourceUnit(), this.options, true, this.snapshot, this.rulesProvider, formattingRequestKind); - - // - // TODO: Change the ILanguageService interface to return TextEditInfo (with start, and length) instead of TextEdit (with minChar and limChar) - formattingEdits.forEach(item => { - result.push({ - span: new TextSpan(item.position, item.length), - newText: item.replaceWith - }); - }); - - return result; - } - } -} \ No newline at end of file diff --git a/src/services/formatting/formattingRequestKind.ts b/src/services/formatting/formattingRequestKind.ts index b766058e1ca..a66169c1e7c 100644 --- a/src/services/formatting/formattingRequestKind.ts +++ b/src/services/formatting/formattingRequestKind.ts @@ -13,15 +13,14 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { - export enum FormattingRequestKind { +module ts.formatting { + export const enum FormattingRequestKind { FormatDocument, FormatSelection, FormatOnEnter, FormatOnSemicolon, - FormatOnClosingCurlyBrace, - FormatOnPaste + FormatOnClosingCurlyBrace } } \ No newline at end of file diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts new file mode 100644 index 00000000000..9cf2a05a5d9 --- /dev/null +++ b/src/services/formatting/formattingScanner.ts @@ -0,0 +1,222 @@ +/// +/// + +module ts.formatting { + var scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); + + export interface FormattingScanner { + advance(): void; + isOnToken(): boolean; + readTokenInfo(n: Node): TokenInfo; + lastTrailingTriviaWasNewLine(): boolean; + close(): void; + } + + const enum ScanAction{ + Scan, + RescanGreaterThanToken, + RescanSlashToken, + RescanTemplateToken + } + + export function getFormattingScanner(sourceFile: SourceFile, startPos: number, endPos: number): FormattingScanner { + + scanner.setText(sourceFile.text); + scanner.setTextPos(startPos); + + var wasNewLine: boolean = true; + var leadingTrivia: TextRangeWithKind[]; + var trailingTrivia: TextRangeWithKind[]; + + var savedPos: number; + var lastScanAction: ScanAction; + var lastTokenInfo: TokenInfo; + + return { + advance: advance, + readTokenInfo: readTokenInfo, + isOnToken: isOnToken, + lastTrailingTriviaWasNewLine: () => wasNewLine, + close: () => { + lastTokenInfo = undefined; + scanner.setText(undefined); + } + } + + function advance(): void { + lastTokenInfo = undefined; + var isStarted = scanner.getStartPos() !== startPos; + + if (isStarted) { + if (trailingTrivia) { + Debug.assert(trailingTrivia.length !== 0); + wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === SyntaxKind.NewLineTrivia; + } + else { + wasNewLine = false; + } + } + + leadingTrivia = undefined; + trailingTrivia = undefined; + + if (!isStarted) { + scanner.scan(); + } + + var t: SyntaxKind; + var pos = scanner.getStartPos(); + + // Read leading trivia and token + while (pos < endPos) { + var t = scanner.getToken(); + if (!isTrivia(t)) { + break; + } + + // consume leading trivia + scanner.scan(); + var item = { + pos: pos, + end: scanner.getStartPos(), + kind: t + } + + pos = scanner.getStartPos(); + + if (!leadingTrivia) { + leadingTrivia = []; + } + leadingTrivia.push(item); + } + + savedPos = scanner.getStartPos(); + } + + function shouldRescanGreaterThanToken(container: Node): boolean { + if (container.kind !== SyntaxKind.BinaryExpression) { + return false; + } + switch ((container).operator) { + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + return true; + } + + return false; + } + + function shouldRescanSlashToken(container: Node): boolean { + return container.kind === SyntaxKind.RegularExpressionLiteral; + } + + function shouldRescanTemplateToken(container: Node): boolean { + return container.kind === SyntaxKind.TemplateSpan; + } + + function startsWithSlashToken(t: SyntaxKind): boolean { + return t === SyntaxKind.SlashToken || t === SyntaxKind.SlashEqualsToken; + } + + function readTokenInfo(n: Node): TokenInfo { + if (!isOnToken()) { + // scanner is not on the token (either advance was not called yet or scanner is already past the end position) + return { + leadingTrivia: leadingTrivia, + trailingTrivia: undefined, + token: undefined + }; + } + + // normally scanner returns the smallest available token + // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. + var expectedScanAction = + shouldRescanGreaterThanToken(n) + ? ScanAction.RescanGreaterThanToken + : shouldRescanSlashToken(n) + ? ScanAction.RescanSlashToken + : shouldRescanTemplateToken(n) + ? ScanAction.RescanTemplateToken + : ScanAction.Scan + + if (lastTokenInfo && expectedScanAction === lastScanAction) { + // readTokenInfo was called before with the same expected scan action. + // No need to re-scan text, return existing 'lastTokenInfo' + return lastTokenInfo; + } + + if (scanner.getStartPos() !== savedPos) { + Debug.assert(lastTokenInfo !== undefined); + // readTokenInfo was called before but scan action differs - rescan text + scanner.setTextPos(savedPos); + scanner.scan(); + } + + var currentToken = scanner.getToken(); + + if (expectedScanAction === ScanAction.RescanGreaterThanToken && currentToken === SyntaxKind.GreaterThanToken) { + currentToken = scanner.reScanGreaterToken(); + Debug.assert((n).operator === currentToken); + lastScanAction = ScanAction.RescanGreaterThanToken; + } + else if (expectedScanAction === ScanAction.RescanSlashToken && startsWithSlashToken(currentToken)) { + currentToken = scanner.reScanSlashToken(); + Debug.assert(n.kind === currentToken); + lastScanAction = ScanAction.RescanSlashToken; + } + else if (expectedScanAction === ScanAction.RescanTemplateToken && currentToken === SyntaxKind.CloseBraceToken) { + currentToken = scanner.reScanTemplateToken(); + lastScanAction = ScanAction.RescanTemplateToken; + } + else { + lastScanAction = ScanAction.Scan; + } + + var token: TextRangeWithKind = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + } + + // consume trailing trivia + while(scanner.getStartPos() < endPos) { + currentToken = scanner.scan(); + if (!isTrivia(currentToken)) { + break; + } + var trivia = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + }; + + if (!trailingTrivia) { + trailingTrivia = []; + } + + trailingTrivia.push(trivia); + + if (currentToken === SyntaxKind.NewLineTrivia) { + // move past new line + scanner.scan(); + break; + } + } + + return lastTokenInfo = { + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia, + token: token + } + } + + function isOnToken(): boolean { + var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== SyntaxKind.EndOfFileToken && !isTrivia(current); + } + } +} \ No newline at end of file diff --git a/src/services/formatting/indentation.ts b/src/services/formatting/indentation.ts new file mode 100644 index 00000000000..f6f8fc0319f --- /dev/null +++ b/src/services/formatting/indentation.ts @@ -0,0 +1,54 @@ +module ts.formatting { + + var internedTabsIndentation: string[]; + var internedSpacesIndentation: string[]; + + export function getIndentationString(indentation: number, options: FormatCodeOptions): string { + if (!options.ConvertTabsToSpaces) { + var tabs = Math.floor(indentation / options.TabSize); + var spaces = indentation - tabs * options.TabSize; + + var tabString: string; + if (!internedTabsIndentation) { + internedTabsIndentation = []; + } + + if (internedTabsIndentation[tabs] === undefined) { + internedTabsIndentation[tabs] = tabString = repeat('\t', tabs); + } + else { + tabString = internedTabsIndentation[tabs]; + } + + return spaces ? tabString + repeat(" ", spaces) : tabString; + } + else { + var spacesString: string; + var quotient = Math.floor(indentation / options.IndentSize); + var remainder = indentation % options.IndentSize; + if (!internedSpacesIndentation) { + internedSpacesIndentation = []; + } + + if (internedSpacesIndentation[quotient] === undefined) { + spacesString = repeat(" ", options.IndentSize * quotient); + internedSpacesIndentation[quotient] = spacesString; + } + else { + spacesString = internedSpacesIndentation[quotient]; + } + + + return remainder ? spacesString + repeat(" ", remainder) : spacesString; + } + + function repeat(value: string, count: number): string { + var s = ""; + for (var i = 0; i < count; ++i) { + s += value; + } + + return s; + } + } +} \ No newline at end of file diff --git a/src/services/formatting/indentationNodeContext.ts b/src/services/formatting/indentationNodeContext.ts deleted file mode 100644 index 398d4998eed..00000000000 --- a/src/services/formatting/indentationNodeContext.ts +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class IndentationNodeContext { - private _node: ISyntaxNode; - private _parent: IndentationNodeContext; - private _fullStart: number; - private _indentationAmount: number; - private _childIndentationAmountDelta: number; - private _depth: number; - private _hasSkippedOrMissingTokenChild: boolean; - - constructor(parent: IndentationNodeContext, node: ISyntaxNode, fullStart: number, indentationAmount: number, childIndentationAmountDelta: number) { - this.update(parent, node, fullStart, indentationAmount, childIndentationAmountDelta); - } - - public parent(): IndentationNodeContext { - return this._parent; - } - - public node(): ISyntaxNode { - return this._node; - } - - public fullStart(): number { - return this._fullStart; - } - - public fullWidth(): number { - return fullWidth(this._node); - } - - public start(): number { - return this._fullStart + leadingTriviaWidth(this._node); - } - - public end(): number { - return this._fullStart + leadingTriviaWidth(this._node) + width(this._node); - } - - public indentationAmount(): number { - return this._indentationAmount; - } - - public childIndentationAmountDelta(): number { - return this._childIndentationAmountDelta; - } - - public depth(): number { - return this._depth; - } - - public kind(): SyntaxKind { - return this._node.kind(); - } - - public hasSkippedOrMissingTokenChild(): boolean { - if (this._hasSkippedOrMissingTokenChild === null) { - this._hasSkippedOrMissingTokenChild = Syntax.nodeHasSkippedOrMissingTokens(this._node); - } - return this._hasSkippedOrMissingTokenChild; - } - - public clone(pool: IndentationNodeContextPool): IndentationNodeContext { - var parent: IndentationNodeContext = null; - if (this._parent) { - parent = this._parent.clone(pool); - } - return pool.getNode(parent, this._node, this._fullStart, this._indentationAmount, this._childIndentationAmountDelta); - } - - public update(parent: IndentationNodeContext, node: ISyntaxNode, fullStart: number, indentationAmount: number, childIndentationAmountDelta: number) { - this._parent = parent; - this._node = node; - this._fullStart = fullStart; - this._indentationAmount = indentationAmount; - this._childIndentationAmountDelta = childIndentationAmountDelta; - this._hasSkippedOrMissingTokenChild = null; - - if (parent) { - this._depth = parent.depth() + 1; - } - else { - this._depth = 0; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/indentationNodeContextPool.ts b/src/services/formatting/indentationNodeContextPool.ts deleted file mode 100644 index ea5b26277b5..00000000000 --- a/src/services/formatting/indentationNodeContextPool.ts +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class IndentationNodeContextPool { - private nodes: IndentationNodeContext[] = []; - - public getNode(parent: IndentationNodeContext, node: ISyntaxNode, fullStart: number, indentationLevel: number, childIndentationLevelDelta: number): IndentationNodeContext { - if (this.nodes.length > 0) { - var cachedNode = this.nodes.pop(); - cachedNode.update(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - return cachedNode; - } - - return new IndentationNodeContext(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - } - - public releaseNode(node: IndentationNodeContext, recursive: boolean = false): void { - this.nodes.push(node); - - if (recursive) { - var parent = node.parent(); - if (parent) { - this.releaseNode(parent, recursive); - } - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/indentationTrackingWalker.ts b/src/services/formatting/indentationTrackingWalker.ts deleted file mode 100644 index b07b477623e..00000000000 --- a/src/services/formatting/indentationTrackingWalker.ts +++ /dev/null @@ -1,349 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class IndentationTrackingWalker extends SyntaxWalker { - private _position: number = 0; - private _parent: IndentationNodeContext = null; - private _textSpan: TextSpan; - private _snapshot: ITextSnapshot; - private _lastTriviaWasNewLine: boolean; - private _indentationNodeContextPool: IndentationNodeContextPool; - private _text: ISimpleText; - - constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, public options: FormattingOptions) { - super(); - - // Create a pool object to manage context nodes while walking the tree - this._indentationNodeContextPool = new IndentationNodeContextPool(); - - this._textSpan = textSpan; - this._text = sourceUnit.syntaxTree.text; - this._snapshot = snapshot; - this._parent = this._indentationNodeContextPool.getNode(null, sourceUnit, 0, 0, 0); - - // Is the first token in the span at the start of a new line. - this._lastTriviaWasNewLine = indentFirstToken; - } - - public position(): number { - return this._position; - } - - public parent(): IndentationNodeContext { - return this._parent; - } - - public textSpan(): TextSpan { - return this._textSpan; - } - - public snapshot(): ITextSnapshot { - return this._snapshot; - } - - public indentationNodeContextPool(): IndentationNodeContextPool { - return this._indentationNodeContextPool; - } - - public forceIndentNextToken(tokenStart: number): void { - this._lastTriviaWasNewLine = true; - this.forceRecomputeIndentationOfParent(tokenStart, true); - } - - public forceSkipIndentingNextToken(tokenStart: number): void { - this._lastTriviaWasNewLine = false; - this.forceRecomputeIndentationOfParent(tokenStart, false); - } - - public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void { - throw Errors.abstract(); - } - - public visitTokenInSpan(token: ISyntaxToken): void { - if (this._lastTriviaWasNewLine) { - // Compute the indentation level at the current token - var indentationAmount = this.getTokenIndentationAmount(token); - var commentIndentationAmount = this.getCommentIndentationAmount(token); - - // Process the token - this.indentToken(token, indentationAmount, commentIndentationAmount); - } - } - - public visitToken(token: ISyntaxToken): void { - var tokenSpan = new TextSpan(this._position, token.fullWidth()); - - if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { - this.visitTokenInSpan(token); - - // Only track new lines on tokens within the range. Make sure to check that the last trivia is a newline, and not just one of the trivia - var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == SyntaxKind.NewLineTrivia; - } - - // Update the position - this._position += token.fullWidth(); - } - - public visitNode(node: ISyntaxNode): void { - var nodeSpan = new TextSpan(this._position, fullWidth(node)); - - if (nodeSpan.intersectsWithTextSpan(this._textSpan)) { - // Update indentation level - var indentation = this.getNodeIndentation(node); - - // Update the parent - var currentParent = this._parent; - this._parent = this._indentationNodeContextPool.getNode(currentParent, node, this._position, indentation.indentationAmount, indentation.indentationAmountDelta); - - // Visit node - visitNodeOrToken(this, node); - - // Reset state - this._indentationNodeContextPool.releaseNode(this._parent); - this._parent = currentParent; - } - else { - // We're skipping the node, so update our position accordingly. - this._position += fullWidth(node); - } - } - - private getTokenIndentationAmount(token: ISyntaxToken): number { - // If this is the first token of a node, it should follow the node indentation and not the child indentation; - // (e.g.class in a class declaration or module in module declariotion). - // Open and close braces should follow the indentation of thier parent as well(e.g. - // class { - // } - // Also in a do-while statement, the while should be indented like the parent. - if (firstToken(this._parent.node()) === token || - token.kind() === SyntaxKind.OpenBraceToken || token.kind() === SyntaxKind.CloseBraceToken || - token.kind() === SyntaxKind.OpenBracketToken || token.kind() === SyntaxKind.CloseBracketToken || - (token.kind() === SyntaxKind.WhileKeyword && this._parent.node().kind() == SyntaxKind.DoStatement)) { - return this._parent.indentationAmount(); - } - - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - - private getCommentIndentationAmount(token: ISyntaxToken): number { - // If this is token terminating an indentation scope, leading comments should be indented to follow the children - // indentation level and not the node - - if (token.kind() === SyntaxKind.CloseBraceToken || token.kind() === SyntaxKind.CloseBracketToken) { - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - return this._parent.indentationAmount(); - } - - private getNodeIndentation(node: ISyntaxNode, newLineInsertedByFormatting?: boolean): { indentationAmount: number; indentationAmountDelta: number; } { - var parent = this._parent; - - // We need to get the parent's indentation, which could be one of 2 things. If first token of the parent is in the span, use the parent's computed indentation. - // If the parent was outside the span, use the actual indentation of the parent. - var parentIndentationAmount: number; - if (this._textSpan.containsPosition(parent.start())) { - parentIndentationAmount = parent.indentationAmount(); - } - else { - if (parent.kind() === SyntaxKind.Block && !this.shouldIndentBlockInParent(this._parent.parent())) { - // Blocks preserve the indentation of their containing node (unless they're a - // standalone block in a list). i.e. if you have: - // - // function foo( - // a: number) { - // - // Then we expect the indentation of the block to be tied to the function, not to - // the line that the block is defined on. If we were to do the latter, then the - // indentation would be here: - // - // function foo( - // a: number) { - // | - // - // Instead of: - // - // function foo( - // a: number) { - // | - parent = this._parent.parent(); - } - - var line = this._snapshot.getLineFromPosition(parent.start()).getText(); - var firstNonWhiteSpacePosition = Indentation.firstNonWhitespacePosition(line); - parentIndentationAmount = Indentation.columnForPositionInString(line, firstNonWhiteSpacePosition, this.options); - } - var parentIndentationAmountDelta = parent.childIndentationAmountDelta(); - - // The indentation level of the node - var indentationAmount: number; - - // The delta it adds to its children. - var indentationAmountDelta: number; - var parentNode = parent.node(); - - switch (node.kind()) { - default: - // General case - // This node should follow the child indentation set by its parent - // This node does not introduce any new indentation scope, indent any decendants of this node (tokens or child nodes) - // using the same indentation level - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = 0; - break; - - // Statements introducing {} - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ObjectType: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.SwitchStatement: - case SyntaxKind.ObjectLiteralExpression: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - case SyntaxKind.MemberFunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.IndexMemberDeclaration: - case SyntaxKind.CatchClause: - // Statements introducing [] - case SyntaxKind.ArrayLiteralExpression: - case SyntaxKind.ArrayType: - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.IndexSignature: - // Other statements - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WithStatement: - case SyntaxKind.CaseSwitchClause: - case SyntaxKind.DefaultSwitchClause: - case SyntaxKind.ReturnStatement: - case SyntaxKind.ThrowStatement: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: - case SyntaxKind.VariableDeclaration: - case SyntaxKind.ExportAssignment: - - // Expressions which have argument lists or parameter lists - case SyntaxKind.InvocationExpression: - case SyntaxKind.ObjectCreationExpression: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - - // These nodes should follow the child indentation set by its parent; - // they introduce a new indenation scope; children should be indented at one level deeper - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = this.options.indentSpaces; - break; - - case SyntaxKind.IfStatement: - if (parent.kind() === SyntaxKind.ElseClause && - !SyntaxUtilities.isLastTokenOnLine((parentNode).elseKeyword, this._text)) { - // This is an else if statement with the if on the same line as the else, do not indent the if statmement. - // Note: Children indentation has already been set by the parent if statement, so no need to increment - indentationAmount = parentIndentationAmount; - } - else { - // Otherwise introduce a new indenation scope; children should be indented at one level deeper - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - } - indentationAmountDelta = this.options.indentSpaces; - break; - - case SyntaxKind.ElseClause: - // Else should always follow its parent if statement indentation. - // Note: Children indentation has already been set by the parent if statement, so no need to increment - indentationAmount = parentIndentationAmount; - indentationAmountDelta = this.options.indentSpaces; - break; - - - case SyntaxKind.Block: - // Check if the block is a member in a list of statements (if the parent is a source unit, module, or block, or switch clause) - if (this.shouldIndentBlockInParent(parent)) { - indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; - } - else { - indentationAmount = parentIndentationAmount; - } - - indentationAmountDelta = this.options.indentSpaces; - break; - } - - // If the parent happens to start on the same line as this node, then override the current node indenation with that - // of the parent. This avoid having to add an extra level of indentation for the children. e.g.: - // return { - // a:1 - // }; - // instead of: - // return { - // a:1 - // }; - // We also need to pass the delta (if it is nonzero) to the children, so that subsequent lines get indented. Essentially, if any node starting on the given line - // has a nonzero delta , the resulting delta should be inherited from this node. This is to indent cases like the following: - // return a - // || b; - // Lastly, it is possible the node indentation needs to be recomputed because the formatter inserted a newline before its first token. - // If this is the case, we know the node no longer starts on the same line as its parent (or at least we shouldn't treat it as such). - if (parentNode) { - if (!newLineInsertedByFormatting /*This could be false or undefined here*/) { - var parentStartLine = this._snapshot.getLineNumberFromPosition(parent.start()); - var currentNodeStartLine = this._snapshot.getLineNumberFromPosition(this._position + leadingTriviaWidth(node)); - if (parentStartLine === currentNodeStartLine || newLineInsertedByFormatting === false /*meaning a new line was removed and we are force recomputing*/) { - indentationAmount = parentIndentationAmount; - indentationAmountDelta = Math.min(this.options.indentSpaces, parentIndentationAmountDelta + indentationAmountDelta); - } - } - } - - return { - indentationAmount: indentationAmount, - indentationAmountDelta: indentationAmountDelta - }; - } - - private shouldIndentBlockInParent(parent: IndentationNodeContext): boolean { - switch (parent.kind()) { - case SyntaxKind.SourceUnit: - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.Block: - case SyntaxKind.CaseSwitchClause: - case SyntaxKind.DefaultSwitchClause: - return true; - - default: - return false; - } - } - - private forceRecomputeIndentationOfParent(tokenStart: number, newLineAdded: boolean /*as opposed to removed*/): void { - var parent = this._parent; - if (parent.fullStart() === tokenStart) { - // Temporarily pop the parent before recomputing - this._parent = parent.parent(); - var indentation = this.getNodeIndentation(parent.node(), /* newLineInsertedByFormatting */ newLineAdded); - parent.update(parent.parent(), parent.node(), parent.fullStart(), indentation.indentationAmount, indentation.indentationAmountDelta); - this._parent = parent; - } - } - } -} \ No newline at end of file diff --git a/src/services/formatting/multipleTokenIndenter.ts b/src/services/formatting/multipleTokenIndenter.ts deleted file mode 100644 index 23181571427..00000000000 --- a/src/services/formatting/multipleTokenIndenter.ts +++ /dev/null @@ -1,206 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class MultipleTokenIndenter extends IndentationTrackingWalker { - private _edits: TextEditInfo[] = []; - - constructor(textSpan: TextSpan, sourceUnit: SourceUnitSyntax, snapshot: ITextSnapshot, indentFirstToken: boolean, options: FormattingOptions) { - super(textSpan, sourceUnit, snapshot, indentFirstToken, options); - } - - public indentToken(token: ISyntaxToken, indentationAmount: number, commentIndentationAmount: number): void { - // Ignore generated tokens - if (token.fullWidth() === 0) { - return; - } - - // If we have any skipped tokens as children, do not process this node for indentation or formatting - if (this.parent().hasSkippedOrMissingTokenChild()) { - return; - } - - // Be strict, and only consider nodes that fall inside the span. This avoids indenting a multiline string - // on enter at the end of, as the whole token was not included in the span - var tokenSpan = new TextSpan(this.position() + token.leadingTriviaWidth(), width(token)); - if (!this.textSpan().containsTextSpan(tokenSpan)) { - return; - } - - // Compute an indentation string for this token - var indentationString = Indentation.indentationString(indentationAmount, this.options); - - var commentIndentationString = Indentation.indentationString(commentIndentationAmount, this.options); - - // Record any needed indentation edits - this.recordIndentationEditsForToken(token, indentationString, commentIndentationString); - } - - public edits(): TextEditInfo[]{ - return this._edits; - } - - public recordEdit(position: number, length: number, replaceWith: string): void { - this._edits.push(new TextEditInfo(position, length, replaceWith)); - } - - private recordIndentationEditsForToken(token: ISyntaxToken, indentationString: string, commentIndentationString: string) { - var position = this.position(); - var indentNextTokenOrTrivia = true; - var leadingWhiteSpace = ""; // We need to track the whitespace before a multiline comment - - // Process any leading trivia if any - var triviaList = token.leadingTrivia(); - if (triviaList) { - for (var i = 0, length = triviaList.count(); i < length; i++, position += trivia.fullWidth()) { - var trivia = triviaList.syntaxTriviaAt(i); - // Skip this trivia if it is not in the span - if (!this.textSpan().containsTextSpan(new TextSpan(position, trivia.fullWidth()))) { - continue; - } - - switch (trivia.kind()) { - case SyntaxKind.MultiLineCommentTrivia: - // We will only indent the first line of the multiline comment if we were planning to indent the next trivia. However, - // subsequent lines will always be indented - this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia /* already indented first line */); - indentNextTokenOrTrivia = false; - leadingWhiteSpace = ""; - break; - - case SyntaxKind.SingleLineCommentTrivia: - case SyntaxKind.SkippedTokenTrivia: - if (indentNextTokenOrTrivia) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); - indentNextTokenOrTrivia = false; - } - break; - - case SyntaxKind.WhitespaceTrivia: - // If the next trivia is a comment, use the comment indentation level instead of the regular indentation level - // If the next trivia is a newline, this whole line is just whitespace, so don't do anything (trimming will take care of it) - var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); - var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; - if (indentNextTokenOrTrivia) { - if (!(nextTrivia && nextTrivia.isNewLine())) { - this.recordIndentationEditsForWhitespace(trivia, position, whiteSpaceIndentationString); - } - indentNextTokenOrTrivia = false; - } - leadingWhiteSpace += trivia.fullText(); - break; - - case SyntaxKind.NewLineTrivia: - // We hit a newline processing the trivia. We need to add the indentation to the - // next line as well. Note: don't bother indenting the newline itself. This will - // just insert ugly whitespace that most users probably will not want. - indentNextTokenOrTrivia = true; - leadingWhiteSpace = ""; - break; - - default: - throw Errors.invalidOperation(); - } - } - - } - - if (token.kind() !== SyntaxKind.EndOfFileToken && indentNextTokenOrTrivia) { - // If the last trivia item was a new line, or no trivia items were encounterd record the - // indentation edit at the token position - if (indentationString.length > 0) { - this.recordEdit(position, 0, indentationString); - } - } - } - - private recordIndentationEditsForSingleLineOrSkippedText(trivia: ISyntaxTrivia, fullStart: number, indentationString: string): void { - // Record the edit - if (indentationString.length > 0) { - this.recordEdit(fullStart, 0, indentationString); - } - } - - private recordIndentationEditsForWhitespace(trivia: ISyntaxTrivia, fullStart: number, indentationString: string): void { - var text = trivia.fullText(); - - // Check if the current indentation matches the desired indentation or not - if (indentationString === text) { - return; - } - - // Record the edit - this.recordEdit(fullStart, text.length, indentationString); - } - - private recordIndentationEditsForMultiLineComment(trivia: ISyntaxTrivia, fullStart: number, indentationString: string, leadingWhiteSpace: string, firstLineAlreadyIndented: boolean): void { - // If the multiline comment spans multiple lines, we need to add the right indent amount to - // each successive line segment as well. - var position = fullStart; - var segments = Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - - if (segments.length <= 1) { - if (!firstLineAlreadyIndented) { - // Process the one-line multiline comment just like a single line comment - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, fullStart, indentationString); - } - return; - } - - // Find number of columns in first segment - var whiteSpaceColumnsInFirstSegment = Indentation.columnForPositionInString(leadingWhiteSpace, leadingWhiteSpace.length, this.options); - - var indentationColumns = Indentation.columnForPositionInString(indentationString, indentationString.length, this.options); - var startIndex = 0; - if (firstLineAlreadyIndented) { - startIndex = 1; - position += segments[0].length; - } - for (var i = startIndex; i < segments.length; i++) { - var segment = segments[i]; - this.recordIndentationEditsForSegment(segment, position, indentationColumns, whiteSpaceColumnsInFirstSegment); - position += segment.length; - } - } - - private recordIndentationEditsForSegment(segment: string, fullStart: number, indentationColumns: number, whiteSpaceColumnsInFirstSegment: number): void { - // Indent subsequent lines using a column delta of the actual indentation relative to the first line - var firstNonWhitespacePosition = Indentation.firstNonWhitespacePosition(segment); - var leadingWhiteSpaceColumns = Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - var deltaFromFirstSegment = leadingWhiteSpaceColumns - whiteSpaceColumnsInFirstSegment; - var finalColumns = indentationColumns + deltaFromFirstSegment; - if (finalColumns < 0) { - finalColumns = 0; - } - var indentationString = Indentation.indentationString(finalColumns, this.options); - - if (firstNonWhitespacePosition < segment.length && - CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - // If this segment was just a newline, then don't bother indenting it. That will just - // leave the user with an ugly indent in their output that they probably do not want. - return; - } - - if (indentationString === segment.substring(0, firstNonWhitespacePosition)) { - return; - } - - // Record the edit - this.recordEdit(fullStart, firstNonWhitespacePosition, indentationString); - } - } -} \ No newline at end of file diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/references.ts similarity index 65% rename from src/services/formatting/formatting.ts rename to src/services/formatting/references.ts index 7570ef936c7..3d19b33d821 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/references.ts @@ -14,11 +14,7 @@ // /// -/// -/// -/// /// -/// /// /// /// @@ -28,12 +24,5 @@ /// /// /// -/// -/// /// -/// -/// -/// -/// -/// -/// \ No newline at end of file +/// \ No newline at end of file diff --git a/src/services/formatting/rule.ts b/src/services/formatting/rule.ts index 273f0590ce7..356720d2330 100644 --- a/src/services/formatting/rule.ts +++ b/src/services/formatting/rule.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class Rule { constructor( public Descriptor: RuleDescriptor, diff --git a/src/services/formatting/ruleAction.ts b/src/services/formatting/ruleAction.ts index 32c67c950ca..d2890d8e080 100644 --- a/src/services/formatting/ruleAction.ts +++ b/src/services/formatting/ruleAction.ts @@ -13,13 +13,13 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { - export enum RuleAction { - Ignore, - Space, - NewLine, - Delete +module ts.formatting { + export const enum RuleAction { + Ignore = 0x00000001, + Space = 0x00000002, + NewLine = 0x00000004, + Delete = 0x00000008 } } \ No newline at end of file diff --git a/src/services/formatting/ruleDescriptor.ts b/src/services/formatting/ruleDescriptor.ts index 1e7d822d57b..e5b7d6f3186 100644 --- a/src/services/formatting/ruleDescriptor.ts +++ b/src/services/formatting/ruleDescriptor.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RuleDescriptor { constructor(public LeftTokenRange: Shared.TokenRange, public RightTokenRange: Shared.TokenRange) { } @@ -34,7 +34,6 @@ module TypeScript.Services.Formatting { } static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor - //: this(TokenRange.FromToken(left), right) { return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), right); } diff --git a/src/services/formatting/ruleFlag.ts b/src/services/formatting/ruleFlag.ts index d815537dfd9..aaf70639e01 100644 --- a/src/services/formatting/ruleFlag.ts +++ b/src/services/formatting/ruleFlag.ts @@ -13,10 +13,10 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { - export enum RuleFlags { +module ts.formatting { + export const enum RuleFlags { None, CanDeleteNewLines } diff --git a/src/services/formatting/ruleOperation.ts b/src/services/formatting/ruleOperation.ts index 1f74aea0784..c73e3b6bcf7 100644 --- a/src/services/formatting/ruleOperation.ts +++ b/src/services/formatting/ruleOperation.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RuleOperation { public Context: RuleOperationContext; public Action: RuleAction; diff --git a/src/services/formatting/ruleOperationContext.ts b/src/services/formatting/ruleOperationContext.ts index a1e349210e4..d037f8e70d7 100644 --- a/src/services/formatting/ruleOperationContext.ts +++ b/src/services/formatting/ruleOperationContext.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RuleOperationContext { private customContextChecks: { (context: FormattingContext): boolean; }[]; diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index ade1dc6b217..4b42591936e 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class Rules { public getRuleName(rule: Rule) { var o: ts.Map = this; @@ -241,7 +241,7 @@ module TypeScript.Services.Formatting { this.SpaceBeforeOpenBraceInFunction = new Rule(RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, SyntaxKind.OpenBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), RuleAction.Space), RuleFlags.CanDeleteNewLines); // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) - this.TypeScriptOpenBraceLeftTokenRange = Shared.TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.MultiLineCommentTrivia]); + this.TypeScriptOpenBraceLeftTokenRange = Shared.TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.MultiLineCommentTrivia]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Rule(RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, SyntaxKind.OpenBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), RuleAction.Space), RuleFlags.CanDeleteNewLines); // Place a space before open brace in a control flow construct @@ -299,7 +299,7 @@ module TypeScript.Services.Formatting { // get x() {} // set x(val) {} - this.SpaceAfterGetSetInMember = new Rule(RuleDescriptor.create2(Shared.TokenRange.FromTokens([SyntaxKind.GetKeyword, SyntaxKind.SetKeyword]), SyntaxKind.IdentifierName), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Space)); + this.SpaceAfterGetSetInMember = new Rule(RuleDescriptor.create2(Shared.TokenRange.FromTokens([SyntaxKind.GetKeyword, SyntaxKind.SetKeyword]), SyntaxKind.Identifier), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Space)); // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. this.SpaceBeforeBinaryKeywordOperator = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.BinaryKeywordOperators), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), RuleAction.Space)); @@ -324,7 +324,7 @@ module TypeScript.Services.Formatting { this.SpaceAfterArrow = new Rule(RuleDescriptor.create3(SyntaxKind.EqualsGreaterThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); // Optional parameters and var args - this.NoSpaceAfterEllipsis = new Rule(RuleDescriptor.create1(SyntaxKind.DotDotDotToken, SyntaxKind.IdentifierName), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.NoSpaceAfterEllipsis = new Rule(RuleDescriptor.create1(SyntaxKind.DotDotDotToken, SyntaxKind.Identifier), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); this.NoSpaceAfterOptionalParameters = new Rule(RuleDescriptor.create3(SyntaxKind.QuestionToken, Shared.TokenRange.FromTokens([SyntaxKind.CloseParenToken, SyntaxKind.CommaToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), RuleAction.Delete)); // generics @@ -437,7 +437,7 @@ module TypeScript.Services.Formatting { /// static IsForContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ForStatement; + return context.contextNode.kind === SyntaxKind.ForStatement; } static IsNotForContext(context: FormattingContext): boolean { @@ -446,51 +446,19 @@ module TypeScript.Services.Formatting { static IsBinaryOpContext(context: FormattingContext): boolean { - switch (context.contextNode.kind()) { - // binary expressions - case SyntaxKind.AssignmentExpression: - case SyntaxKind.AddAssignmentExpression: - case SyntaxKind.SubtractAssignmentExpression: - case SyntaxKind.MultiplyAssignmentExpression: - case SyntaxKind.DivideAssignmentExpression: - case SyntaxKind.ModuloAssignmentExpression: - case SyntaxKind.AndAssignmentExpression: - case SyntaxKind.ExclusiveOrAssignmentExpression: - case SyntaxKind.OrAssignmentExpression: - case SyntaxKind.LeftShiftAssignmentExpression: - case SyntaxKind.SignedRightShiftAssignmentExpression: - case SyntaxKind.UnsignedRightShiftAssignmentExpression: + switch (context.contextNode.kind) { + case SyntaxKind.BinaryExpression: case SyntaxKind.ConditionalExpression: - case SyntaxKind.LogicalOrExpression: - case SyntaxKind.LogicalAndExpression: - case SyntaxKind.BitwiseOrExpression: - case SyntaxKind.BitwiseExclusiveOrExpression: - case SyntaxKind.BitwiseAndExpression: - case SyntaxKind.EqualsWithTypeConversionExpression: - case SyntaxKind.NotEqualsWithTypeConversionExpression: - case SyntaxKind.EqualsExpression: - case SyntaxKind.NotEqualsExpression: - case SyntaxKind.LessThanExpression: - case SyntaxKind.GreaterThanExpression: - case SyntaxKind.LessThanOrEqualExpression: - case SyntaxKind.GreaterThanOrEqualExpression: - case SyntaxKind.InstanceOfExpression: - case SyntaxKind.InExpression: - case SyntaxKind.LeftShiftExpression: - case SyntaxKind.SignedRightShiftExpression: - case SyntaxKind.UnsignedRightShiftExpression: - case SyntaxKind.MultiplyExpression: - case SyntaxKind.DivideExpression: - case SyntaxKind.ModuloExpression: - case SyntaxKind.AddExpression: - case SyntaxKind.SubtractExpression: return true; // equal in import a = module('a'); case SyntaxKind.ImportDeclaration: // equal in var a = 0; - case SyntaxKind.VariableDeclarator: - case SyntaxKind.EqualsValueClause: + case SyntaxKind.VariableDeclaration: + // equal in p = 0; + case SyntaxKind.Parameter: + case SyntaxKind.EnumMember: + case SyntaxKind.Property: return context.currentTokenSpan.kind === SyntaxKind.EqualsToken || context.nextTokenSpan.kind === SyntaxKind.EqualsToken; // "in" keyword in for (var x in []) { } case SyntaxKind.ForInStatement: @@ -546,16 +514,21 @@ module TypeScript.Services.Formatting { } // IMPORTANT!!! This method must return true ONLY for nodes with open and close braces as immediate children - static NodeIsBlockContext(node: IndentationNodeContext): boolean { + static NodeIsBlockContext(node: Node): boolean { if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { // This means we are in a context that looks like a block to the user, but in the grammar is actually not a node (it's a class, module, enum, object type literal, etc). return true; } - switch (node.kind()) { + switch (node.kind) { case SyntaxKind.Block: case SyntaxKind.SwitchStatement: - case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: return true; } @@ -563,17 +536,20 @@ module TypeScript.Services.Formatting { } static IsFunctionDeclContext(context: FormattingContext): boolean { - switch (context.contextNode.kind()) { + switch (context.contextNode.kind) { case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MemberFunctionDeclaration: + case SyntaxKind.Method: + //case SyntaxKind.MemberFunctionDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - case SyntaxKind.MethodSignature: + ///case SyntaxKind.MethodSignature: case SyntaxKind.CallSignature: case SyntaxKind.FunctionExpression: - case SyntaxKind.ConstructorDeclaration: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: + case SyntaxKind.Constructor: + case SyntaxKind.ArrowFunction: + //case SyntaxKind.ConstructorDeclaration: + //case SyntaxKind.SimpleArrowFunctionExpression: + //case SyntaxKind.ParenthesizedArrowFunctionExpression: case SyntaxKind.InterfaceDeclaration: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } @@ -585,11 +561,12 @@ module TypeScript.Services.Formatting { return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); } - static NodeIsTypeScriptDeclWithBlockContext(node: IndentationNodeContext): boolean { - switch (node.kind()) { + static NodeIsTypeScriptDeclWithBlockContext(node: Node): boolean { + switch (node.kind) { case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: case SyntaxKind.EnumDeclaration: - case SyntaxKind.ObjectType: + case SyntaxKind.TypeLiteral: case SyntaxKind.ModuleDeclaration: return true; } @@ -598,11 +575,16 @@ module TypeScript.Services.Formatting { } static IsAfterCodeBlockContext(context: FormattingContext): boolean { - switch (context.currentTokenParent.kind()) { + switch (context.currentTokenParent.kind) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.Block: + case SyntaxKind.TryBlock: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: + case SyntaxKind.FunctionBlock: + case SyntaxKind.ModuleBlock: case SyntaxKind.SwitchStatement: return true; } @@ -610,7 +592,7 @@ module TypeScript.Services.Formatting { } static IsControlDeclContext(context: FormattingContext): boolean { - switch (context.contextNode.kind()) { + switch (context.contextNode.kind) { case SyntaxKind.IfStatement: case SyntaxKind.SwitchStatement: case SyntaxKind.ForStatement: @@ -619,9 +601,10 @@ module TypeScript.Services.Formatting { case SyntaxKind.TryStatement: case SyntaxKind.DoStatement: case SyntaxKind.WithStatement: - case SyntaxKind.ElseClause: - case SyntaxKind.CatchClause: - case SyntaxKind.FinallyClause: + // TODO + // case SyntaxKind.ElseClause: + case SyntaxKind.CatchBlock: + case SyntaxKind.FinallyBlock: return true; default: @@ -630,15 +613,15 @@ module TypeScript.Services.Formatting { } static IsObjectContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ObjectLiteralExpression; + return context.contextNode.kind === SyntaxKind.ObjectLiteral; } static IsFunctionCallContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.InvocationExpression; + return context.contextNode.kind === SyntaxKind.CallExpression; } static IsNewContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ObjectCreationExpression; + return context.contextNode.kind === SyntaxKind.NewExpression; } static IsFunctionCallOrNewContext(context: FormattingContext): boolean { @@ -654,25 +637,43 @@ module TypeScript.Services.Formatting { } static IsModuleDeclContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ModuleDeclaration; + return context.contextNode.kind === SyntaxKind.ModuleDeclaration; } static IsObjectTypeContext(context: FormattingContext): boolean { - return context.contextNode.kind() === SyntaxKind.ObjectType && context.contextNode.parent().kind() !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === SyntaxKind.TypeLiteral;// && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } - static IsTypeArgumentOrParameter(tokenKind: SyntaxKind, parentKind: SyntaxKind): boolean { - return ((tokenKind === SyntaxKind.LessThanToken || tokenKind === SyntaxKind.GreaterThanToken) && - (parentKind === SyntaxKind.TypeParameterList || parentKind === SyntaxKind.TypeArgumentList)); + static IsTypeArgumentOrParameter(token: TextRangeWithKind, parent: Node): boolean { + if (token.kind !== SyntaxKind.LessThanToken && token.kind !== SyntaxKind.GreaterThanToken) { + return false; + } + switch (parent.kind) { + case SyntaxKind.TypeReference: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Method: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return true; + default: + return false; + + } } static IsTypeArgumentOrParameterContext(context: FormattingContext): boolean { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan.kind, context.currentTokenParent.kind()) || - Rules.IsTypeArgumentOrParameter(context.nextTokenSpan.kind, context.nextTokenParent.kind()); + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || + Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); } static IsVoidOpContext(context: FormattingContext): boolean { - return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind() === SyntaxKind.VoidExpression; + return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind === SyntaxKind.PrefixOperator; } } } \ No newline at end of file diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index 0fbe81d16c9..d25320f16a8 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RulesMap { public map: RulesBucket[]; public mapRowLength: number; diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 90b11f01a9b..1469e86971b 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export class RulesProvider { private globalRules: Rules; private options: ts.FormatCodeOptions; diff --git a/src/services/formatting/snapshotPoint.ts b/src/services/formatting/snapshotPoint.ts deleted file mode 100644 index 762748dbc70..00000000000 --- a/src/services/formatting/snapshotPoint.ts +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - - export class SnapshotPoint { - constructor(public snapshot: ITextSnapshot, public position: number) { - } - public getContainingLine(): ITextSnapshotLine { - return this.snapshot.getLineFromPosition(this.position); - } - public add(offset: number): SnapshotPoint { - return new SnapshotPoint(this.snapshot, this.position + offset); - } - } -} \ No newline at end of file diff --git a/src/services/formatting/textEditInfo.ts b/src/services/formatting/textEditInfo.ts deleted file mode 100644 index bdcbdd0ddc8..00000000000 --- a/src/services/formatting/textEditInfo.ts +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export class TextEditInfo { - - constructor(public position: number, public length: number, public replaceWith: string) { - } - - public toString() { - return "[ position: " + this.position + ", length: " + this.length + ", replaceWith: '" + this.replaceWith + "' ]"; - } - } -} \ No newline at end of file diff --git a/src/services/formatting/textSnapshot.ts b/src/services/formatting/textSnapshot.ts deleted file mode 100644 index 4f2904dd76f..00000000000 --- a/src/services/formatting/textSnapshot.ts +++ /dev/null @@ -1,89 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export interface ITextSnapshot { - getLength(): number; - getText(span: TextSpan): string; - getLineNumberFromPosition(position: number): number; - getLineFromPosition(position: number): ITextSnapshotLine; - getLineFromLineNumber(lineNumber: number): ITextSnapshotLine; - } - - export class TextSnapshot implements ITextSnapshot { - private lines: TextSnapshotLine[]; - - constructor(private snapshot: ISimpleText) { - this.lines = []; - } - - public getLength(): number { - return this.snapshot.length(); - } - - public getText(span: TextSpan): string { - return this.snapshot.substr(span.start(), span.length()); - } - - public getLineNumberFromPosition(position: number): number { - return this.snapshot.lineMap().getLineNumberFromPosition(position); - } - - public getLineFromPosition(position: number): ITextSnapshotLine { - var lineNumber = this.getLineNumberFromPosition(position); - return this.getLineFromLineNumber(lineNumber); - } - - public getLineFromLineNumber(lineNumber: number): ITextSnapshotLine { - var line = this.lines[lineNumber]; - if (line === undefined) { - line = this.getLineFromLineNumberWorker(lineNumber); - this.lines[lineNumber] = line; - } - return line; - } - - private getLineFromLineNumberWorker(lineNumber: number): ITextSnapshotLine { - var lineMap = this.snapshot.lineMap().lineStarts(); - var lineMapIndex = lineNumber; //Note: lineMap is 0-based - if (lineMapIndex < 0 || lineMapIndex >= lineMap.length) - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Invalid_line_number_0, [lineMapIndex])); - var start = lineMap[lineMapIndex]; - - var end: number; - var endIncludingLineBreak: number; - var lineBreak = ""; - if (lineMapIndex == lineMap.length) { - end = endIncludingLineBreak = this.snapshot.length(); - } - else { - endIncludingLineBreak = (lineMapIndex >= lineMap.length - 1 ? this.snapshot.length() : lineMap[lineMapIndex + 1]); - for (var p = endIncludingLineBreak - 1; p >= start; p--) { - var c = this.snapshot.substr(p, 1); - //TODO: Other ones? - if (c != "\r" && c != "\n") { - break; - } - } - end = p + 1; - lineBreak = this.snapshot.substr(end, endIncludingLineBreak - end); - } - var result = new TextSnapshotLine(this, lineNumber, start, end, lineBreak); - return result; - } - } -} \ No newline at end of file diff --git a/src/services/formatting/textSnapshotLine.ts b/src/services/formatting/textSnapshotLine.ts deleted file mode 100644 index df2d9eff237..00000000000 --- a/src/services/formatting/textSnapshotLine.ts +++ /dev/null @@ -1,80 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// 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. -// - -/// - -module TypeScript.Services.Formatting { - export interface ITextSnapshotLine { - snapshot(): ITextSnapshot; - - start(): SnapshotPoint; - startPosition(): number; - - end(): SnapshotPoint; - endPosition(): number; - - endIncludingLineBreak(): SnapshotPoint; - endIncludingLineBreakPosition(): number; - - length(): number; - lineNumber(): number; - getText(): string; - } - - export class TextSnapshotLine implements ITextSnapshotLine { - constructor(private _snapshot: ITextSnapshot, private _lineNumber: number, private _start: number, private _end: number, private _lineBreak: string) { - } - - public snapshot() { - return this._snapshot; - } - - public start() { - return new SnapshotPoint(this._snapshot, this._start); - } - - public startPosition() { - return this._start; - } - - public end() { - return new SnapshotPoint(this._snapshot, this._end); - } - - public endPosition() { - return this._end; - } - - public endIncludingLineBreak() { - return new SnapshotPoint(this._snapshot, this._end + this._lineBreak.length); - } - - public endIncludingLineBreakPosition() { - return this._end + this._lineBreak.length; - } - - public length() { - return this._end - this._start; - } - - public lineNumber() { - return this._lineNumber; - } - - public getText(): string { - return this._snapshot.getText(TextSpan.fromBounds(this._start, this._end)); - } - } -} \ No newline at end of file diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index 0c06f797025..8d421140e67 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -13,9 +13,9 @@ // limitations under the License. // -/// +/// -module TypeScript.Services.Formatting { +module ts.formatting { export module Shared { export interface ITokenAccess { GetTokens(): SyntaxKind[]; @@ -41,12 +41,6 @@ module TypeScript.Services.Formatting { public Contains(token: SyntaxKind): boolean { return this.tokens.indexOf(token) >= 0; } - - - public toString(): string { - return "[tokenRangeStart=" + SyntaxKind[this.tokens[0]] + "," + - "tokenRangeEnd=" + SyntaxKind[this.tokens[this.tokens.length - 1]] + "]"; - } } export class TokenValuesAccess implements ITokenAccess { @@ -76,10 +70,6 @@ module TypeScript.Services.Formatting { public Contains(tokenValue: SyntaxKind): boolean { return tokenValue == this.token; } - - public toString(): string { - return "[singleTokenKind=" + SyntaxKind[this.token] + "]"; - } } export class TokenAllAccess implements ITokenAccess { @@ -135,18 +125,18 @@ module TypeScript.Services.Formatting { static Any: TokenRange = TokenRange.AllTokens(); static AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([SyntaxKind.MultiLineCommentTrivia])); static Keywords = TokenRange.FromRange(SyntaxKind.FirstKeyword, SyntaxKind.LastKeyword); - static Operators = TokenRange.FromRange(SyntaxKind.SemicolonToken, SyntaxKind.SlashEqualsToken); - static BinaryOperators = TokenRange.FromRange(SyntaxKind.LessThanToken, SyntaxKind.SlashEqualsToken); + static Operators = TokenRange.FromRange(SyntaxKind.FirstOperator, SyntaxKind.LastOperator); + static BinaryOperators = TokenRange.FromRange(SyntaxKind.FirstBinaryOperator, SyntaxKind.LastBinaryOperator); static BinaryKeywordOperators = TokenRange.FromTokens([SyntaxKind.InKeyword, SyntaxKind.InstanceOfKeyword]); - static ReservedKeywords = TokenRange.FromRange(SyntaxKind.FirstFutureReservedStrictKeyword, SyntaxKind.LastFutureReservedStrictKeyword); + static ReservedKeywords = TokenRange.FromRange(SyntaxKind.FirstFutureReservedWord, SyntaxKind.LastFutureReservedWord); static UnaryPrefixOperators = TokenRange.FromTokens([SyntaxKind.PlusPlusToken, SyntaxKind.MinusMinusToken, SyntaxKind.TildeToken, SyntaxKind.ExclamationToken]); - static UnaryPrefixExpressions = TokenRange.FromTokens([SyntaxKind.NumericLiteral, SyntaxKind.IdentifierName, SyntaxKind.OpenParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.OpenBraceToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); - static UnaryPreincrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); - static UnaryPostincrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); - static UnaryPredecrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); - static UnaryPostdecrementExpressions = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); + static UnaryPrefixExpressions = TokenRange.FromTokens([SyntaxKind.NumericLiteral, SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.OpenBraceToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); + static UnaryPreincrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); + static UnaryPostincrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); + static UnaryPredecrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.OpenParenToken, SyntaxKind.ThisKeyword, SyntaxKind.NewKeyword]); + static UnaryPostdecrementExpressions = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken, SyntaxKind.NewKeyword]); static Comments = TokenRange.FromTokens([SyntaxKind.SingleLineCommentTrivia, SyntaxKind.MultiLineCommentTrivia]); - static TypeNames = TokenRange.FromTokens([SyntaxKind.IdentifierName, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]); + static TypeNames = TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.NumberKeyword, SyntaxKind.StringKeyword, SyntaxKind.BooleanKeyword, SyntaxKind.VoidKeyword, SyntaxKind.AnyKeyword]); } } } \ No newline at end of file diff --git a/src/services/formatting/tokenSpan.ts b/src/services/formatting/tokenSpan.ts index aba9c372f35..95f9bab3eee 100644 --- a/src/services/formatting/tokenSpan.ts +++ b/src/services/formatting/tokenSpan.ts @@ -13,11 +13,10 @@ // limitations under the License. // -/// +/// - -module TypeScript.Services.Formatting { - export class TokenSpan extends TextSpan { +module ts.formatting { + export class TokenSpan extends TypeScript.TextSpan { constructor(public kind: SyntaxKind, start: number, length: number) { super(start, length); } diff --git a/src/services/indentation.ts b/src/services/indentation.ts deleted file mode 100644 index 6616cdd3448..00000000000 --- a/src/services/indentation.ts +++ /dev/null @@ -1,154 +0,0 @@ - -module TypeScript.Indentation { - export function columnForEndOfTokenAtPosition(syntaxTree: SyntaxTree, position: number, options: FormattingOptions): number { - var token = findToken(syntaxTree.sourceUnit(), position); - return columnForStartOfTokenAtPosition(syntaxTree, position, options) + width(token); - } - - export function columnForStartOfTokenAtPosition(syntaxTree: SyntaxTree, position: number, options: FormattingOptions): number { - var token = findToken(syntaxTree.sourceUnit(), position); - - // Walk backward from this token until we find the first token in the line. For each token - // we see (that is not the first tokem in line), push the entirety of the text into the text - // array. Then, for the first token, add its text (without its leading trivia) to the text - // array. i.e. if we have: - // - // var foo = a => bar(); - // - // And we want the column for the start of 'bar', then we'll add the underlinded portions to - // the text array: - // - // var foo = a => bar(); - // _ - // __ - // __ - // ____ - // ____ - var firstTokenInLine = Syntax.firstTokenInLineContainingPosition(syntaxTree, token.fullStart()); - var leadingTextInReverse: string[] = []; - - var current = token; - while (current !== firstTokenInLine) { - current = previousToken(current); - - if (current === firstTokenInLine) { - // We're at the first token in teh line. - // We don't want the leading trivia for this token. That will be taken care of in - // columnForFirstNonWhitespaceCharacterInLine. So just push the trailing trivia - // and then the token text. - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } - else { - // We're at an intermediate token on the line. Just push all its text into the array. - leadingTextInReverse.push(current.fullText()); - } - } - - // Now, add all trivia to the start of the line on the first token in the list. - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - - export function columnForStartOfFirstTokenInLineContainingPosition(syntaxTree: SyntaxTree, position: number, options: FormattingOptions): number { - // Walk backward through the tokens until we find the first one on the line. - var firstTokenInLine = Syntax.firstTokenInLineContainingPosition(syntaxTree, position); - var leadingTextInReverse: string[] = []; - - // Now, add all trivia to the start of the line on the first token in the list. - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - - // Collect all the trivia that precedes this token. Stopping when we hit a newline trivia - // or a multiline comment that spans multiple lines. This is meant to be called on the first - // token in a line. - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine: ISyntaxToken, - leadingTextInReverse: string[]) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === SyntaxKind.NewLineTrivia) { - break; - } - - if (trivia.kind() === SyntaxKind.MultiLineCommentTrivia) { - var lineSegments = Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(ArrayUtilities.last(lineSegments)); - - if (lineSegments.length > 0) { - // This multiline comment actually spanned multiple lines. So we're done. - break; - } - - // It was only on a single line, so keep on going. - } - - leadingTextInReverse.push(trivia.fullText()); - } - } - - function columnForLeadingTextInReverse(leadingTextInReverse: string[], - options: FormattingOptions): number { - var column = 0; - - // walk backwards. This means we're actually walking forward from column 0 to the start of - // the token. - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); - } - - return column; - } - - // Returns the column that this input string ends at (assuming it starts at column 0). - export function columnForPositionInString(input: string, position: number, options: FormattingOptions): number { - return columnForPositionInStringWorker(input, position, 0, options); - } - - function columnForPositionInStringWorker(input: string, position: number, startColumn: number, options: FormattingOptions): number { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - - if (ch === CharacterCodes.tab) { - column += spacesPerTab - column % spacesPerTab; - } - else { - column++; - } - } - - return column; - } - - export function indentationString(column: number, options: FormattingOptions): string { - var numberOfTabs = 0; - var numberOfSpaces = Math.max(0, column); - - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - - return StringUtilities.repeat('\t', numberOfTabs) + - StringUtilities.repeat(' ', numberOfSpaces); - } - - export function firstNonWhitespacePosition(value: string): number { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!CharacterInfo.isWhitespace(ch)) { - return i; - } - } - - return value.length; - } -} \ No newline at end of file diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 69180974120..ca06d40fa88 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -73,13 +73,14 @@ module ts.NavigationBar { function sortNodes(nodes: Node[]): Node[] { return nodes.slice(0).sort((n1: Declaration, n2: Declaration) => { if (n1.name && n2.name) { - return n1.name.text.localeCompare(n2.name.text); + // TODO(jfreeman): How do we sort declarations with computed names? + return (n1.name).text.localeCompare((n2.name).text); } else if (n1.name) { return 1; } else if (n2.name) { - -1; + return -1; } else { return n1.kind - n2.kind; @@ -106,7 +107,7 @@ module ts.NavigationBar { break; case SyntaxKind.FunctionDeclaration: - var functionDeclaration = node; + var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); addTopLevelNodes((functionDeclaration.body).statements, topLevelNodes); @@ -116,11 +117,12 @@ module ts.NavigationBar { } } - function isTopLevelFunctionDeclaration(functionDeclaration: FunctionDeclaration) { + function isTopLevelFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration) { if (functionDeclaration.kind === SyntaxKind.FunctionDeclaration) { // A function declaration is 'top level' if it contains any function declarations // within it. if (functionDeclaration.body && functionDeclaration.body.kind === SyntaxKind.FunctionBlock) { + // Proper function declarations can only have identifier names if (forEach((functionDeclaration.body).statements, s => s.kind === SyntaxKind.FunctionDeclaration && !isEmpty((s).name.text))) { @@ -230,7 +232,7 @@ module ts.NavigationBar { return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberVariableElement); case SyntaxKind.FunctionDeclaration: - return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.functionElement); + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.functionElement); case SyntaxKind.VariableDeclaration: if (node.flags & NodeFlags.Const) { @@ -371,8 +373,10 @@ module ts.NavigationBar { }); // Add the constructor parameters in as children of the class (for property parameters). + // Note that *all* parameters will be added to the nodes array, but parameters that + // are not properties will be filtered out later by createChildItem. var nodes: Node[] = constructor - ? constructor.parameters.concat(node.members) + ? node.members.concat(constructor.parameters) : node.members; var childItems = getItemsWorker(sortNodes(nodes), createChildItem); diff --git a/src/services/resources/diagnosticCode.generated.ts b/src/services/resources/diagnosticCode.generated.ts index 26df20b428d..1b140105b16 100644 --- a/src/services/resources/diagnosticCode.generated.ts +++ b/src/services/resources/diagnosticCode.generated.ts @@ -13,7 +13,6 @@ module TypeScript { Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", Trailing_comma_not_allowed: "Trailing comma not allowed.", - AsteriskSlash_expected: "'*/' expected.", public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", Unexpected_token: "Unexpected token.", Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", @@ -95,6 +94,9 @@ module TypeScript { return_statement_must_be_contained_within_a_function_body: "'return' statement must be contained within a function body.", Expression_expected: "Expression expected.", Type_expected: "Type expected.", + Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.", + Computed_property_names_cannot_be_used_here: "Computed property names cannot be used here.", + yield_expression_must_be_contained_within_a_generator_declaration: "'yield' expression must be contained within a generator declaration.", Duplicate_identifier_0: "Duplicate identifier '{0}'.", The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", diff --git a/src/services/resources/diagnosticInformationMap.generated.ts b/src/services/resources/diagnosticInformationMap.generated.ts index 8d3bc73486e..8e911f469ef 100644 --- a/src/services/resources/diagnosticInformationMap.generated.ts +++ b/src/services/resources/diagnosticInformationMap.generated.ts @@ -96,6 +96,9 @@ module TypeScript { "'return' statement must be contained within a function body.": { "code": 1108, "category": DiagnosticCategory.Error }, "Expression expected.": { "code": 1109, "category": DiagnosticCategory.Error }, "Type expected.": { "code": 1110, "category": DiagnosticCategory.Error }, + "Template literal cannot be used as an element name.": { "code": 1111, "category": DiagnosticCategory.Error }, + "Computed property names cannot be used here.": { "code": 1112, "category": DiagnosticCategory.Error }, + "'yield' expression must be contained within a generator declaration.": { "code": 1113, "category": DiagnosticCategory.Error }, "Duplicate identifier '{0}'.": { "code": 2000, "category": DiagnosticCategory.Error }, "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": DiagnosticCategory.Error }, "The name '{0}' does not refer to a value.": { "code": 2002, "category": DiagnosticCategory.Error }, diff --git a/src/services/resources/diagnosticMessages.json b/src/services/resources/diagnosticMessages.json index bbca8b3f9ce..c238568eac6 100644 --- a/src/services/resources/diagnosticMessages.json +++ b/src/services/resources/diagnosticMessages.json @@ -47,10 +47,6 @@ "category": "Error", "code": 1009 }, - "'*/' expected.": { - "category": "Error", - "code": 1010 - }, "'public' or 'private' modifier must precede 'static'.": { "category": "Error", "code": 1011 @@ -375,6 +371,18 @@ "category": "Error", "code": 1110 }, + "Template literal cannot be used as an element name.": { + "category": "Error", + "code": 1111 + }, + "Computed property names cannot be used here.": { + "category": "Error", + "code": 1112 + }, + "'yield' expression must be contained within a generator declaration.": { + "category": "Error", + "code": 1113 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2000 diff --git a/src/services/services.ts b/src/services/services.ts index d853d06d68e..1eed221d403 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -8,11 +8,10 @@ /// /// /// -/// /// /// -/// -/// +/// +/// /// /// @@ -38,6 +37,7 @@ module ts { getFullWidth(): number; getLeadingTriviaWidth(sourceFile?: SourceFile): number; getFullText(sourceFile?: SourceFile): string; + getText(sourceFile?: SourceFile): string; getFirstToken(sourceFile?: SourceFile): Node; getLastToken(sourceFile?: SourceFile): Node; } @@ -70,13 +70,17 @@ module ts { } export interface SourceFile { - getSourceUnit(): TypeScript.SourceUnitSyntax; - getSyntaxTree(): TypeScript.SyntaxTree; getScriptSnapshot(): TypeScript.IScriptSnapshot; getNamedDeclarations(): Declaration[]; update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile; } + export interface PreProcessedFileInfo { + referencedFiles: FileReference[]; + importedFiles: FileReference[]; + isLibFile: boolean + } + var scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true); var emptyArray: any[] = []; @@ -130,12 +134,16 @@ module ts { return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); } + public getText(sourceFile?: SourceFile): string { + return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); + } + private addSyntheticNodes(nodes: Node[], pos: number, end: number): number { scanner.setTextPos(pos); while (pos < end) { var token = scanner.scan(); var textPos = scanner.getTextPos(); - var node = nodes.push(createNode(token, pos, textPos, NodeFlags.Synthetic, this)); + nodes.push(createNode(token, pos, textPos, NodeFlags.Synthetic, this)); pos = textPos; } return pos; @@ -343,7 +351,8 @@ module ts { function isName(pos: number, end: number, sourceFile: SourceFile, name: string) { return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && - isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)); + (isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || + isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos: number, end: number, sourceFile: SourceFile) { @@ -351,9 +360,16 @@ module ts { return isName(pos, end, sourceFile, paramTag); } + function pushDocCommentLineText(docComments: SymbolDisplayPart[], text: string, blankLineCount: number) { + // Add the empty lines in between texts + while (blankLineCount--) docComments.push(textPart("")); + docComments.push(textPart(text)); + } + function getCleanedJsDocComment(pos: number, end: number, sourceFile: SourceFile) { var spacesToRemoveAfterAsterisk: number; var docComments: SymbolDisplayPart[] = []; + var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -402,7 +418,12 @@ module ts { // Continue with next line pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - docComments.push(textPart(docCommentTextOfLine)); + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + blankLineCount = 0; + } + else if (!isInParamTag && docComments.length) { + // This is blank line when there is text already parsed + blankLineCount++; } } @@ -414,6 +435,8 @@ module ts { var paramDocComments: SymbolDisplayPart[] = []; while (pos < end) { if (isParamTag(pos, end, sourceFile)) { + var blankLineCount = 0; + var recordedParamTag = false; // Consume leading spaces pos = consumeWhiteSpaces(pos + paramTag.length); if (pos >= end) { @@ -475,8 +498,13 @@ module ts { // at line break, set this comment line text and go to next line if (isLineBreak(ch)) { if (paramHelpString) { - paramDocComments.push(textPart(paramHelpString)); + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); paramHelpString = ""; + blankLineCount = 0; + recordedParamTag = true; + } + else if (recordedParamTag) { + blankLineCount++; } // Get the pos after cleaning start of the line @@ -497,7 +525,7 @@ module ts { // If there is param help text, add it top the doc comments if (paramHelpString) { - paramDocComments.push(textPart(paramHelpString)); + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); } paramHelpStringMargin = undefined; } @@ -625,7 +653,7 @@ module ts { if (this.documentationComment === undefined) { this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations( [this.declaration], - this.declaration.name ? this.declaration.name.text : "", + /*name*/ undefined, /*canUseParsedParamTagComments*/ false) : []; } @@ -633,13 +661,12 @@ module ts { } } - var incrementalParse: IncrementalParse = TypeScript.IncrementalParser.parse; - class SourceFileObject extends NodeObject implements SourceFile { public filename: string; public text: string; public getLineAndCharacterFromPosition(position: number): { line: number; character: number } { return null; } public getPositionFromLineAndCharacter(line: number, character: number): number { return -1; } + public getLineStarts(): number[] { return undefined; } public amdDependencies: string[]; public referencedFiles: FileReference[]; public syntacticErrors: Diagnostic[]; @@ -655,23 +682,13 @@ module ts { public languageVersion: ScriptTarget; public identifiers: Map; - private syntaxTree: TypeScript.SyntaxTree; private scriptSnapshot: TypeScript.IScriptSnapshot; private namedDeclarations: Declaration[]; - public getSourceUnit(): TypeScript.SourceUnitSyntax { - // If we don't have a script, create one from our parse tree. - return this.getSyntaxTree().sourceUnit(); - } - public getScriptSnapshot(): TypeScript.IScriptSnapshot { return this.scriptSnapshot; } - public getLineMap(): TypeScript.LineMap { - return this.getSyntaxTree().lineMap(); - } - public getNamedDeclarations() { if (!this.namedDeclarations) { var sourceFile = this; @@ -681,7 +698,7 @@ module ts { switch (node.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.Method: - var functionDeclaration = node; + var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.kind !== SyntaxKind.Missing) { var lastDeclaration = namedDeclarations.length > 0 ? @@ -692,7 +709,7 @@ module ts { if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { // Overwrite the last declaration if it was an overload // and this one is an implementation. - if (functionDeclaration.body && !(lastDeclaration).body) { + if (functionDeclaration.body && !(lastDeclaration).body) { namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; } } @@ -706,6 +723,7 @@ module ts { case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.EnumDeclaration: case SyntaxKind.ModuleDeclaration: case SyntaxKind.ImportDeclaration: @@ -743,32 +761,7 @@ module ts { return this.namedDeclarations; } - public getSyntaxTree(): TypeScript.SyntaxTree { - if (!this.syntaxTree) { - var start = new Date().getTime(); - - this.syntaxTree = TypeScript.Parser.parse( - this.filename, TypeScript.SimpleText.fromScriptSnapshot(this.scriptSnapshot), this.languageVersion, this.isDeclareFile()); - - var time = new Date().getTime() - start; - - //TypeScript.syntaxTreeParseTime += time; - } - - return this.syntaxTree; - } - - private isDeclareFile(): boolean { - return TypeScript.isDTSFile(this.filename); - } - public update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile { - // See if we are currently holding onto a syntax tree. We may not be because we're - // either a closed file, or we've just been lazy and haven't had to create the syntax - // tree yet. Access the field instead of the method so we don't accidentally realize - // the old syntax tree. - var oldSyntaxTree = this.syntaxTree; - if (textChangeRange && Debug.shouldAssert(AssertionLevel.Normal)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; @@ -786,21 +779,12 @@ module ts { } } - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - // If we don't have a text change, or we don't have an old syntax tree, then do a full - // parse. Otherwise, do an incremental parse. - var newSyntaxTree = !textChangeRange || !oldSyntaxTree - ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) - : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - - return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); + return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); } - public static createSourceFileObject(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean, syntaxTree?: TypeScript.SyntaxTree) { + public static createSourceFileObject(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean) { var newSourceFile = createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; - newSourceFile.syntaxTree = syntaxTree; return newSourceFile; } } @@ -1101,7 +1085,7 @@ module ts { emitOutputStatus: EmitReturnStatus; } - export enum OutputFileType { + export const enum OutputFileType { JavaScript, SourceMap, Declaration @@ -1113,7 +1097,7 @@ module ts { text: string; } - export enum EndOfLineState { + export const enum EndOfLineState { Start, InMultiLineCommentTrivia, InSingleQuoteStringLiteral, @@ -1186,6 +1170,9 @@ module ts { // interface Y {} static interfaceElement = "interface"; + // type T = ... + static typeElement = "type"; + // enum E static enumElement = "enum"; @@ -1287,7 +1274,6 @@ module ts { position: number; // position in the file where the completion was requested entries: CompletionEntry[]; // entries for this completion symbols: Map; // symbols by entry name map - location: Node; // the node where the completion was requested typeChecker: TypeChecker; // the typeChecker used to generate this completion } @@ -1320,7 +1306,7 @@ module ts { return ""; } - interface DisplayPartsSymbolWriter extends SymbolWriter { + export interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; } @@ -1543,7 +1529,7 @@ module ts { var filenames = host.getScriptFileNames(); for (var i = 0, n = filenames.length; i < n; i++) { var filename = filenames[i]; - this.filenameToEntry[TypeScript.switchToForwardSlashes(filename)] = { + this.filenameToEntry[normalizeSlashes(filename)] = { filename: filename, version: host.getScriptVersion(filename), isOpen: host.getScriptIsOpen(filename) @@ -1558,7 +1544,7 @@ module ts { } public getEntry(filename: string): HostFileInformation { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); return lookUp(this.filenameToEntry, filename); } @@ -1629,7 +1615,9 @@ module ts { private initialize(filename: string) { // ensure that both source file and syntax tree are either initialized or not initialized Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); + var start = new Date().getTime(); this.hostCache = new HostCache(this.host); + this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); var syntaxTree: TypeScript.SyntaxTree = null; @@ -1637,26 +1625,41 @@ module ts { if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); + var start = new Date().getTime(); syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); - sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); + this.host.log("SyntaxTreeCache.Initialize: createSyntaxTree: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); + this.host.log("SyntaxTreeCache.Initialize: createSourceFile: " + (new Date().getTime() - start)); + + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); + + var start = new Date().getTime(); syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); + this.host.log("SyntaxTreeCache.Initialize: updateSyntaxTree: " + (new Date().getTime() - start)); var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); + + var start = new Date().getTime(); sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true) : this.currentSourceFile.update(scriptSnapshot, version, /*isOpen*/ true, editRange); + this.host.log("SyntaxTreeCache.Initialize: updateSourceFile: " + (new Date().getTime() - start)); + var start = new Date().getTime(); fixupParentReferences(sourceFile); + this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } if (syntaxTree !== null) { - Debug.assert(sourceFile); + Debug.assert(sourceFile !== undefined); // All done, ensure state is up to date this.currentFileVersion = version; this.currentFilename = filename; @@ -1797,7 +1800,7 @@ module ts { var buckets: Map> = {}; function getKeyFromCompilationSettings(settings: CompilerOptions): string { - return "_" + ScriptTarget[settings.target]; // + "|" + settings.propagateEnumConstantoString() + return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() } function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): Map { @@ -1864,9 +1867,9 @@ module ts { ): SourceFile { var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ false); - Debug.assert(bucket); + Debug.assert(bucket !== undefined); var entry = lookUp(bucket, filename); - Debug.assert(entry); + Debug.assert(entry !== undefined); if (entry.sourceFile.isOpen === isOpen && entry.sourceFile.version === version) { return entry.sourceFile; @@ -1878,7 +1881,7 @@ module ts { function releaseDocument(filename: string, compilationSettings: CompilerOptions): void { var bucket = getBucketForCompilationSettings(compilationSettings, false); - Debug.assert(bucket); + Debug.assert(bucket !== undefined); var entry = lookUp(bucket, filename); entry.refCount--; @@ -1897,6 +1900,68 @@ module ts { }; } + export function preProcessFile(sourceText: string, readImportFiles = true): PreProcessedFileInfo { + var referencedFiles: FileReference[] = []; + var importedFiles: FileReference[] = []; + var isNoDefaultLib = false; + + function processTripleSlashDirectives(): void { + var commentRanges = getLeadingCommentRanges(sourceText, 0); + forEach(commentRanges, commentRange => { + var comment = sourceText.substring(commentRange.pos, commentRange.end); + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, commentRange); + if (referencePathMatchResult) { + isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var fileReference = referencePathMatchResult.fileReference; + if (fileReference) { + referencedFiles.push(fileReference); + } + } + }); + } + + function processImport(): void { + scanner.setText(sourceText); + var token = scanner.scan(); + // Look for: + // import foo = module("foo"); + while (token !== SyntaxKind.EndOfFileToken) { + if (token === SyntaxKind.ImportKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.Identifier) { + token = scanner.scan(); + if (token === SyntaxKind.EqualsToken) { + token = scanner.scan(); + if (token === SyntaxKind.RequireKeyword) { + token = scanner.scan(); + if (token === SyntaxKind.OpenParenToken) { + token = scanner.scan(); + if (token === SyntaxKind.StringLiteral) { + var importPath = scanner.getTokenValue(); + var pos = scanner.getTokenPos(); + importedFiles.push({ + filename: importPath, + pos: pos, + end: pos + importPath.length + }); + } + } + } + } + } + } + token = scanner.scan(); + } + scanner.setText(undefined); + } + + if (readImportFiles) { + processImport(); + } + processTripleSlashDirectives(); + return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + } + /// Helpers export function getNodeModifiers(node: Node): string { var flags = node.flags; @@ -1957,21 +2022,21 @@ module ts { } function isRightSideOfPropertyAccess(node: Node) { - return node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node; + return node && node.parent && node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).right === node; } function isCallExpressionTarget(node: Node): boolean { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === SyntaxKind.CallExpression && (node.parent).func === node; + return node && node.parent && node.parent.kind === SyntaxKind.CallExpression && (node.parent).func === node; } function isNewExpressionTarget(node: Node): boolean { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === SyntaxKind.NewExpression && (node.parent).func === node; + return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (node.parent).func === node; } function isNameOfModuleDeclaration(node: Node) { @@ -1980,7 +2045,7 @@ module ts { function isNameOfFunctionDeclaration(node: Node): boolean { return node.kind === SyntaxKind.Identifier && - isAnyFunction(node.parent) && (node.parent).name === node; + isAnyFunction(node.parent) && (node.parent).name === node; } /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ @@ -2014,7 +2079,38 @@ module ts { (node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).externalModuleName === node)); } - enum SemanticMeaning { + /** Returns true if the position is within a comment */ + function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean { + // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment + return position <= token.getStart(sourceFile) && + (isInsideCommentRange(getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || + isInsideCommentRange(getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + + function isInsideCommentRange(comments: CommentRange[]): boolean { + return forEach(comments, comment => { + // either we are 1. completely inside the comment, or 2. at the end of the comment + if (comment.pos < position && position < comment.end) { + return true; + } + else if (position === comment.end) { + var text = sourceFile.text; + var width = comment.end - comment.pos; + // is single line comment or just /* + if (width <= 2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) { + return true; + } + else { + // is unterminated multi-line comment + return !(text.charCodeAt(comment.end - 1) === CharacterCodes.slash && + text.charCodeAt(comment.end - 2) === CharacterCodes.asterisk); + } + } + return false; + }); + } + } + + const enum SemanticMeaning { None = 0x0, Value = 0x1, Type = 0x2, @@ -2022,7 +2118,7 @@ module ts { All = Value | Type | Namespace } - enum BreakContinueSearchType { + const enum BreakContinueSearchType { None = 0x0, Unlabeled = 0x1, Labeled = 0x2, @@ -2041,7 +2137,7 @@ module ts { export function createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry): LanguageService { var syntaxTreeCache: SyntaxTreeCache = new SyntaxTreeCache(host); - var formattingRulesProvider: TypeScript.Services.Formatting.RulesProvider; + var ruleProvider: ts.formatting.RulesProvider; var hostCache: HostCache; // A cache of all the information about the files on the host side. var program: Program; @@ -2072,6 +2168,16 @@ module ts { return fullTypeCheckChecker_doNotAccessDirectly || (fullTypeCheckChecker_doNotAccessDirectly = program.getTypeChecker(/*fullTypeCheck*/ true)); } + function getRuleProvider(options: FormatCodeOptions) { + // Ensure rules are initialized and up to date wrt to formatting options + if (!ruleProvider) { + ruleProvider = new ts.formatting.RulesProvider(host); + } + + ruleProvider.ensureUpToDate(options); + return ruleProvider; + } + function createCompilerHost(): CompilerHost { return { getSourceFile: (filename, languageVersion) => { @@ -2226,7 +2332,7 @@ module ts { function getSyntacticDiagnostics(filename: string) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); return program.getDiagnostics(getSourceFile(filename).getSourceFile()); } @@ -2238,7 +2344,7 @@ module ts { function getSemanticDiagnostics(filename: string) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename) + filename = normalizeSlashes(filename) var compilerOptions = program.getCompilerOptions(); var checker = getFullTypeCheckChecker(); var targetSourceFile = getSourceFile(filename); @@ -2289,14 +2395,14 @@ module ts { if (isValid) { - return displayName; + return unescapeIdentifier(displayName); } } return undefined; } - function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker): CompletionEntry { + function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker, location: Node): CompletionEntry { // Try to get a valid display name for this symbol, if we could not find one, then ignore it. // We would like to only show things that can be added after a dot, so for instance numeric properties can // not be accessed with a dot (a.1 <- invalid) @@ -2311,56 +2417,238 @@ module ts { // We COULD also just do what 'getSymbolModifiers' does, which is to use the first declaration. return { name: displayName, - kind: getSymbolKind(symbol, typeChecker), + kind: getSymbolKind(symbol, typeChecker, location), kindModifiers: getSymbolModifiers(symbol) }; } function getCompletionsAtPosition(filename: string, position: number, isMemberCompletion: boolean) { - function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { - forEach(symbols, symbol => { - var entry = createCompletionEntry(symbol, session.typeChecker); - if (entry && !lookUp(session.symbols, entry.name)) { - session.entries.push(entry); - session.symbols[entry.name] = symbol; - } - }); + synchronizeHostData(); + + filename = normalizeSlashes(filename); + + var syntacticStart = new Date().getTime(); + var sourceFile = getSourceFile(filename); + + var start = new Date().getTime(); + var currentToken = getTokenAtPosition(sourceFile, position); + host.log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + + var start = new Date().getTime(); + // Completion not allowed inside comments, bail out if this is the case + var insideComment = isInsideComment(sourceFile, currentToken, position); + host.log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + + if (insideComment) { + host.log("Returning an empty list because completion was inside a comment."); + return undefined; } - function isCompletionListBlocker(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - // We shouldn't be getting a position that is outside the file because - // isEntirelyInsideComment can't handle when the position is out of bounds, - // callers should be fixed, however we should be resilient to bad inputs - // so we return true (this position is a blocker for getting completions) - if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) { - return true; + // The decision to provide completion depends on the previous token, so find it + // Note: previousToken can be undefined if we are the beginning of the file + var start = new Date().getTime(); + var previousToken = findPrecedingToken(position, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); + + // The caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| + // Skip this partial identifier to the previous token + if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) { + var start = new Date().getTime(); + previousToken = findPrecedingToken(previousToken.pos, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); + } + + // Check if this is a valid completion location + if (previousToken && isCompletionListBlocker(previousToken)) { + host.log("Returning an empty list because completion was requested in an invalid position."); + return undefined; + } + + // Find the node where completion is requested on, in the case of a completion after a dot, it is the member access expression + // other wise, it is a request for all visible symbols in the scope, and the node is the current location + var node: Node; + var isRightOfDot: boolean; + if (previousToken && previousToken.kind === SyntaxKind.DotToken && + (previousToken.parent.kind === SyntaxKind.PropertyAccess || previousToken.parent.kind === SyntaxKind.QualifiedName)) { + node = (previousToken.parent).left; + isRightOfDot = true; + } + else { + node = currentToken; + isRightOfDot = false; + } + + // Clear the current activeCompletionSession for this session + activeCompletionSession = { + filename: filename, + position: position, + entries: [], + symbols: {}, + typeChecker: typeInfoResolver + }; + host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); + + var location = getTouchingPropertyName(sourceFile, position); + // Populate the completion list + var semanticStart = new Date().getTime(); + if (isRightOfDot) { + // Right of dot member completion list + var symbols: Symbol[] = []; + isMemberCompletion = true; + + if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccess) { + var symbol = typeInfoResolver.getSymbolInfo(node); + + // This is an alias, follow what it aliases + if (symbol && symbol.flags & SymbolFlags.Import) { + symbol = typeInfoResolver.getAliasedSymbol(symbol); + } + + if (symbol && symbol.flags & SymbolFlags.HasExports) { + // Extract module or enum members + forEachValue(symbol.exports, symbol => { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } } - // This method uses Fidelity completely. Some information can be reached using the AST, but not everything. - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) || - TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) || - isIdentifierDefinitionLocation(sourceUnit, position) || - isRightOfIllegalDot(sourceUnit, position); + var type = typeInfoResolver.getTypeOfNode(node); + if (type) { + // Filter private properties + forEach(type.getApparentProperties(), symbol => { + if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + + getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + } + else { + var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(previousToken); + if (containingObjectLiteral) { + // Object literal expression, look up possible property names from contextual type + isMemberCompletion = true; + + var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + if (!contextualType) { + return undefined; + } + + var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + if (contextualTypeMembers && contextualTypeMembers.length > 0) { + // Add filtered items to the completion list + var filteredMembers = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); + getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); + } + } + else { + // Get scope members + isMemberCompletion = false; + + /// TODO filter meaning based on the current context + var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import; + var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); + + getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + } } - function getContainingObjectLiteralApplicableForCompletion(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxElement { + // Add keywords if this is not a member completion list + if (!isMemberCompletion) { + Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); + } + host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); + + return { + isMemberCompletion: isMemberCompletion, + entries: activeCompletionSession.entries + }; + + function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { + var start = new Date().getTime(); + forEach(symbols, symbol => { + var entry = createCompletionEntry(symbol, session.typeChecker, location); + if (entry) { + var id = escapeIdentifier(entry.name); + if (!lookUp(session.symbols, id)) { + session.entries.push(entry); + session.symbols[id] = symbol; + } + } + }); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + } + + function isCompletionListBlocker(previousToken: Node): boolean { + var start = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); + return result; + } + + function isInStringOrRegularExpressionOrTemplateLiteral(previousToken: Node): boolean { + if (previousToken.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(previousToken.kind)) { + // The position has to be either: 1. entirely within the token text, or + // 2. at the end position, and the string literal is not terminated + + var start = previousToken.getStart(); + var end = previousToken.getEnd(); + + if (start < position && position < end) { + return true; + } + else if (position === end) { + var width = end - start; + var text = previousToken.getSourceFile().text; + + // If the token is a single character, or its second-to-last charcter indicates an escape code, + // then we can immediately say that we are in the middle of an unclosed string. + if (width <= 1 || text.charCodeAt(end - 2) === CharacterCodes.backslash) { + return true; + } + + // Now check if the last character is a closing character for the token. + switch (previousToken.kind) { + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + return text.charCodeAt(start) !== text.charCodeAt(end - 1); + + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + return text.charCodeAt(end - 1) !== CharacterCodes.openBrace + || text.charCodeAt(end - 2) !== CharacterCodes.$; + + case SyntaxKind.TemplateTail: + return text.charCodeAt(end - 1) !== CharacterCodes.backtick; + } + + return false; + } + } + else if (previousToken.kind === SyntaxKind.RegularExpressionLiteral) { + return previousToken.getStart() < position && position < previousToken.getEnd(); + } + + return false; + } + + function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral { // The locations in an object literal expression that are applicable for completion are property name definition locations. - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); if (previousToken) { var parent = previousToken.parent; - switch (previousToken.kind()) { - case TypeScript.SyntaxKind.OpenBraceToken: // var x = { | - case TypeScript.SyntaxKind.CommaToken: // var x = { a: 0, | - if (parent && parent.kind() === TypeScript.SyntaxKind.SeparatedList) { - parent = parent.parent; + switch (previousToken.kind) { + case SyntaxKind.OpenBraceToken: // var x = { | + case SyntaxKind.CommaToken: // var x = { a: 0, | + if (parent && parent.kind === SyntaxKind.ObjectLiteral) { + return parent; } - - if (parent && parent.kind() === TypeScript.SyntaxKind.ObjectLiteralExpression) { - return parent; - } - break; } } @@ -2368,47 +2656,72 @@ module ts { return undefined; } - function isIdentifierDefinitionLocation(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); + function isFunction(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return true; + } + return false; + } - if (positionedToken) { - var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind(); - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.CommaToken: - return containingNodeKind === TypeScript.SyntaxKind.ParameterList || - containingNodeKind === TypeScript.SyntaxKind.VariableDeclaration || - containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { foo, | + function isIdentifierDefinitionLocation(previousToken: Node): boolean { + if (previousToken) { + var containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case SyntaxKind.CommaToken: + return containingNodeKind === SyntaxKind.VariableDeclaration || + containingNodeKind === SyntaxKind.VariableStatement || + containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | + isFunction(containingNodeKind); - case TypeScript.SyntaxKind.OpenParenToken: - return containingNodeKind === TypeScript.SyntaxKind.ParameterList || - containingNodeKind === TypeScript.SyntaxKind.CatchClause; + case SyntaxKind.OpenParenToken: + return containingNodeKind === SyntaxKind.CatchBlock || + isFunction(containingNodeKind); - case TypeScript.SyntaxKind.OpenBraceToken: - return containingNodeKind === TypeScript.SyntaxKind.EnumDeclaration; // enum { | + case SyntaxKind.OpenBraceToken: + return containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { | + containingNodeKind === SyntaxKind.InterfaceDeclaration; // interface a { | - case TypeScript.SyntaxKind.PublicKeyword: - case TypeScript.SyntaxKind.PrivateKeyword: - case TypeScript.SyntaxKind.StaticKeyword: - case TypeScript.SyntaxKind.DotDotDotToken: - return containingNodeKind === TypeScript.SyntaxKind.Parameter; + case SyntaxKind.SemicolonToken: + return containingNodeKind === SyntaxKind.Property && + previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration; // interface a { f; | - case TypeScript.SyntaxKind.ClassKeyword: - case TypeScript.SyntaxKind.ModuleKeyword: - case TypeScript.SyntaxKind.EnumKeyword: - case TypeScript.SyntaxKind.InterfaceKeyword: - case TypeScript.SyntaxKind.FunctionKeyword: - case TypeScript.SyntaxKind.VarKeyword: - case TypeScript.SyntaxKind.GetKeyword: - case TypeScript.SyntaxKind.SetKeyword: + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.StaticKeyword: + case SyntaxKind.DotDotDotToken: + return containingNodeKind === SyntaxKind.Parameter; + + case SyntaxKind.ClassKeyword: + case SyntaxKind.ModuleKeyword: + case SyntaxKind.EnumKeyword: + case SyntaxKind.InterfaceKeyword: + case SyntaxKind.FunctionKeyword: + case SyntaxKind.VarKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + case SyntaxKind.ImportKeyword: return true; } // Previous token may have been a keyword that was converted to an identifier. - switch (positionedToken.text()) { + switch (previousToken.getText()) { case "class": case "interface": case "enum": case "module": + case "function": + case "var": + // TODO: add let and const return true; } } @@ -2416,44 +2729,15 @@ module ts { return false; } - function getNonIdentifierCompleteTokenOnLeft(sourceUnit: TypeScript.SourceUnitSyntax, position: number): TypeScript.ISyntaxToken { - var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, /*includeSkippedTokens*/true); - - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == TypeScript.SyntaxKind.EndOfFileToken) { - // EndOfFile token is not interesting, get the one before it - positionedToken = TypeScript. previousToken(positionedToken, /*includeSkippedTokens*/true); - } - - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === TypeScript.SyntaxKind.IdentifierName) { - // The caret is at the end of an identifier, the decision to provide completion depends on the previous token - positionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true); - } - - return positionedToken; - } - - function isRightOfIllegalDot(sourceUnit: TypeScript.SourceUnitSyntax, position: number): boolean { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - - if (positionedToken) { - switch (positionedToken.kind()) { - case TypeScript.SyntaxKind.DotToken: - var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, /*includeSkippedTokens*/true); - return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === TypeScript.SyntaxKind.NumericLiteral; - - case TypeScript.SyntaxKind.NumericLiteral: - var text = positionedToken.text(); - return text.charAt(text.length - 1) === "."; - } + function isRightOfIllegalDot(previousToken: Node): boolean { + if (previousToken && previousToken.kind === SyntaxKind.NumericLiteral) { + var text = previousToken.getFullText(); + return text.charAt(text.length - 1) === "."; } return false; } - function isPunctuation(kind: SyntaxKind) { - return (SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation); - } - function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { if (!existingMembers || existingMembers.length === 0) { return contextualMemberSymbols; @@ -2471,7 +2755,8 @@ module ts { return; } - existingMemberNames[m.name.text] = true; + // TODO(jfreeman): Account for computed property name + existingMemberNames[(m.name).text] = true; }); var filteredMembers: Symbol[] = []; @@ -2483,168 +2768,14 @@ module ts { return filteredMembers; } - - synchronizeHostData(); - - filename = TypeScript.switchToForwardSlashes(filename); - - var sourceFile = getSourceFile(filename); - var sourceUnit = sourceFile.getSourceUnit(); - - if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) { - host.log("Returning an empty list because completion was blocked."); - return null; - } - - var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, /*useTrailingTriviaAsLimChar*/ true, /*forceInclusive*/ true); - - if (node && node.kind() === TypeScript.SyntaxKind.IdentifierName && - TypeScript.start(node) === TypeScript.end(node)) { - // Ignore missing name nodes - node = node.parent; - } - - var isRightOfDot = false; - if (node && - node.kind() === TypeScript.SyntaxKind.MemberAccessExpression && - TypeScript.end((node).expression) < position) { - - isRightOfDot = true; - node = (node).expression; - } - else if (node && - node.kind() === TypeScript.SyntaxKind.QualifiedName && - TypeScript.end((node).left) < position) { - - isRightOfDot = true; - node = (node).left; - } - else if (node && node.parent && - node.kind() === TypeScript.SyntaxKind.IdentifierName && - node.parent.kind() === TypeScript.SyntaxKind.MemberAccessExpression && - (node.parent).name === node) { - - isRightOfDot = true; - node = (node.parent).expression; - } - else if (node && node.parent && - node.kind() === TypeScript.SyntaxKind.IdentifierName && - node.parent.kind() === TypeScript.SyntaxKind.QualifiedName && - (node.parent).right === node) { - - isRightOfDot = true; - node = (node.parent).left; - } - - // TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node - var precedingToken = findTokenOnLeftOfPosition(sourceFile, TypeScript.end(node)); - var mappedNode: Node; - if (!precedingToken) { - mappedNode = sourceFile; - } - else if (isPunctuation(precedingToken.kind)) { - mappedNode = precedingToken.parent; - } - else { - mappedNode = precedingToken; - } - - Debug.assert(mappedNode, "Could not map a Fidelity node to an AST node"); - - // Get the completions - activeCompletionSession = { - filename: filename, - position: position, - entries: [], - symbols: {}, - location: mappedNode, - typeChecker: typeInfoResolver - }; - - // Right of dot member completion list - if (isRightOfDot) { - var symbols: Symbol[] = []; - isMemberCompletion = true; - - if (mappedNode.kind === SyntaxKind.Identifier || mappedNode.kind === SyntaxKind.QualifiedName || mappedNode.kind === SyntaxKind.PropertyAccess) { - var symbol = typeInfoResolver.getSymbolInfo(mappedNode); - - // This is an alias, follow what it aliases - if (symbol && symbol.flags & SymbolFlags.Import) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); - } - - if (symbol && symbol.flags & SymbolFlags.HasExports) { - // Extract module or enum members - forEachValue(symbol.exports, symbol => { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - } - - var type = typeInfoResolver.getTypeOfNode(mappedNode); - if (type) { - // Filter private properties - forEach(type.getApparentProperties(), symbol => { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); - - // Object literal expression, look up possible property names from contextual type - if (containingObjectLiteral) { - var objectLiteral = (mappedNode.kind === SyntaxKind.ObjectLiteral ? mappedNode : getAncestor(mappedNode, SyntaxKind.ObjectLiteral)); - - Debug.assert(objectLiteral); - - isMemberCompletion = true; - - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - if (!contextualType) { - return undefined; - } - - var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); - if (contextualTypeMembers && contextualTypeMembers.length > 0) { - // Add filtered items to the completion list - var filteredMembers = filterContextualMembersList(contextualTypeMembers, objectLiteral.properties); - getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); - } - } - // Get scope members - else { - isMemberCompletion = false; - /// TODO filter meaning based on the current context - var symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Import; - var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); - - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - } - - // Add keywords if this is not a member completion list - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - - return { - isMemberCompletion: isMemberCompletion, - entries: activeCompletionSession.entries - }; } function getCompletionEntryDetails(filename: string, position: number, entryName: string): CompletionEntryDetails { // Note: No need to call synchronizeHostData, as we have captured all the data we need // in the getCompletionsAtPosition earlier - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); + + var sourceFile = getSourceFile(filename); var session = activeCompletionSession; @@ -2653,16 +2784,16 @@ module ts { return undefined; } - var symbol = lookUp(activeCompletionSession.symbols, entryName); + var symbol = lookUp(activeCompletionSession.symbols, escapeIdentifier(entryName)); if (symbol) { - var type = session.typeChecker.getTypeOfSymbol(symbol); - Debug.assert(type, "Could not find type for symbol"); - var completionEntry = createCompletionEntry(symbol, session.typeChecker); + var location = getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); // TODO(drosen): Right now we just permit *all* semantic meanings when calling 'getSymbolKind' // which is permissible given that it is backwards compatible; but really we should consider // passing the meaning for the node so that we don't report that a suggestion for a value is an interface. // We COULD also just do what 'getSymbolModifiers' does, which is to use the first declaration. - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), session.location, session.typeChecker, session.location, SemanticMeaning.All); + Debug.assert(session.typeChecker.getNarrowedTypeOfSymbol(symbol, location) !== undefined, "Could not find type for symbol"); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, SemanticMeaning.All); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -2706,15 +2837,16 @@ module ts { } // TODO(drosen): use contextual SemanticMeaning. - function getSymbolKind(symbol: Symbol, typeResolver: TypeChecker): string { + function getSymbolKind(symbol: Symbol, typeResolver: TypeChecker, location?: Node): string { var flags = symbol.getFlags(); if (flags & SymbolFlags.Class) return ScriptElementKind.classElement; if (flags & SymbolFlags.Enum) return ScriptElementKind.enumElement; + if (flags & SymbolFlags.TypeAlias) return ScriptElementKind.typeElement; if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); if (result === ScriptElementKind.unknown) { if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement; @@ -2724,7 +2856,7 @@ module ts { return result; } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, typeResolver: TypeChecker) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, typeResolver: TypeChecker, location: Node) { if (typeResolver.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; } @@ -2748,15 +2880,24 @@ module ts { if (flags & SymbolFlags.Property) { if (flags & SymbolFlags.UnionProperty) { - return forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => { + // If union property is result of union of non method (property/accessors/variables), it is labeled as property + var unionPropertyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => { var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & SymbolFlags.Property) { + if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) { return ScriptElementKind.memberVariableElement; } - if (rootSymbolFlags & SymbolFlags.GetAccessor) return ScriptElementKind.memberVariableElement; - if (rootSymbolFlags & SymbolFlags.SetAccessor) return ScriptElementKind.memberVariableElement; - Debug.assert(rootSymbolFlags & SymbolFlags.Method); - }) || ScriptElementKind.memberFunctionElement; + Debug.assert(!!(rootSymbolFlags & SymbolFlags.Method)); + }); + if (!unionPropertyKind) { + // If this was union of all methods, + //make sure it has call signatures before we can label it as method + var typeOfUnionProperty = typeInfoResolver.getNarrowedTypeOfSymbol(symbol, location); + if (typeOfUnionProperty.getCallSignatures().length) { + return ScriptElementKind.memberFunctionElement; + } + return ScriptElementKind.memberVariableElement; + } + return unionPropertyKind; } return ScriptElementKind.memberVariableElement; } @@ -2782,6 +2923,7 @@ module ts { case SyntaxKind.ModuleDeclaration: return ScriptElementKind.moduleElement; case SyntaxKind.ClassDeclaration: return ScriptElementKind.classElement; case SyntaxKind.InterfaceDeclaration: return ScriptElementKind.interfaceElement; + case SyntaxKind.TypeAliasDeclaration: return ScriptElementKind.typeElement; case SyntaxKind.EnumDeclaration: return ScriptElementKind.enumElement; case SyntaxKind.VariableDeclaration: return node.flags & NodeFlags.Const ? ScriptElementKind.constantElement: ScriptElementKind.variableElement; case SyntaxKind.FunctionDeclaration: return ScriptElementKind.functionElement; @@ -2796,8 +2938,8 @@ module ts { case SyntaxKind.TypeParameter: return ScriptElementKind.typeParameterElement; case SyntaxKind.EnumMember: return ScriptElementKind.variableElement; case SyntaxKind.Parameter: return (node.flags & NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - return ScriptElementKind.unknown; } + return ScriptElementKind.unknown; } function getSymbolModifiers(symbol: Symbol): string { @@ -2813,7 +2955,7 @@ module ts { var displayParts: SymbolDisplayPart[] = []; var documentation: SymbolDisplayPart[]; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); var hasAddedSymbolInfo: boolean; // Class at constructor site need to be shown as constructor apart from property,method, vars if (symbolKind !== ScriptElementKind.unknown || symbolFlags & SymbolFlags.Class || symbolFlags & SymbolFlags.Import) { @@ -2822,16 +2964,26 @@ module ts { symbolKind = ScriptElementKind.memberVariableElement; } - var type = typeResolver.getTypeOfSymbol(symbol); + var type = typeResolver.getNarrowedTypeOfSymbol(symbol, location); if (type) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - // try get the call/construct signature from the type if it matches - var callExpression: CallExpression; - if (location.parent.kind === SyntaxKind.PropertyAccess && (location.parent).right === location) { + if (location.parent && location.parent.kind === SyntaxKind.PropertyAccess) { + var right = (location.parent).right; + // Either the location is on the right of a property access, or on the left and the right is missing + if (right === location || (right && right.kind === SyntaxKind.Missing)){ location = location.parent; } - callExpression = location.parent; + } + // try get the call/construct signature from the type if it matches + var callExpression: CallExpression; + if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) { + callExpression = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { + callExpression = location.parent; + } + + if (callExpression) { var candidateSignatures: Signature[] = []; signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { @@ -2899,7 +3051,7 @@ module ts { (location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var signature: Signature; - var functionDeclaration = location.parent; + var functionDeclaration = location.parent; var allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); @@ -2936,6 +3088,16 @@ module ts { addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } + if (symbolFlags & SymbolFlags.TypeAlias) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(SyntaxKind.TypeKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + } if (symbolFlags & SymbolFlags.Enum) { addNewLineIfDisplayPartsExist(); displayParts.push(keywordPart(SyntaxKind.EnumKeyword)); @@ -2995,13 +3157,13 @@ module ts { displayParts.push(keywordPart(SyntaxKind.ImportKeyword)); displayParts.push(spacePart()); addFullSymbolName(symbol); - displayParts.push(spacePart()); - displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); - displayParts.push(spacePart()); ts.forEach(symbol.declarations, declaration => { if (declaration.kind === SyntaxKind.ImportDeclaration) { var importDeclaration = declaration; if (importDeclaration.externalModuleName) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); displayParts.push(keywordPart(SyntaxKind.RequireKeyword)); displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); displayParts.push(displayPart(getTextOfNode(importDeclaration.externalModuleName), SymbolDisplayPartKind.stringLiteral)); @@ -3009,7 +3171,12 @@ module ts { } else { var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); - addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + if (internalAliasSymbol) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } } return true; } @@ -3048,7 +3215,7 @@ module ts { } } else { - symbolKind = getSymbolKind(symbol, typeResolver); + symbolKind = getSymbolKind(symbol, typeResolver, location); } } @@ -3106,7 +3273,7 @@ module ts { function getQuickInfoAtPosition(fileName: string, position: number): QuickInfo { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = getTouchingPropertyName(sourceFile, position); if (!node) { @@ -3169,7 +3336,7 @@ module ts { if ((selectConstructors && d.kind === SyntaxKind.Constructor) || (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.Method))) { declarations.push(d); - if ((d).body) definition = d; + if ((d).body) definition = d; } }); @@ -3208,7 +3375,7 @@ module ts { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var sourceFile = getSourceFile(filename); var node = getTouchingPropertyName(sourceFile, position); @@ -3272,7 +3439,7 @@ module ts { function getOccurrencesAtPosition(filename: string, position: number): ReferenceEntry[] { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var sourceFile = getSourceFile(filename); var node = getTouchingWord(sourceFile, position); @@ -3416,7 +3583,7 @@ module ts { } function getReturnOccurrences(returnStatement: ReturnStatement): ReferenceEntry[] { - var func = getContainingFunction(returnStatement); + var func = getContainingFunction(returnStatement); // If we didn't find a containing function with a block body, bail out. if (!(func && hasKind(func.body, SyntaxKind.FunctionBlock))) { @@ -3575,9 +3742,6 @@ module ts { pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); - // Types of break statements we can grab on to. - var breakSearchType = BreakContinueSearchType.All; - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. forEach(switchStatement.clauses, clause => { pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); @@ -3725,7 +3889,7 @@ module ts { function findReferences(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): ReferenceEntry[] { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = getTouchingPropertyName(sourceFile, position); @@ -3815,7 +3979,7 @@ module ts { function getNormalizedSymbolName(symbolName: string, declarations: Declaration[]): string { // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = forEach(declarations, d => d.kind === SyntaxKind.FunctionExpression ? d : undefined); + var functionExpression = forEach(declarations, d => d.kind === SyntaxKind.FunctionExpression ? d : undefined); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; @@ -3836,7 +4000,7 @@ module ts { if (symbol.getFlags() && (SymbolFlags.Property | SymbolFlags.Method)) { var privateDeclaration = forEach(symbol.getDeclarations(), d => (d.flags & NodeFlags.Private) ? d : undefined); if (privateDeclaration) { - return privateDeclaration.parent; + return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration); } } @@ -4374,7 +4538,8 @@ module ts { var declarations = sourceFile.getNamedDeclarations(); for (var i = 0, n = declarations.length; i < n; i++) { var declaration = declarations[i]; - var name = declaration.name.text; + // TODO(jfreeman): Skip this declaration if it has a computed name + var name = (declaration.name).text; var matchKind = getMatchKind(searchTerms, name); if (matchKind !== MatchKind.none) { var container = getContainerNode(declaration); @@ -4385,7 +4550,8 @@ module ts { matchKind: MatchKind[matchKind], fileName: filename, textSpan: TypeScript.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), - containerName: container.name ? container.name.text : "", + // TODO(jfreeman): What should be the containerName when the container has a computed name? + containerName: container.name ? (container.name).text : "", containerKind: container.name ? getNodeKind(container) : "" }); } @@ -4444,12 +4610,11 @@ module ts { function getEmitOutput(filename: string): EmitOutput { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var compilerOptions = program.getCompilerOptions(); var targetSourceFile = program.getSourceFile(filename); // Current selected file to be output // If --out flag is not specified, shouldEmitToOwnFile is true. Otherwise shouldEmitToOwnFile is false. var shouldEmitToOwnFile = ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions); - var emitDeclaration = compilerOptions.declaration; var emitOutput: EmitOutput = { outputFiles: [], emitOutputStatus: undefined, @@ -4466,7 +4631,6 @@ module ts { // Initialize writer for CompilerHost.writeFile writer = getEmitOutputWriter; - var syntacticDiagnostics: Diagnostic[] = []; var containSyntacticErrors = false; if (shouldEmitToOwnFile) { @@ -4523,6 +4687,7 @@ module ts { case SyntaxKind.TypeParameter: case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: case SyntaxKind.TypeLiteral: return SemanticMeaning.Type; @@ -4534,7 +4699,7 @@ module ts { if ((node).name.kind === SyntaxKind.StringLiteral) { return SemanticMeaning.Namespace | SemanticMeaning.Value; } - else if (isInstantiated(node)) { + else if (getModuleInstanceState(node) === ModuleInstanceState.Instantiated) { return SemanticMeaning.Namespace | SemanticMeaning.Value; } else { @@ -4569,11 +4734,10 @@ module ts { return root.parent.kind === SyntaxKind.TypeReference && !isLastClause; } - function isInRightSideOfImport(node: EntityName) { + function isInRightSideOfImport(node: Node) { while (node.parent.kind === SyntaxKind.QualifiedName) { node = node.parent; } - return node.parent.kind === SyntaxKind.ImportDeclaration && (node.parent).entityName === node; } @@ -4620,7 +4784,7 @@ module ts { function getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); @@ -4651,7 +4815,7 @@ module ts { var start = signatureInfoString.length; signatureInfoString += displayPartsToString(parameter.displayParts); - var end = signatureInfoString.length - 1; + var end = signatureInfoString.length; // add the parameter to the list parameters.push({ @@ -4690,12 +4854,12 @@ module ts { /// Syntactic features function getSyntaxTree(filename: string): TypeScript.SyntaxTree { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); return syntaxTreeCache.getCurrentFileSyntaxTree(filename); } function getCurrentSourceFile(filename: string): SourceFile { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); return currentSourceFile; } @@ -4762,14 +4926,14 @@ module ts { } function getNavigationBarItems(filename: string): NavigationBarItem[] { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); return NavigationBar.getNavigationBarItems(getCurrentSourceFile(filename)); } function getSemanticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[] { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); @@ -4812,7 +4976,7 @@ module ts { */ function hasValueSideModule(symbol: Symbol): boolean { return forEach(symbol.declarations, declaration => { - return declaration.kind === SyntaxKind.ModuleDeclaration && isInstantiated(declaration); + return declaration.kind === SyntaxKind.ModuleDeclaration && getModuleInstanceState(declaration) == ModuleInstanceState.Instantiated; }); } } @@ -4840,7 +5004,7 @@ module ts { function getSyntacticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[] { // doesn't use compiler - no need to synchronize with host - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getCurrentSourceFile(fileName); var result: ClassifiedSpan[] = []; @@ -4890,7 +5054,7 @@ module ts { } } - if (isPunctuation(token)) { + if (isPunctuation(token.kind)) { // the '=' in a variable declaration is special cased here. if (token.parent.kind === SyntaxKind.BinaryExpression || token.parent.kind === SyntaxKind.VariableDeclaration || @@ -4913,6 +5077,10 @@ module ts { // TODO: we should get another classification type for these literals. return ClassificationTypeNames.stringLiteral; } + else if (isTemplateLiteralKind(tokenKind)) { + // TODO (drosen): we should *also* get another classification type for these literals. + return ClassificationTypeNames.stringLiteral; + } else if (tokenKind === SyntaxKind.Identifier) { switch (token.parent.kind) { case SyntaxKind.ClassDeclaration: @@ -4966,7 +5134,7 @@ module ts { function getOutliningSpans(filename: string): OutliningSpan[] { // doesn't use compiler - no need to synchronize with host - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); var sourceFile = getCurrentSourceFile(filename); return OutliningElementsCollector.collectElements(sourceFile); } @@ -5025,71 +5193,63 @@ module ts { } function getIndentationAtPosition(filename: string, position: number, editorOptions: EditorOptions) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = normalizeSlashes(filename); + var start = new Date().getTime(); var sourceFile = getCurrentSourceFile(filename); - var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter) + host.log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); - return formatting.SmartIndenter.getIndentation(position, sourceFile, options); - } + var start = new Date().getTime(); - function getFormattingManager(filename: string, options: FormatCodeOptions) { - // Ensure rules are initialized and up to date wrt to formatting options - if (formattingRulesProvider == null) { - formattingRulesProvider = new TypeScript.Services.Formatting.RulesProvider(host); - } + var result = formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); + host.log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); - formattingRulesProvider.ensureUpToDate(options); - - // Get the Syntax Tree - var syntaxTree = getSyntaxTree(filename); - - // Convert IScriptSnapshot to ITextSnapshot - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - - var manager = new TypeScript.Services.Formatting.FormattingManager(syntaxTree, textSnapshot, formattingRulesProvider, options); - - return manager; + return result; } function getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[] { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var manager = getFormattingManager(fileName, options); - return manager.formatSelection(start, end); + fileName = normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + return formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options); } function getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[] { - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatDocument(); + var sourceFile = getCurrentSourceFile(fileName); + return formatting.formatDocument(sourceFile, getRuleProvider(options), options); } function getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[] { - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); - var manager = getFormattingManager(fileName, options); + var sourceFile = getCurrentSourceFile(fileName); if (key === "}") { - return manager.formatOnClosingCurlyBrace(position); + return formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options); } else if (key === ";") { - return manager.formatOnSemicolon(position); + return formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(options), options); } else if (key === "\n") { - return manager.formatOnEnter(position); + return formatting.formatOnEnter(position, sourceFile, getRuleProvider(options), options); } return []; } function getTodoComments(filename: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { - filename = TypeScript.switchToForwardSlashes(filename); + // Note: while getting todo comments seems like a syntactic operation, we actually + // treat it as a semantic operation here. This is because we expect our host to call + // this on every single file. If we treat this syntactically, then that will cause + // us to populate and throw away the tree in our syntax tree cache for each file. By + // treating this as a semantic operation, we can access any tree without throwing + // anything away. + synchronizeHostData(); - var sourceFile = getCurrentSourceFile(filename); + filename = normalizeSlashes(filename); + + var sourceFile = getSourceFile(filename); cancellationToken.throwIfCancellationRequested(); @@ -5132,16 +5292,7 @@ module ts { // OK, we have found a match in the file. This is only an acceptable match if // it is contained within a comment. var token = getTokenAtPosition(sourceFile, matchPosition); - - if (token.getStart() <= matchPosition && matchPosition < token.getEnd()) { - // match was within the token itself. Not in the comment. Keep searching - // descriptor. - continue; - } - - // Looks to be within the trivia. See if we can find the comment containing it. - if (!getContainingComment(getTrailingCommentRanges(fileContents, token.getFullStart()), matchPosition) && - !getContainingComment(getLeadingCommentRanges(fileContents, token.getFullStart()), matchPosition)) { + if (!isInsideComment(sourceFile, token, matchPosition)) { continue; } @@ -5151,7 +5302,7 @@ module ts { descriptor = descriptors[i]; } } - Debug.assert(descriptor); + Debug.assert(descriptor !== undefined); // We don't want to match something like 'TODOBY', so we make sure a non // letter/digit follows the match. @@ -5256,7 +5407,7 @@ module ts { function getRenameInfo(fileName: string, position: number): RenameInfo { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = getTouchingWord(sourceFile, position); @@ -5395,7 +5546,6 @@ module ts { function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; - var lastTokenOrCommentEnd = 0; var token = SyntaxKind.Unknown; var lastNonTriviaToken = SyntaxKind.Unknown; diff --git a/src/services/shims.ts b/src/services/shims.ts index a6bf421b095..00acff3798a 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -16,7 +16,6 @@ /// /// -/// var debugObjectHost = (this); @@ -55,6 +54,17 @@ module ts { getDefaultLibFilename(): string; } + /// + /// Pre-processing + /// + // Note: This is being using by the host (VS) and is marshaled back and forth. + // When changing this make sure the changes are reflected in the managed side as well + export interface IFileReference { + path: string; + position: number; + length: number; + } + /** Public interface of a language service instance shim. */ export interface ShimFactory { registerShim(shim: Shim): void; @@ -171,13 +181,13 @@ module ts { } /// TODO: delete this, it is only needed until the VS interface is updated - export enum LanguageVersion { + export const enum LanguageVersion { EcmaScript3 = 0, EcmaScript5 = 1, EcmaScript6 = 2, } - export enum ModuleGenTarget { + export const enum ModuleGenTarget { Unspecified = 0, Synchronous = 1, Asynchronous = 2, @@ -507,17 +517,6 @@ module ts { }; } - private realizeDiagnosticWithFileName(diagnostic: Diagnostic): { fileName: string; message: string; start: number; length: number; category: string; } { - return { - fileName: diagnostic.file.filename, - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: DiagnosticCategory[diagnostic.category].toLowerCase() - }; - } - public getSyntacticClassifications(fileName: string, start: number, length: number): string { return this.forwardJSONCall( "getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", @@ -559,7 +558,7 @@ module ts { "getCompilerOptionsDiagnostics()", () => { var errors = this.languageService.getCompilerOptionsDiagnostics(); - return errors.map(d => this.realizeDiagnosticWithFileName(d)) + return errors.map(LanguageServiceShimObject.realizeDiagnostic) }); } @@ -846,12 +845,33 @@ module ts { return forwardJSONCall(this.logger, actionDescription, action); } - public getPreProcessedFileInfo(fileName: string, sourceText: TypeScript.IScriptSnapshot): string { + public getPreProcessedFileInfo(fileName: string, sourceTextSnapshot: TypeScript.IScriptSnapshot): string { return this.forwardJSONCall( "getPreProcessedFileInfo('" + fileName + "')", () => { - var result = TypeScript.preProcessFile(fileName, sourceText); - return result; + var result = preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + var convertResult = { + referencedFiles: [], + importedFiles: [], + isLibFile: result.isLibFile + }; + + forEach(result.referencedFiles, refFile => { + convertResult.referencedFiles.push({ + path: normalizePath(refFile.filename), + position: refFile.pos, + length: refFile.end - refFile.pos + }); + }); + + forEach(result.importedFiles, importedFile => { + convertResult.importedFiles.push({ + path: normalizeSlashes(importedFile.filename), + position: importedFile.pos, + length: importedFile.end - importedFile.pos + }); + }); + return convertResult; }); } diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 86e378abb45..41f64c1b8db 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -219,19 +219,19 @@ module ts.SignatureHelp { // Find the list that starts right *after* the < or ( token. // If the user has just opened a list, consider this item 0. var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); - Debug.assert(list); + Debug.assert(list !== undefined); return { list: list, listItemIndex: 0 }; } - if (node.kind === SyntaxKind.GreaterThanToken - || node.kind === SyntaxKind.CloseParenToken - || node === parent.func) { - return undefined; - } - + // findListItemInfo can return undefined if we are not in parent's argument list + // or type argument list. This includes cases where the cursor is: + // - To the right of the closing paren + // - Between the type arguments and the arguments (greater than token) + // - On the target of the call (parent.func) + // - On the 'new' keyword in a 'new' expression return findListItemInfo(node); } @@ -244,7 +244,7 @@ module ts.SignatureHelp { // If the node is not a subspan of its parent, this is a big problem. // There have been crashes that might be caused by this violation. if (n.pos < n.parent.pos || n.end > n.parent.end) { - Debug.fail("Node of kind " + SyntaxKind[n.kind] + " is not a subspan of its parent of kind " + SyntaxKind[n.parent.kind]); + Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } var argumentInfo = getImmediatelyContainingArgumentInfo(n); diff --git a/src/services/formatting/smartIndenter.ts b/src/services/smartIndenter.ts similarity index 69% rename from src/services/formatting/smartIndenter.ts rename to src/services/smartIndenter.ts index 79b238c893d..7a56ea07be3 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/smartIndenter.ts @@ -1,8 +1,8 @@ -/// +/// module ts.formatting { export module SmartIndenter { - export function getIndentation(position: number, sourceFile: SourceFile, options: TypeScript.FormattingOptions): number { + export function getIndentation(position: number, sourceFile: SourceFile, options: EditorOptions): number { if (position > sourceFile.text.length) { return 0; // past EOF } @@ -13,8 +13,8 @@ module ts.formatting { } // no indentation in string \regex literals - if ((precedingToken.kind === SyntaxKind.StringLiteral || precedingToken.kind === SyntaxKind.RegularExpressionLiteral) && - precedingToken.getStart(sourceFile) <= position && + if ((precedingToken.kind === SyntaxKind.StringLiteral || precedingToken.kind === SyntaxKind.RegularExpressionLiteral) && + precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { return 0; } @@ -37,14 +37,14 @@ module ts.formatting { var indentationDelta: number; while (current) { - if (positionBelongsToNode(current, position, sourceFile) && nodeContentIsIndented(current, previous)) { + if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : SyntaxKind.Unknown)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; } else { - indentationDelta = lineAtPosition !== currentStart.line ? options.indentSpaces : 0; + indentationDelta = lineAtPosition !== currentStart.line ? options.IndentSize : 0; } break; @@ -59,12 +59,27 @@ module ts.formatting { previous = current; current = current.parent; } - + if (!current) { // no parent was found - return 0 to be indented on the level of SourceFile return 0; } + return getIndentationForNodeWorker(current, currentStart, /*ignoreActualIndentationRange*/ undefined, indentationDelta, sourceFile, options); + } + + export function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: FormatCodeOptions): number { + var start = sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); + return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, /*indentationDelta*/ 0, sourceFile, options); + } + + function getIndentationForNodeWorker( + current: Node, + currentStart: LineAndCharacter, + ignoreActualIndentationRange: TextRange, + indentationDelta: number, + sourceFile: SourceFile, + options: EditorOptions): number { var parent: Node = current.parent; var parentStart: LineAndCharacter; @@ -72,26 +87,35 @@ module ts.formatting { // walk upwards and collect indentations for pairs of parent-child nodes // indentation is not added if parent and child nodes start on the same line or if parent is IfStatement and child starts on the same line with 'else clause' while (parent) { - // check if current node is a list item - if yes, take indentation from it - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation + indentationDelta; + var useActualIndentation = true; + if (ignoreActualIndentationRange) { + var start = current.getStart(sourceFile); + useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; } - parentStart = sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); - var parentAndChildShareLine = - parentStart.line === currentStart.line || + if (useActualIndentation) { + // check if current node is a list item - if yes, take indentation from it + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + parentStart = getParentStart(parent, current, sourceFile); + var parentAndChildShareLine = + parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); - // try to fetch actual indentation for current node from source text - var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation + indentationDelta; + if (useActualIndentation) { + // try to fetch actual indentation for current node from source text + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } } // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line - if (nodeContentIsIndented(parent, current) && !parentAndChildShareLine) { - indentationDelta += options.indentSpaces; + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + indentationDelta += options.IndentSize; } current = parent; @@ -102,13 +126,23 @@ module ts.formatting { return indentationDelta; } + + function getParentStart(parent: Node, child: Node, sourceFile: SourceFile): LineAndCharacter { + var containingList = getContainingList(child, sourceFile); + if (containingList) { + return sourceFile.getLineAndCharacterFromPosition(containingList.pos); + } + + return sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); + } + /* * Function returns -1 if indentation cannot be determined - */ - function getActualIndentationForListItemBeforeComma(commaToken: Node, sourceFile: SourceFile, options: TypeScript.FormattingOptions): number { + */ + function getActualIndentationForListItemBeforeComma(commaToken: Node, sourceFile: SourceFile, options: EditorOptions): number { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var commaItemInfo = findListItemInfo(commaToken); - Debug.assert(commaItemInfo.listItemIndex > 0); + Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); // The item we're interested in is right before the comma return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } @@ -116,20 +150,20 @@ module ts.formatting { /* * Function returns -1 if actual indentation for node should not be used (i.e because node is nested expression) */ - function getActualIndentationForNode(current: Node, - parent: Node, - currentLineAndChar: LineAndCharacter, - parentAndChildShareLine: boolean, - sourceFile: SourceFile, - options: TypeScript.FormattingOptions): number { + function getActualIndentationForNode(current: Node, + parent: Node, + currentLineAndChar: LineAndCharacter, + parentAndChildShareLine: boolean, + sourceFile: SourceFile, + options: EditorOptions): number { // actual indentation is used for statements\declarations if one of cases below is true: // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line - var useActualIndentation = + var useActualIndentation = (isDeclaration(current) || isStatement(current)) && (parent.kind === SyntaxKind.SourceFile || !parentAndChildShareLine); - + if (!useActualIndentation) { return -1; } @@ -142,7 +176,7 @@ module ts.formatting { if (!nextToken) { return false; } - + if (nextToken.kind === SyntaxKind.OpenBraceToken) { // open braces are always indented at the parent level return true; @@ -172,30 +206,30 @@ module ts.formatting { return candidate.end > position || !isCompletedNode(candidate, sourceFile); } - function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: Node, childStartLine: number, sourceFile: SourceFile): boolean { + export function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFile): boolean { if (parent.kind === SyntaxKind.IfStatement && (parent).elseStatement === child) { var elseKeyword = findChildOfKind(parent, SyntaxKind.ElseKeyword, sourceFile); - Debug.assert(elseKeyword); + Debug.assert(elseKeyword !== undefined); - var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; + var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; } + + return false; } - function getActualIndentationForListItem(node: Node, sourceFile: SourceFile, options: TypeScript.FormattingOptions): number { + function getContainingList(node: Node, sourceFile: SourceFile): NodeArray { if (node.parent) { switch (node.parent.kind) { case SyntaxKind.TypeReference: if ((node.parent).typeArguments) { - return getActualIndentationFromList((node.parent).typeArguments); + return (node.parent).typeArguments; } break; case SyntaxKind.ObjectLiteral: - return getActualIndentationFromList((node.parent).properties); - case SyntaxKind.TypeLiteral: - return getActualIndentationFromList((node.parent).members); + return (node.parent).properties; case SyntaxKind.ArrayLiteral: - return getActualIndentationFromList((node.parent).elements); + return (node.parent).elements; case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: @@ -203,21 +237,26 @@ module ts.formatting { case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: if ((node.parent).typeParameters && node.end < (node.parent).typeParameters.end) { - return getActualIndentationFromList((node.parent).typeParameters); + return (node.parent).typeParameters; } - - return getActualIndentationFromList((node.parent).parameters); + + return (node.parent).parameters; case SyntaxKind.NewExpression: case SyntaxKind.CallExpression: if ((node.parent).typeArguments && node.end < (node.parent).typeArguments.end) { - return getActualIndentationFromList((node.parent).typeArguments); + return (node.parent).typeArguments; } - - return getActualIndentationFromList((node.parent).arguments); + + return (node.parent).arguments; } } - return -1; + return undefined; + } + + function getActualIndentationForListItem(node: Node, sourceFile: SourceFile, options: EditorOptions): number { + var containingList = getContainingList(node, sourceFile); + return containingList ? getActualIndentationFromList(containingList) : -1; function getActualIndentationFromList(list: Node[]): number { var index = indexOf(list, node); @@ -226,13 +265,13 @@ module ts.formatting { } - function deriveActualIndentationFromList(list: Node[], index: number, sourceFile: SourceFile, options: TypeScript.FormattingOptions): number { + function deriveActualIndentationFromList(list: Node[], index: number, sourceFile: SourceFile, options: EditorOptions): number { Debug.assert(index >= 0 && index < list.length); var node = list[index]; // walk toward the start of the list starting from current node and check if the line is the same for all items. // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] - var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); + var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); for (var i = index - 1; i >= 0; --i) { if (list[i].kind === SyntaxKind.CommaToken) { continue; @@ -248,53 +287,34 @@ module ts.formatting { return -1; } - function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter: LineAndCharacter, sourceFile: SourceFile, options: TypeScript.FormattingOptions): number { + function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter: LineAndCharacter, sourceFile: SourceFile, options: EditorOptions): number { var lineStart = sourceFile.getPositionFromLineAndCharacter(lineAndCharacter.line, 1); + return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); + } + + export function findFirstNonWhitespaceColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorOptions): number { var column = 0; - for (var i = 0; i < lineAndCharacter.character; ++i) { - var charCode = sourceFile.text.charCodeAt(lineStart + i); - if (!isWhiteSpace(charCode)) { + for (var pos = startPos; pos < endPos; ++pos) { + var ch = sourceFile.text.charCodeAt(pos); + if (!isWhiteSpace(ch)) { return column; } - if (charCode === CharacterCodes.tab) { - column += options.spacesPerTab; + if (ch === CharacterCodes.tab) { + column += options.TabSize + (column % options.TabSize); } else { column++; } } - return column; } - function nodeContentIsIndented(parent: Node, child: Node): boolean { - switch (parent.kind) { + function nodeContentIsAlwaysIndented(kind: SyntaxKind): boolean { + switch (kind) { case SyntaxKind.ClassDeclaration: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.EnumDeclaration: - return true; - case SyntaxKind.ModuleDeclaration: - // ModuleBlock should take care of indentation - return false; - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.Method: - case SyntaxKind.FunctionExpression: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.Constructor: - // FunctionBlock should take care of indentation - return false; - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForStatement: - return child && child.kind !== SyntaxKind.Block; - case SyntaxKind.IfStatement: - return child && child.kind !== SyntaxKind.Block; - case SyntaxKind.TryStatement: - // TryBlock\CatchBlock\FinallyBlock should take care of indentation - return false; case SyntaxKind.ArrayLiteral: case SyntaxKind.Block: case SyntaxKind.FunctionBlock: @@ -312,7 +332,32 @@ module ts.formatting { case SyntaxKind.NewExpression: case SyntaxKind.VariableStatement: case SyntaxKind.VariableDeclaration: + case SyntaxKind.ExportAssignment: + case SyntaxKind.ReturnStatement: return true; + } + return false; + } + + export function shouldIndentChildNode(parent: SyntaxKind, child: SyntaxKind): boolean { + if (nodeContentIsAlwaysIndented(parent)) { + return true; + } + switch (parent) { + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.IfStatement: + return child !== SyntaxKind.Block; + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Method: + case SyntaxKind.ArrowFunction: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return child !== SyntaxKind.FunctionBlock; default: return false; } @@ -361,14 +406,14 @@ module ts.formatting { case SyntaxKind.FunctionExpression: case SyntaxKind.Method: case SyntaxKind.ArrowFunction: - return !(n).body || isCompletedNode((n).body, sourceFile); + return !(n).body || isCompletedNode((n).body, sourceFile); case SyntaxKind.ModuleDeclaration: return (n).body && isCompletedNode((n).body, sourceFile); case SyntaxKind.IfStatement: if ((n).elseStatement) { return isCompletedNode((n).elseStatement, sourceFile); } - return isCompletedNode((n).thenStatement, sourceFile); + return isCompletedNode((n).thenStatement, sourceFile); case SyntaxKind.ExpressionStatement: return isCompletedNode((n).expression, sourceFile); case SyntaxKind.ArrayLiteral: @@ -384,10 +429,10 @@ module ts.formatting { case SyntaxKind.DoStatement: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; var hasWhileKeyword = findChildOfKind(n, SyntaxKind.WhileKeyword, sourceFile); - if(hasWhileKeyword) { + if (hasWhileKeyword) { return nodeEndsWith(n, SyntaxKind.CloseParenToken, sourceFile); } - return isCompletedNode((n).statement, sourceFile); + return isCompletedNode((n).statement, sourceFile); default: return true; } diff --git a/src/services/syntax/SyntaxGenerator.js b/src/services/syntax/SyntaxGenerator.js new file mode 100644 index 00000000000..0937947c80f --- /dev/null +++ b/src/services/syntax/SyntaxGenerator.js @@ -0,0 +1,2242 @@ +var sys = (function () { + function getWScriptSystem() { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + var fileStream = new ActiveXObject("ADODB.Stream"); + fileStream.Type = 2; + var binaryStream = new ActiveXObject("ADODB.Stream"); + binaryStream.Type = 1; + var args = []; + for (var i = 0; i < WScript.Arguments.length; i++) { + args[i] = WScript.Arguments.Item(i); + } + function readFile(fileName, encoding) { + if (!fso.FileExists(fileName)) { + return undefined; + } + fileStream.Open(); + try { + if (encoding) { + fileStream.Charset = encoding; + fileStream.LoadFromFile(fileName); + } + else { + fileStream.Charset = "x-ansi"; + fileStream.LoadFromFile(fileName); + var bom = fileStream.ReadText(2) || ""; + fileStream.Position = 0; + fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; + } + return fileStream.ReadText(); + } + catch (e) { + throw e; + } + finally { + fileStream.Close(); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + fileStream.Open(); + binaryStream.Open(); + try { + fileStream.Charset = "utf-8"; + fileStream.WriteText(data); + if (writeByteOrderMark) { + fileStream.Position = 0; + } + else { + fileStream.Position = 3; + } + fileStream.CopyTo(binaryStream); + binaryStream.SaveToFile(fileName, 2); + } + finally { + binaryStream.Close(); + fileStream.Close(); + } + } + return { + args: args, + newLine: "\r\n", + useCaseSensitiveFileNames: false, + write: function (s) { + WScript.StdOut.Write(s); + }, + readFile: readFile, + writeFile: writeFile, + resolvePath: function (path) { + return fso.GetAbsolutePathName(path); + }, + fileExists: function (path) { + return fso.FileExists(path); + }, + directoryExists: function (path) { + return fso.FolderExists(path); + }, + createDirectory: function (directoryName) { + if (!this.directoryExists(directoryName)) { + fso.CreateFolder(directoryName); + } + }, + getExecutingFilePath: function () { + return WScript.ScriptFullName; + }, + getCurrentDirectory: function () { + return new ActiveXObject("WScript.Shell").CurrentDirectory; + }, + exit: function (exitCode) { + try { + WScript.Quit(exitCode); + } + catch (e) { + } + } + }; + } + function getNodeSystem() { + var _fs = require("fs"); + var _path = require("path"); + var _os = require('os'); + var platform = _os.platform(); + var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; + function readFile(fileName, encoding) { + if (!_fs.existsSync(fileName)) { + return undefined; + } + var buffer = _fs.readFileSync(fileName); + var len = buffer.length; + if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { + len &= ~1; + for (var i = 0; i < len; i += 2) { + var temp = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = temp; + } + return buffer.toString("utf16le", 2); + } + if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { + return buffer.toString("utf16le", 2); + } + if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + return buffer.toString("utf8", 3); + } + return buffer.toString("utf8"); + } + function writeFile(fileName, data, writeByteOrderMark) { + if (writeByteOrderMark) { + data = '\uFEFF' + data; + } + _fs.writeFileSync(fileName, data, "utf8"); + } + return { + args: process.argv.slice(2), + newLine: _os.EOL, + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + write: function (s) { + _fs.writeSync(1, s); + }, + readFile: readFile, + writeFile: writeFile, + watchFile: function (fileName, callback) { + _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); + return { + close: function () { + _fs.unwatchFile(fileName, fileChanged); + } + }; + function fileChanged(curr, prev) { + if (+curr.mtime <= +prev.mtime) { + return; + } + callback(fileName); + } + ; + }, + resolvePath: function (path) { + return _path.resolve(path); + }, + fileExists: function (path) { + return _fs.existsSync(path); + }, + directoryExists: function (path) { + return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); + }, + createDirectory: function (directoryName) { + if (!this.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath: function () { + return process.mainModule.filename; + }, + getCurrentDirectory: function () { + return process.cwd(); + }, + getMemoryUsage: function () { + if (global.gc) { + global.gc(); + } + return process.memoryUsage().heapUsed; + }, + exit: function (exitCode) { + process.exit(exitCode); + } + }; + } + if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { + return getWScriptSystem(); + } + else if (typeof module !== "undefined" && module.exports) { + return getNodeSystem(); + } + else { + return undefined; + } +})(); +var TypeScript; +(function (TypeScript) { + var Errors = (function () { + function Errors() { + } + Errors.argument = function (argument, message) { + return new Error("Invalid argument: " + argument + ". " + message); + }; + Errors.argumentOutOfRange = function (argument) { + return new Error("Argument out of range: " + argument); + }; + Errors.argumentNull = function (argument) { + return new Error("Argument null: " + argument); + }; + Errors.abstract = function () { + return new Error("Operation not implemented properly by subclass."); + }; + Errors.notYetImplemented = function () { + return new Error("Not yet implemented."); + }; + Errors.invalidOperation = function (message) { + return new Error("Invalid operation: " + message); + }; + return Errors; + })(); + TypeScript.Errors = Errors; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var ArrayUtilities = (function () { + function ArrayUtilities() { + } + ArrayUtilities.sequenceEquals = function (array1, array2, equals) { + if (array1 === array2) { + return true; + } + if (!array1 || !array2) { + return false; + } + if (array1.length !== array2.length) { + return false; + } + for (var i = 0, n = array1.length; i < n; i++) { + if (!equals(array1[i], array2[i])) { + return false; + } + } + return true; + }; + ArrayUtilities.contains = function (array, value) { + for (var i = 0; i < array.length; i++) { + if (array[i] === value) { + return true; + } + } + return false; + }; + ArrayUtilities.distinct = function (array, equalsFn) { + var result = []; + for (var i = 0, n = array.length; i < n; i++) { + var current = array[i]; + for (var j = 0; j < result.length; j++) { + if (equalsFn(result[j], current)) { + break; + } + } + if (j === result.length) { + result.push(current); + } + } + return result; + }; + ArrayUtilities.last = function (array) { + if (array.length === 0) { + throw TypeScript.Errors.argumentOutOfRange('array'); + } + return array[array.length - 1]; + }; + ArrayUtilities.lastOrDefault = function (array, predicate) { + for (var i = array.length - 1; i >= 0; i--) { + var v = array[i]; + if (predicate(v, i)) { + return v; + } + } + return undefined; + }; + ArrayUtilities.firstOrDefault = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + var value = array[i]; + if (func(value, i)) { + return value; + } + } + return undefined; + }; + ArrayUtilities.first = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + var value = array[i]; + if (!func || func(value, i)) { + return value; + } + } + throw TypeScript.Errors.invalidOperation(); + }; + ArrayUtilities.sum = function (array, func) { + var result = 0; + for (var i = 0, n = array.length; i < n; i++) { + result += func(array[i]); + } + return result; + }; + ArrayUtilities.select = function (values, func) { + var result = new Array(values.length); + for (var i = 0; i < values.length; i++) { + result[i] = func(values[i]); + } + return result; + }; + ArrayUtilities.where = function (values, func) { + var result = new Array(); + for (var i = 0; i < values.length; i++) { + if (func(values[i])) { + result.push(values[i]); + } + } + return result; + }; + ArrayUtilities.any = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + if (func(array[i])) { + return true; + } + } + return false; + }; + ArrayUtilities.all = function (array, func) { + for (var i = 0, n = array.length; i < n; i++) { + if (!func(array[i])) { + return false; + } + } + return true; + }; + ArrayUtilities.binarySearch = function (array, value) { + var low = 0; + var high = array.length - 1; + while (low <= high) { + var middle = low + ((high - low) >> 1); + var midValue = array[middle]; + if (midValue === value) { + return middle; + } + else if (midValue > value) { + high = middle - 1; + } + else { + low = middle + 1; + } + } + return ~low; + }; + ArrayUtilities.createArray = function (length, defaultValue) { + var result = new Array(length); + for (var i = 0; i < length; i++) { + result[i] = defaultValue; + } + return result; + }; + ArrayUtilities.grow = function (array, length, defaultValue) { + var count = length - array.length; + for (var i = 0; i < count; i++) { + array.push(defaultValue); + } + }; + ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { + for (var i = 0; i < length; i++) { + destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; + } + }; + ArrayUtilities.indexOf = function (array, predicate) { + for (var i = 0, n = array.length; i < n; i++) { + if (predicate(array[i])) { + return i; + } + } + return -1; + }; + return ArrayUtilities; + })(); + TypeScript.ArrayUtilities = ArrayUtilities; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var StringUtilities = (function () { + function StringUtilities() { + } + StringUtilities.isString = function (value) { + return Object.prototype.toString.apply(value, []) === '[object String]'; + }; + StringUtilities.endsWith = function (string, value) { + return string.substring(string.length - value.length, string.length) === value; + }; + StringUtilities.startsWith = function (string, value) { + return string.substr(0, value.length) === value; + }; + StringUtilities.repeat = function (value, count) { + return Array(count + 1).join(value); + }; + return StringUtilities; + })(); + TypeScript.StringUtilities = StringUtilities; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + (function (SyntaxKind) { + SyntaxKind[SyntaxKind["None"] = 0] = "None"; + SyntaxKind[SyntaxKind["List"] = 1] = "List"; + SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 2] = "WhitespaceTrivia"; + SyntaxKind[SyntaxKind["NewLineTrivia"] = 3] = "NewLineTrivia"; + SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 4] = "MultiLineCommentTrivia"; + SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 5] = "SingleLineCommentTrivia"; + SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 6] = "SkippedTokenTrivia"; + SyntaxKind[SyntaxKind["ErrorToken"] = 7] = "ErrorToken"; + SyntaxKind[SyntaxKind["EndOfFileToken"] = 8] = "EndOfFileToken"; + SyntaxKind[SyntaxKind["IdentifierName"] = 9] = "IdentifierName"; + SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 10] = "RegularExpressionLiteral"; + SyntaxKind[SyntaxKind["NumericLiteral"] = 11] = "NumericLiteral"; + SyntaxKind[SyntaxKind["StringLiteral"] = 12] = "StringLiteral"; + SyntaxKind[SyntaxKind["NoSubstitutionTemplateToken"] = 13] = "NoSubstitutionTemplateToken"; + SyntaxKind[SyntaxKind["TemplateStartToken"] = 14] = "TemplateStartToken"; + SyntaxKind[SyntaxKind["TemplateMiddleToken"] = 15] = "TemplateMiddleToken"; + SyntaxKind[SyntaxKind["TemplateEndToken"] = 16] = "TemplateEndToken"; + SyntaxKind[SyntaxKind["BreakKeyword"] = 17] = "BreakKeyword"; + SyntaxKind[SyntaxKind["CaseKeyword"] = 18] = "CaseKeyword"; + SyntaxKind[SyntaxKind["CatchKeyword"] = 19] = "CatchKeyword"; + SyntaxKind[SyntaxKind["ContinueKeyword"] = 20] = "ContinueKeyword"; + SyntaxKind[SyntaxKind["DebuggerKeyword"] = 21] = "DebuggerKeyword"; + SyntaxKind[SyntaxKind["DefaultKeyword"] = 22] = "DefaultKeyword"; + SyntaxKind[SyntaxKind["DeleteKeyword"] = 23] = "DeleteKeyword"; + SyntaxKind[SyntaxKind["DoKeyword"] = 24] = "DoKeyword"; + SyntaxKind[SyntaxKind["ElseKeyword"] = 25] = "ElseKeyword"; + SyntaxKind[SyntaxKind["FalseKeyword"] = 26] = "FalseKeyword"; + SyntaxKind[SyntaxKind["FinallyKeyword"] = 27] = "FinallyKeyword"; + SyntaxKind[SyntaxKind["ForKeyword"] = 28] = "ForKeyword"; + SyntaxKind[SyntaxKind["FunctionKeyword"] = 29] = "FunctionKeyword"; + SyntaxKind[SyntaxKind["IfKeyword"] = 30] = "IfKeyword"; + SyntaxKind[SyntaxKind["InKeyword"] = 31] = "InKeyword"; + SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 32] = "InstanceOfKeyword"; + SyntaxKind[SyntaxKind["NewKeyword"] = 33] = "NewKeyword"; + SyntaxKind[SyntaxKind["NullKeyword"] = 34] = "NullKeyword"; + SyntaxKind[SyntaxKind["ReturnKeyword"] = 35] = "ReturnKeyword"; + SyntaxKind[SyntaxKind["SwitchKeyword"] = 36] = "SwitchKeyword"; + SyntaxKind[SyntaxKind["ThisKeyword"] = 37] = "ThisKeyword"; + SyntaxKind[SyntaxKind["ThrowKeyword"] = 38] = "ThrowKeyword"; + SyntaxKind[SyntaxKind["TrueKeyword"] = 39] = "TrueKeyword"; + SyntaxKind[SyntaxKind["TryKeyword"] = 40] = "TryKeyword"; + SyntaxKind[SyntaxKind["TypeOfKeyword"] = 41] = "TypeOfKeyword"; + SyntaxKind[SyntaxKind["VarKeyword"] = 42] = "VarKeyword"; + SyntaxKind[SyntaxKind["VoidKeyword"] = 43] = "VoidKeyword"; + SyntaxKind[SyntaxKind["WhileKeyword"] = 44] = "WhileKeyword"; + SyntaxKind[SyntaxKind["WithKeyword"] = 45] = "WithKeyword"; + SyntaxKind[SyntaxKind["ClassKeyword"] = 46] = "ClassKeyword"; + SyntaxKind[SyntaxKind["ConstKeyword"] = 47] = "ConstKeyword"; + SyntaxKind[SyntaxKind["EnumKeyword"] = 48] = "EnumKeyword"; + SyntaxKind[SyntaxKind["ExportKeyword"] = 49] = "ExportKeyword"; + SyntaxKind[SyntaxKind["ExtendsKeyword"] = 50] = "ExtendsKeyword"; + SyntaxKind[SyntaxKind["ImportKeyword"] = 51] = "ImportKeyword"; + SyntaxKind[SyntaxKind["SuperKeyword"] = 52] = "SuperKeyword"; + SyntaxKind[SyntaxKind["ImplementsKeyword"] = 53] = "ImplementsKeyword"; + SyntaxKind[SyntaxKind["InterfaceKeyword"] = 54] = "InterfaceKeyword"; + SyntaxKind[SyntaxKind["LetKeyword"] = 55] = "LetKeyword"; + SyntaxKind[SyntaxKind["PackageKeyword"] = 56] = "PackageKeyword"; + SyntaxKind[SyntaxKind["PrivateKeyword"] = 57] = "PrivateKeyword"; + SyntaxKind[SyntaxKind["ProtectedKeyword"] = 58] = "ProtectedKeyword"; + SyntaxKind[SyntaxKind["PublicKeyword"] = 59] = "PublicKeyword"; + SyntaxKind[SyntaxKind["StaticKeyword"] = 60] = "StaticKeyword"; + SyntaxKind[SyntaxKind["YieldKeyword"] = 61] = "YieldKeyword"; + SyntaxKind[SyntaxKind["AnyKeyword"] = 62] = "AnyKeyword"; + SyntaxKind[SyntaxKind["BooleanKeyword"] = 63] = "BooleanKeyword"; + SyntaxKind[SyntaxKind["ConstructorKeyword"] = 64] = "ConstructorKeyword"; + SyntaxKind[SyntaxKind["DeclareKeyword"] = 65] = "DeclareKeyword"; + SyntaxKind[SyntaxKind["GetKeyword"] = 66] = "GetKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 67] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 68] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 69] = "NumberKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 70] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 71] = "StringKeyword"; + SyntaxKind[SyntaxKind["OpenBraceToken"] = 72] = "OpenBraceToken"; + SyntaxKind[SyntaxKind["CloseBraceToken"] = 73] = "CloseBraceToken"; + SyntaxKind[SyntaxKind["OpenParenToken"] = 74] = "OpenParenToken"; + SyntaxKind[SyntaxKind["CloseParenToken"] = 75] = "CloseParenToken"; + SyntaxKind[SyntaxKind["OpenBracketToken"] = 76] = "OpenBracketToken"; + SyntaxKind[SyntaxKind["CloseBracketToken"] = 77] = "CloseBracketToken"; + SyntaxKind[SyntaxKind["DotToken"] = 78] = "DotToken"; + SyntaxKind[SyntaxKind["DotDotDotToken"] = 79] = "DotDotDotToken"; + SyntaxKind[SyntaxKind["SemicolonToken"] = 80] = "SemicolonToken"; + SyntaxKind[SyntaxKind["CommaToken"] = 81] = "CommaToken"; + SyntaxKind[SyntaxKind["LessThanToken"] = 82] = "LessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanToken"] = 83] = "GreaterThanToken"; + SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 84] = "LessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 85] = "GreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 86] = "EqualsEqualsToken"; + SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 87] = "EqualsGreaterThanToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 88] = "ExclamationEqualsToken"; + SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 89] = "EqualsEqualsEqualsToken"; + SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 90] = "ExclamationEqualsEqualsToken"; + SyntaxKind[SyntaxKind["PlusToken"] = 91] = "PlusToken"; + SyntaxKind[SyntaxKind["MinusToken"] = 92] = "MinusToken"; + SyntaxKind[SyntaxKind["AsteriskToken"] = 93] = "AsteriskToken"; + SyntaxKind[SyntaxKind["PercentToken"] = 94] = "PercentToken"; + SyntaxKind[SyntaxKind["PlusPlusToken"] = 95] = "PlusPlusToken"; + SyntaxKind[SyntaxKind["MinusMinusToken"] = 96] = "MinusMinusToken"; + SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 97] = "LessThanLessThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 98] = "GreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 99] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind[SyntaxKind["AmpersandToken"] = 100] = "AmpersandToken"; + SyntaxKind[SyntaxKind["BarToken"] = 101] = "BarToken"; + SyntaxKind[SyntaxKind["CaretToken"] = 102] = "CaretToken"; + SyntaxKind[SyntaxKind["ExclamationToken"] = 103] = "ExclamationToken"; + SyntaxKind[SyntaxKind["TildeToken"] = 104] = "TildeToken"; + SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 105] = "AmpersandAmpersandToken"; + SyntaxKind[SyntaxKind["BarBarToken"] = 106] = "BarBarToken"; + SyntaxKind[SyntaxKind["QuestionToken"] = 107] = "QuestionToken"; + SyntaxKind[SyntaxKind["ColonToken"] = 108] = "ColonToken"; + SyntaxKind[SyntaxKind["EqualsToken"] = 109] = "EqualsToken"; + SyntaxKind[SyntaxKind["PlusEqualsToken"] = 110] = "PlusEqualsToken"; + SyntaxKind[SyntaxKind["MinusEqualsToken"] = 111] = "MinusEqualsToken"; + SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 112] = "AsteriskEqualsToken"; + SyntaxKind[SyntaxKind["PercentEqualsToken"] = 113] = "PercentEqualsToken"; + SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 114] = "LessThanLessThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 115] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 116] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 117] = "AmpersandEqualsToken"; + SyntaxKind[SyntaxKind["BarEqualsToken"] = 118] = "BarEqualsToken"; + SyntaxKind[SyntaxKind["CaretEqualsToken"] = 119] = "CaretEqualsToken"; + SyntaxKind[SyntaxKind["SlashToken"] = 120] = "SlashToken"; + SyntaxKind[SyntaxKind["SlashEqualsToken"] = 121] = "SlashEqualsToken"; + SyntaxKind[SyntaxKind["SourceUnit"] = 122] = "SourceUnit"; + SyntaxKind[SyntaxKind["QualifiedName"] = 123] = "QualifiedName"; + SyntaxKind[SyntaxKind["ObjectType"] = 124] = "ObjectType"; + SyntaxKind[SyntaxKind["FunctionType"] = 125] = "FunctionType"; + SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 127] = "ConstructorType"; + SyntaxKind[SyntaxKind["GenericType"] = 128] = "GenericType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; + SyntaxKind[SyntaxKind["TupleType"] = 130] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 131] = "UnionType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 132] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 133] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 134] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 135] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 136] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 137] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 138] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 139] = "ExportAssignment"; + SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 140] = "MemberFunctionDeclaration"; + SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 141] = "MemberVariableDeclaration"; + SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 142] = "ConstructorDeclaration"; + SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 143] = "IndexMemberDeclaration"; + SyntaxKind[SyntaxKind["GetAccessor"] = 144] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 145] = "SetAccessor"; + SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; + SyntaxKind[SyntaxKind["CallSignature"] = 147] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 148] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 149] = "IndexSignature"; + SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; + SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; + SyntaxKind[SyntaxKind["IfStatement"] = 152] = "IfStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 153] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 155] = "ReturnStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 157] = "BreakStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 158] = "ContinueStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 159] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 160] = "ForInStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 161] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 162] = "ThrowStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 163] = "WhileStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 164] = "TryStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 165] = "LabeledStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 166] = "DoStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 167] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 168] = "WithStatement"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 169] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 173] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 174] = "BinaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 175] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["MemberAccessExpression"] = 176] = "MemberAccessExpression"; + SyntaxKind[SyntaxKind["InvocationExpression"] = 177] = "InvocationExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 180] = "ObjectCreationExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 181] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 182] = "ParenthesizedArrowFunctionExpression"; + SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 183] = "SimpleArrowFunctionExpression"; + SyntaxKind[SyntaxKind["CastExpression"] = 184] = "CastExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 185] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 187] = "OmittedExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 188] = "TemplateExpression"; + SyntaxKind[SyntaxKind["TemplateAccessExpression"] = 189] = "TemplateAccessExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 190] = "YieldExpression"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 191] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarator"] = 192] = "VariableDeclarator"; + SyntaxKind[SyntaxKind["ArgumentList"] = 193] = "ArgumentList"; + SyntaxKind[SyntaxKind["ParameterList"] = 194] = "ParameterList"; + SyntaxKind[SyntaxKind["TypeArgumentList"] = 195] = "TypeArgumentList"; + SyntaxKind[SyntaxKind["TypeParameterList"] = 196] = "TypeParameterList"; + SyntaxKind[SyntaxKind["HeritageClause"] = 197] = "HeritageClause"; + SyntaxKind[SyntaxKind["EqualsValueClause"] = 198] = "EqualsValueClause"; + SyntaxKind[SyntaxKind["CaseSwitchClause"] = 199] = "CaseSwitchClause"; + SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 200] = "DefaultSwitchClause"; + SyntaxKind[SyntaxKind["ElseClause"] = 201] = "ElseClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 202] = "CatchClause"; + SyntaxKind[SyntaxKind["FinallyClause"] = 203] = "FinallyClause"; + SyntaxKind[SyntaxKind["TemplateClause"] = 204] = "TemplateClause"; + SyntaxKind[SyntaxKind["TypeParameter"] = 205] = "TypeParameter"; + SyntaxKind[SyntaxKind["Constraint"] = 206] = "Constraint"; + SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 207] = "SimplePropertyAssignment"; + SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 208] = "FunctionPropertyAssignment"; + SyntaxKind[SyntaxKind["Parameter"] = 209] = "Parameter"; + SyntaxKind[SyntaxKind["EnumElement"] = 210] = "EnumElement"; + SyntaxKind[SyntaxKind["TypeAnnotation"] = 211] = "TypeAnnotation"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 212] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 213] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 214] = "ModuleNameModuleReference"; + SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; + SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; + SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; + SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; + SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; + SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; + SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; + SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; + SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; + SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; + SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; + SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; + SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; + SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; + SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; + SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; + SyntaxKind[SyntaxKind["FirstNode"] = SyntaxKind.SourceUnit] = "FirstNode"; + SyntaxKind[SyntaxKind["LastNode"] = SyntaxKind.ModuleNameModuleReference] = "LastNode"; + })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); + var SyntaxKind = TypeScript.SyntaxKind; +})(TypeScript || (TypeScript = {})); +var TypeScript; +(function (TypeScript) { + var SyntaxFacts; + (function (SyntaxFacts) { + var textToKeywordKind = { + "any": 62 /* AnyKeyword */, + "boolean": 63 /* BooleanKeyword */, + "break": 17 /* BreakKeyword */, + "case": 18 /* CaseKeyword */, + "catch": 19 /* CatchKeyword */, + "class": 46 /* ClassKeyword */, + "continue": 20 /* ContinueKeyword */, + "const": 47 /* ConstKeyword */, + "constructor": 64 /* ConstructorKeyword */, + "debugger": 21 /* DebuggerKeyword */, + "declare": 65 /* DeclareKeyword */, + "default": 22 /* DefaultKeyword */, + "delete": 23 /* DeleteKeyword */, + "do": 24 /* DoKeyword */, + "else": 25 /* ElseKeyword */, + "enum": 48 /* EnumKeyword */, + "export": 49 /* ExportKeyword */, + "extends": 50 /* ExtendsKeyword */, + "false": 26 /* FalseKeyword */, + "finally": 27 /* FinallyKeyword */, + "for": 28 /* ForKeyword */, + "function": 29 /* FunctionKeyword */, + "get": 66 /* GetKeyword */, + "if": 30 /* IfKeyword */, + "implements": 53 /* ImplementsKeyword */, + "import": 51 /* ImportKeyword */, + "in": 31 /* InKeyword */, + "instanceof": 32 /* InstanceOfKeyword */, + "interface": 54 /* InterfaceKeyword */, + "let": 55 /* LetKeyword */, + "module": 67 /* ModuleKeyword */, + "new": 33 /* NewKeyword */, + "null": 34 /* NullKeyword */, + "number": 69 /* NumberKeyword */, + "package": 56 /* PackageKeyword */, + "private": 57 /* PrivateKeyword */, + "protected": 58 /* ProtectedKeyword */, + "public": 59 /* PublicKeyword */, + "require": 68 /* RequireKeyword */, + "return": 35 /* ReturnKeyword */, + "set": 70 /* SetKeyword */, + "static": 60 /* StaticKeyword */, + "string": 71 /* StringKeyword */, + "super": 52 /* SuperKeyword */, + "switch": 36 /* SwitchKeyword */, + "this": 37 /* ThisKeyword */, + "throw": 38 /* ThrowKeyword */, + "true": 39 /* TrueKeyword */, + "try": 40 /* TryKeyword */, + "typeof": 41 /* TypeOfKeyword */, + "var": 42 /* VarKeyword */, + "void": 43 /* VoidKeyword */, + "while": 44 /* WhileKeyword */, + "with": 45 /* WithKeyword */, + "yield": 61 /* YieldKeyword */, + "{": 72 /* OpenBraceToken */, + "}": 73 /* CloseBraceToken */, + "(": 74 /* OpenParenToken */, + ")": 75 /* CloseParenToken */, + "[": 76 /* OpenBracketToken */, + "]": 77 /* CloseBracketToken */, + ".": 78 /* DotToken */, + "...": 79 /* DotDotDotToken */, + ";": 80 /* SemicolonToken */, + ",": 81 /* CommaToken */, + "<": 82 /* LessThanToken */, + ">": 83 /* GreaterThanToken */, + "<=": 84 /* LessThanEqualsToken */, + ">=": 85 /* GreaterThanEqualsToken */, + "==": 86 /* EqualsEqualsToken */, + "=>": 87 /* EqualsGreaterThanToken */, + "!=": 88 /* ExclamationEqualsToken */, + "===": 89 /* EqualsEqualsEqualsToken */, + "!==": 90 /* ExclamationEqualsEqualsToken */, + "+": 91 /* PlusToken */, + "-": 92 /* MinusToken */, + "*": 93 /* AsteriskToken */, + "%": 94 /* PercentToken */, + "++": 95 /* PlusPlusToken */, + "--": 96 /* MinusMinusToken */, + "<<": 97 /* LessThanLessThanToken */, + ">>": 98 /* GreaterThanGreaterThanToken */, + ">>>": 99 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 100 /* AmpersandToken */, + "|": 101 /* BarToken */, + "^": 102 /* CaretToken */, + "!": 103 /* ExclamationToken */, + "~": 104 /* TildeToken */, + "&&": 105 /* AmpersandAmpersandToken */, + "||": 106 /* BarBarToken */, + "?": 107 /* QuestionToken */, + ":": 108 /* ColonToken */, + "=": 109 /* EqualsToken */, + "+=": 110 /* PlusEqualsToken */, + "-=": 111 /* MinusEqualsToken */, + "*=": 112 /* AsteriskEqualsToken */, + "%=": 113 /* PercentEqualsToken */, + "<<=": 114 /* LessThanLessThanEqualsToken */, + ">>=": 115 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 117 /* AmpersandEqualsToken */, + "|=": 118 /* BarEqualsToken */, + "^=": 119 /* CaretEqualsToken */, + "/": 120 /* SlashToken */, + "/=": 121 /* SlashEqualsToken */ + }; + var kindToText = new Array(); + for (var name in textToKeywordKind) { + if (textToKeywordKind.hasOwnProperty(name)) { + kindToText[textToKeywordKind[name]] = name; + } + } + kindToText[64 /* ConstructorKeyword */] = "constructor"; + function getTokenKind(text) { + if (textToKeywordKind.hasOwnProperty(text)) { + return textToKeywordKind[text]; + } + return 0 /* None */; + } + SyntaxFacts.getTokenKind = getTokenKind; + function getText(kind) { + var result = kindToText[kind]; + return result; + } + SyntaxFacts.getText = getText; + function isAnyKeyword(kind) { + return kind >= TypeScript.SyntaxKind.FirstKeyword && kind <= TypeScript.SyntaxKind.LastKeyword; + } + SyntaxFacts.isAnyKeyword = isAnyKeyword; + function isAnyPunctuation(kind) { + return kind >= TypeScript.SyntaxKind.FirstPunctuation && kind <= TypeScript.SyntaxKind.LastPunctuation; + } + SyntaxFacts.isAnyPunctuation = isAnyPunctuation; + function isPrefixUnaryExpressionOperatorToken(tokenKind) { + switch (tokenKind) { + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 104 /* TildeToken */: + case 103 /* ExclamationToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: + return true; + default: + return false; + } + } + SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; + function isBinaryExpressionOperatorToken(tokenKind) { + switch (tokenKind) { + case 93 /* AsteriskToken */: + case 120 /* SlashToken */: + case 94 /* PercentToken */: + case 91 /* PlusToken */: + case 92 /* MinusToken */: + case 97 /* LessThanLessThanToken */: + case 98 /* GreaterThanGreaterThanToken */: + case 99 /* GreaterThanGreaterThanGreaterThanToken */: + case 82 /* LessThanToken */: + case 83 /* GreaterThanToken */: + case 84 /* LessThanEqualsToken */: + case 85 /* GreaterThanEqualsToken */: + case 32 /* InstanceOfKeyword */: + case 31 /* InKeyword */: + case 86 /* EqualsEqualsToken */: + case 88 /* ExclamationEqualsToken */: + case 89 /* EqualsEqualsEqualsToken */: + case 90 /* ExclamationEqualsEqualsToken */: + case 100 /* AmpersandToken */: + case 102 /* CaretToken */: + case 101 /* BarToken */: + case 105 /* AmpersandAmpersandToken */: + case 106 /* BarBarToken */: + case 118 /* BarEqualsToken */: + case 117 /* AmpersandEqualsToken */: + case 119 /* CaretEqualsToken */: + case 114 /* LessThanLessThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 110 /* PlusEqualsToken */: + case 111 /* MinusEqualsToken */: + case 112 /* AsteriskEqualsToken */: + case 121 /* SlashEqualsToken */: + case 113 /* PercentEqualsToken */: + case 109 /* EqualsToken */: + case 81 /* CommaToken */: + return true; + default: + return false; + } + } + SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; + function isAssignmentOperatorToken(tokenKind) { + switch (tokenKind) { + case 118 /* BarEqualsToken */: + case 117 /* AmpersandEqualsToken */: + case 119 /* CaretEqualsToken */: + case 114 /* LessThanLessThanEqualsToken */: + case 115 /* GreaterThanGreaterThanEqualsToken */: + case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 110 /* PlusEqualsToken */: + case 111 /* MinusEqualsToken */: + case 112 /* AsteriskEqualsToken */: + case 121 /* SlashEqualsToken */: + case 113 /* PercentEqualsToken */: + case 109 /* EqualsToken */: + return true; + default: + return false; + } + } + SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; + function isType(kind) { + switch (kind) { + case 126 /* ArrayType */: + case 62 /* AnyKeyword */: + case 69 /* NumberKeyword */: + case 63 /* BooleanKeyword */: + case 71 /* StringKeyword */: + case 43 /* VoidKeyword */: + case 125 /* FunctionType */: + case 124 /* ObjectType */: + case 127 /* ConstructorType */: + case 129 /* TypeQuery */: + case 128 /* GenericType */: + case 123 /* QualifiedName */: + case 9 /* IdentifierName */: + return true; + } + return false; + } + SyntaxFacts.isType = isType; + })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); +})(TypeScript || (TypeScript = {})); +var forPrettyPrinter = false; +var interfaces = { + IMemberDeclarationSyntax: 'IClassElementSyntax', + IStatementSyntax: 'IModuleElementSyntax', + INameSyntax: 'ITypeSyntax', + IUnaryExpressionSyntax: 'IExpressionSyntax', + IPostfixExpressionSyntax: 'IUnaryExpressionSyntax', + ILeftHandSideExpressionSyntax: 'IPostfixExpressionSyntax', + IMemberExpressionSyntax: 'ILeftHandSideExpressionSyntax', + ICallExpressionSyntax: 'ILeftHandSideExpressionSyntax', + IPrimaryExpressionSyntax: 'IMemberExpressionSyntax' +}; +var definitions = [ + { + name: 'SourceUnitSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'moduleElements', isList: true, elementType: 'IModuleElementSyntax' }, + { name: 'endOfFileToken', isToken: true } + ] + }, + { + name: 'ExternalModuleReferenceSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleReferenceSyntax'], + children: [ + { name: 'requireKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'stringLiteral', isToken: true }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ModuleNameModuleReferenceSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleReferenceSyntax'], + children: [ + { name: 'moduleName', type: 'INameSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ImportDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'importKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'equalsToken', isToken: true, excludeFromAST: true }, + { name: 'moduleReference', type: 'IModuleReferenceSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ExportAssignmentSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'exportKeyword', isToken: true, excludeFromAST: true }, + { name: 'equalsToken', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ClassDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'classKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'classElements', isList: true, elementType: 'IClassElementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'InterfaceDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'interfaceKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, + { name: 'body', type: 'ObjectTypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'HeritageClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'extendsOrImplementsKeyword', isToken: true }, + { name: 'typeNames', isSeparatedList: true, requiresAtLeastOneItem: true, elementType: 'INameSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ModuleDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'moduleKeyword', isToken: true, excludeFromAST: true }, + { name: 'name', type: 'INameSyntax' }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'moduleElements', isList: true, elementType: 'IModuleElementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'FunctionDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'functionKeyword', isToken: true, excludeFromAST: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'VariableStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'variableDeclaration', type: 'VariableDeclarationSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'VariableDeclarationSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'varKeyword', isToken: true }, + { name: 'variableDeclarators', isSeparatedList: true, requiresAtLeastOneItem: true, elementType: 'VariableDeclaratorSyntax' } + ] + }, + { + name: 'VariableDeclaratorSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, + { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } + ] + }, + { + name: 'EqualsValueClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'equalsToken', isToken: true, excludeFromAST: true }, + { name: 'value', type: 'IExpressionSyntax' } + ] + }, + { + name: 'PrefixUnaryExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'operatorToken', isToken: true }, + { name: 'operand', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'ArrayLiteralExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'expressions', isSeparatedList: true, elementType: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'OmittedExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [] + }, + { + name: 'ParenthesizedExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'SimpleArrowFunctionExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'parameter', type: 'ParameterSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ParenthesizedArrowFunctionExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'QualifiedNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['INameSyntax'], + children: [ + { name: 'left', type: 'INameSyntax' }, + { name: 'dotToken', isToken: true, excludeFromAST: true }, + { name: 'right', isToken: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeArgumentListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'lessThanToken', isToken: true }, + { name: 'typeArguments', isSeparatedList: true, elementType: 'ITypeSyntax' }, + { name: 'greaterThanToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ConstructorTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'newKeyword', isToken: true, excludeFromAST: true }, + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'parameterList', type: 'ParameterListSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'FunctionTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, + { name: 'parameterList', type: 'ParameterListSyntax' }, + { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ObjectTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'typeMembers', isSeparatedList: true, elementType: 'ITypeMemberSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ArrayTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'type', type: 'ITypeSyntax' }, + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'GenericTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'name', type: 'INameSyntax' }, + { name: 'typeArgumentList', type: 'TypeArgumentListSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeQuerySyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'typeOfKeyword', isToken: true, excludeFromAST: true }, + { name: 'name', type: 'INameSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'TupleTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'types', isSeparatedList: true, elementType: 'ITypeSyntax' }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'UnionTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'left', type: 'ITypeSyntax' }, + { name: 'barToken', isToken: true, excludeFromAST: true }, + { name: 'right', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ParenthesizedTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeAnnotationSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'BlockSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'openBraceToken', isToken: true }, + { name: 'statements', isList: true, elementType: 'IStatementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'ParameterSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'dotDotDotToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'identifier', isToken: true }, + { name: 'questionToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, + { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true, isTypeScriptSpecific: true } + ] + }, + { + name: 'MemberAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'dotToken', isToken: true, excludeFromAST: true }, + { name: 'name', isToken: true } + ] + }, + { + name: 'PostfixUnaryExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPostfixExpressionSyntax'], + children: [ + { name: 'operand', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'operatorToken', isToken: true } + ] + }, + { + name: 'ElementAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'openBracketToken', isToken: true, excludeFromAST: true }, + { name: 'argumentExpression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'TemplateAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' } + ] + }, + { + name: 'TemplateExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'templateStartToken', isToken: true, excludeFromAST: true }, + { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' } + ] + }, + { + name: 'TemplateClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' } + ] + }, + { + name: 'InvocationExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'argumentList', type: 'ArgumentListSyntax' } + ] + }, + { + name: 'ArgumentListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'typeArgumentList', type: 'TypeArgumentListSyntax', isOptional: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'arguments', isSeparatedList: true, elementType: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'BinaryExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'left', type: 'IExpressionSyntax' }, + { name: 'operatorToken', isToken: true }, + { name: 'right', type: 'IExpressionSyntax' } + ] + }, + { + name: 'ConditionalExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'questionToken', isToken: true, excludeFromAST: true }, + { name: 'whenTrue', type: 'IExpressionSyntax' }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'whenFalse', type: 'IExpressionSyntax' } + ] + }, + { + name: 'ConstructSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'newKeyword', isToken: true, excludeFromAST: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'MethodSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'questionToken', isToken: true, isOptional: true, itTypeScriptSpecific: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' } + ] + }, + { + name: 'IndexSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'parameters', isSeparatedList: true, elementType: 'ParameterSyntax' }, + { name: 'closeBracketToken', isToken: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'PropertySignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'questionToken', isToken: true, isOptional: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'CallSignatureSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeMemberSyntax'], + children: [ + { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true, isTypeScriptSpecific: true }, + { name: 'parameterList', type: 'ParameterListSyntax' }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true } + ] + }, + { + name: 'ParameterListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'parameters', isSeparatedList: true, elementType: 'ParameterSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'TypeParameterListSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'lessThanToken', isToken: true }, + { name: 'typeParameters', isSeparatedList: true, elementType: 'TypeParameterSyntax' }, + { name: 'greaterThanToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'TypeParameterSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'identifier', isToken: true }, + { name: 'constraint', type: 'ConstraintSyntax', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ConstraintSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'extendsKeyword', isToken: true, excludeFromAST: true }, + { name: 'typeOrExpression', type: 'ISyntaxNodeOrToken' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ElseClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'elseKeyword', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'IfStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'ifKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' }, + { name: 'elseClause', type: 'ElseClauseSyntax', isOptional: true } + ] + }, + { + name: 'ExpressionStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ConstructorDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IClassElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'constructorKeyword', isToken: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'MemberFunctionDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberDeclarationSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'GetAccessorSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IAccessorSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'getKeyword', isToken: true, excludeFromAST: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'SetAccessorSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IAccessorSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, + { name: 'setKeyword', isToken: true, excludeFromAST: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'block', type: 'BlockSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'MemberVariableDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberDeclarationSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'variableDeclarator', type: 'VariableDeclaratorSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'IndexMemberDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IClassElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'indexSignature', type: 'IndexSignatureSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'ThrowStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'throwKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ReturnStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'returnKeyword', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ObjectCreationExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'newKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IMemberExpressionSyntax' }, + { name: 'argumentList', type: 'ArgumentListSyntax', isOptional: true } + ] + }, + { + name: 'SwitchStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'switchKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'switchClauses', isList: true, elementType: 'ISwitchClauseSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'CaseSwitchClauseSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ISwitchClauseSyntax'], + children: [ + { name: 'caseKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'statements', isList: true, elementType: 'IStatementSyntax' } + ] + }, + { + name: 'DefaultSwitchClauseSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ISwitchClauseSyntax'], + children: [ + { name: 'defaultKeyword', isToken: true, excludeFromAST: true }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'statements', isList: true, elementType: 'IStatementSyntax' } + ] + }, + { + name: 'BreakStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'breakKeyword', isToken: true }, + { name: 'identifier', isToken: true, isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ContinueStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'continueKeyword', isToken: true }, + { name: 'identifier', isToken: true, isOptional: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'ForStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'forKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'initializer', type: 'VariableDeclarationSyntax | IExpressionSyntax', isOptional: true }, + { name: 'firstSemicolonToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax', isOptional: true }, + { name: 'secondSemicolonToken', isToken: true, excludeFromAST: true }, + { name: 'incrementor', type: 'IExpressionSyntax', isOptional: true }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'ForInStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'forKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'left', type: 'VariableDeclarationSyntax | IExpressionSyntax' }, + { name: 'inKeyword', isToken: true, excludeFromAST: true }, + { name: 'right', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'WhileStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'whileKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'WithStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'withKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'EnumDeclarationSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IModuleElementSyntax'], + children: [ + { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, + { name: 'enumKeyword', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'enumElements', isSeparatedList: true, elementType: 'EnumElementSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, + { + name: 'EnumElementSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } + ] + }, + { + name: 'CastExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'lessThanToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' }, + { name: 'greaterThanToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ObjectLiteralExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'openBraceToken', isToken: true, excludeFromAST: true }, + { name: 'propertyAssignments', isSeparatedList: true, elementType: 'IPropertyAssignmentSyntax' }, + { name: 'closeBraceToken', isToken: true, excludeFromAST: true } + ] + }, + { + name: 'ComputedPropertyNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyNameSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true } + ] + }, + { + name: 'SimplePropertyAssignmentSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyAssignmentSyntax'], + children: [ + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IExpressionSyntax' } + ] + }, + { + name: 'FunctionPropertyAssignmentSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyAssignmentSyntax'], + children: [ + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'FunctionExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'functionKeyword', isToken: true, excludeFromAST: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true, isOptional: true }, + { name: 'callSignature', type: 'CallSignatureSyntax' }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'EmptyStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'semicolonToken', isToken: true } + ] + }, + { + name: 'TryStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'tryKeyword', isToken: true, excludeFromAST: true }, + { name: 'block', type: 'BlockSyntax' }, + { name: 'catchClause', type: 'CatchClauseSyntax', isOptional: true }, + { name: 'finallyClause', type: 'FinallyClauseSyntax', isOptional: true } + ] + }, + { + name: 'CatchClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'catchKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'identifier', isToken: true }, + { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecified: true }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'FinallyClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'finallyKeyword', isToken: true, excludeFromAST: true }, + { name: 'block', type: 'BlockSyntax' } + ] + }, + { + name: 'LabeledStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'identifier', isToken: true }, + { name: 'colonToken', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' } + ] + }, + { + name: 'DoStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'doKeyword', isToken: true, excludeFromAST: true }, + { name: 'statement', type: 'IStatementSyntax' }, + { name: 'whileKeyword', isToken: true, excludeFromAST: true }, + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'condition', type: 'IExpressionSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + }, + { + name: 'TypeOfExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'typeOfKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'DeleteExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'deleteKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'VoidExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IUnaryExpressionSyntax'], + children: [ + { name: 'voidKeyword', isToken: true, excludeFromAST: true }, + { name: 'expression', type: 'IUnaryExpressionSyntax' } + ] + }, + { + name: 'YieldExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'yieldKeyword', isToken: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true } + ] + }, + { + name: 'DebuggerStatementSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IStatementSyntax'], + children: [ + { name: 'debuggerKeyword', isToken: true }, + { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + ] + } +]; +function firstKind(definition) { + var kindName = getNameWithoutSuffix(definition); + return TypeScript.SyntaxKind[kindName]; +} +definitions.sort(function (d1, d2) { return firstKind(d1) - firstKind(d2); }); +function getStringWithoutSuffix(definition) { + if (TypeScript.StringUtilities.endsWith(definition, "Syntax")) { + return definition.substring(0, definition.length - "Syntax".length); + } + return definition; +} +function getNameWithoutSuffix(definition) { + return getStringWithoutSuffix(definition.name); +} +function getType(child) { + if (child.isToken) { + return "ISyntaxToken"; + } + else if (child.isSeparatedList) { + return "ISeparatedSyntaxList<" + child.elementType + ">"; + } + else if (child.isList) { + return child.elementType + "[]"; + } + else { + return child.type; + } +} +function camelCase(value) { + return value.substr(0, 1).toLowerCase() + value.substr(1); +} +function getSafeName(child) { + if (child.name === "arguments") { + return "_" + child.name; + } + return child.name; +} +function generateConstructorFunction(definition) { + var result = " export var " + definition.name + ": " + getNameWithoutSuffix(definition) + "Constructor = function(data: number"; + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += ", "; + result += getSafeName(child); + result += ": " + getType(child); + } + result += ") {\r\n"; + result += " if (data) { this.__data = data; }\r\n"; + if (definition.children.length) { + result += " "; + for (var i = 0; i < definition.children.length; i++) { + if (i) { + result += ", "; + } + var child = definition.children[i]; + result += "this." + child.name + " = " + getSafeName(child); + } + result += ";\r\n"; + } + if (definition.children.length > 0) { + result += " "; + for (var i = 0; i < definition.children.length; i++) { + if (i) { + result += ", "; + } + var child = definition.children[i]; + if (child.isOptional) { + result += getSafeName(child) + " && (" + getSafeName(child) + ".parent = this)"; + } + else { + result += getSafeName(child) + ".parent = this"; + } + } + result += ";\r\n"; + } + result += " };\r\n"; + result += " " + definition.name + ".prototype.kind = SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; + result += " " + definition.name + ".prototype.childCount = " + definition.children.length + ";\r\n"; + result += " " + definition.name + ".prototype.childAt = function(index: number): ISyntaxElement {\r\n"; + if (definition.children.length) { + result += " switch (index) {\r\n"; + for (var j = 0; j < definition.children.length; j++) { + result += " case " + j + ": return this." + definition.children[j].name + ";\r\n"; + } + result += " }\r\n"; + } + else { + result += " throw Errors.invalidOperation();\r\n"; + } + result += " }\r\n"; + return result; +} +function generateSyntaxInterfaces() { + var result = "///\r\n\r\n"; + result += "module TypeScript {\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + if (i > 0) { + result += "\r\n"; + } + result += generateSyntaxInterface(definition); + } + result += "}"; + return result; +} +function generateSyntaxInterface(definition) { + var result = " export interface " + definition.name + " extends ISyntaxNode"; + if (definition.interfaces) { + result += ", "; + result += definition.interfaces.join(", "); + } + result += " {\r\n"; + if (definition.name === "SourceUnitSyntax") { + result += " syntaxTree: SyntaxTree;\r\n"; + } + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += " " + child.name + ": " + getType(child) + ";\r\n"; + } + result += " }\r\n"; + result += " export interface " + getNameWithoutSuffix(definition) + "Constructor {"; + result += " new (data: number"; + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += ", "; + result += getSafeName(child); + result += ": " + getType(child); + } + result += "): " + definition.name; + result += " }\r\n"; + return result; +} +function generateNodes() { + var result = "///\r\n\r\n"; + result += "module TypeScript"; + result += " {\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + if (i) { + result += "\r\n"; + } + result += generateConstructorFunction(definition); + } + result += "}"; + return result; +} +function isInterface(name) { + return name.substr(0, 1) === "I" && name.substr(1, 1).toUpperCase() === name.substr(1, 1); +} +function generateWalker() { + var result = ""; + result += "///\r\n" + "\r\n" + "module TypeScript {\r\n" + " export class SyntaxWalker implements ISyntaxVisitor {\r\n" + " public visitToken(token: ISyntaxToken): void {\r\n" + " }\r\n" + "\r\n" + " private visitOptionalToken(token: ISyntaxToken): void {\r\n" + " if (token === undefined) {\r\n" + " return;\r\n" + " }\r\n" + "\r\n" + " this.visitToken(token);\r\n" + " }\r\n" + "\r\n" + " public visitList(list: ISyntaxNodeOrToken[]): void {\r\n" + " for (var i = 0, n = list.length; i < n; i++) {\r\n" + " visitNodeOrToken(this, list[i]);\r\n" + " }\r\n" + " }\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + result += "\r\n"; + result += " public visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): void {\r\n"; + for (var j = 0; j < definition.children.length; j++) { + var child = definition.children[j]; + if (child.isToken) { + if (child.isOptional) { + result += " this.visitOptionalToken(node." + child.name + ");\r\n"; + } + else { + result += " this.visitToken(node." + child.name + ");\r\n"; + } + } + else if (child.isList || child.isSeparatedList) { + result += " this.visitList(node." + child.name + ");\r\n"; + } + else if (child.isToken) { + if (child.isOptional) { + result += " this.visitOptionalToken(node." + child.name + ");\r\n"; + } + else { + result += " this.visitToken(node." + child.name + ");\r\n"; + } + } + else { + result += " visitNodeOrToken(this, node." + child.name + ");\r\n"; + } + } + result += " }\r\n"; + } + result += " }"; + result += "\r\n}"; + return result; +} +function firstEnumName(e, value) { + for (var name in e) { + if (e[name] === value) { + return name; + } + } +} +function groupBy(array, func) { + var result = {}; + for (var i = 0, n = array.length; i < n; i++) { + var v = array[i]; + var k = func(v); + var list = result[k] || []; + list.push(v); + result[k] = list; + } + return result; +} +function generateKeywordCondition(keywords, currentCharacter, indent) { + var length = keywords[0].text.length; + var result = ""; + var index; + if (keywords.length === 1) { + var keyword = keywords[0]; + if (currentCharacter === length) { + return " return SyntaxKind." + firstEnumName(TypeScript.SyntaxKind, keyword.kind) + ";\r\n"; + } + var keywordText = keywords[0].text; + result = " return ("; + for (var i = currentCharacter; i < length; i++) { + if (i > currentCharacter) { + result += " && "; + } + index = i === 0 ? "start" : ("start + " + i); + result += "str.charCodeAt(" + index + ") === CharacterCodes." + keywordText.substr(i, 1); + } + result += ") ? SyntaxKind." + firstEnumName(TypeScript.SyntaxKind, keyword.kind) + " : SyntaxKind.IdentifierName;\r\n"; + } + else { + result += " // " + TypeScript.ArrayUtilities.select(keywords, function (k) { return k.text; }).join(", ") + "\r\n"; + index = currentCharacter === 0 ? "start" : ("start + " + currentCharacter); + result += indent + "switch(str.charCodeAt(" + index + ")) {\r\n"; + var groupedKeywords = groupBy(keywords, function (k) { return k.text.substr(currentCharacter, 1); }); + for (var c in groupedKeywords) { + if (groupedKeywords.hasOwnProperty(c)) { + result += indent + " case CharacterCodes." + c + ":"; + result += generateKeywordCondition(groupedKeywords[c], currentCharacter + 1, indent + " "); + } + } + result += indent + " default: return SyntaxKind.IdentifierName;\r\n"; + result += indent + "}\r\n"; + } + return result; +} +function min(array, func) { + var min = func(array[0]); + for (var i = 1; i < array.length; i++) { + var next = func(array[i]); + if (next < min) { + min = next; + } + } + return min; +} +function max(array, func) { + var max = func(array[0]); + for (var i = 1; i < array.length; i++) { + var next = func(array[i]); + if (next > max) { + max = next; + } + } + return max; +} +function generateUtilities() { + var result = ""; + result += " var fixedWidthArray = ["; + for (var i = 0; i <= TypeScript.SyntaxKind.LastFixedWidth; i++) { + if (i) { + result += ", "; + } + if (i < TypeScript.SyntaxKind.FirstFixedWidth) { + result += "0"; + } + else { + result += TypeScript.SyntaxFacts.getText(i).length; + } + } + result += "];\r\n"; + result += " function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; + result += " return fixedWidthArray[kind];\r\n"; + result += " }\r\n"; + return result; +} +function generateScannerUtilities() { + var result = "///\r\n" + "\r\n" + "module TypeScript {\r\n" + " export module ScannerUtilities {\r\n"; + var i; + var keywords = []; + for (i = TypeScript.SyntaxKind.FirstKeyword; i <= TypeScript.SyntaxKind.LastKeyword; i++) { + keywords.push({ kind: i, text: TypeScript.SyntaxFacts.getText(i) }); + } + keywords.sort(function (a, b) { return a.text.localeCompare(b.text); }); + result += " export function identifierKind(str: string, start: number, length: number): SyntaxKind {\r\n"; + var minTokenLength = min(keywords, function (k) { return k.text.length; }); + var maxTokenLength = max(keywords, function (k) { return k.text.length; }); + result += " switch (length) {\r\n"; + for (i = minTokenLength; i <= maxTokenLength; i++) { + var keywordsOfLengthI = TypeScript.ArrayUtilities.where(keywords, function (k) { return k.text.length === i; }); + if (keywordsOfLengthI.length > 0) { + result += " case " + i + ":"; + result += generateKeywordCondition(keywordsOfLengthI, 0, " "); + } + } + result += " default: return SyntaxKind.IdentifierName;\r\n"; + result += " }\r\n"; + result += " }\r\n"; + result += " }\r\n"; + result += "}"; + return result; +} +function syntaxKindName(kind) { + for (var name in TypeScript.SyntaxKind) { + if (TypeScript.SyntaxKind[name] === kind) { + return name; + } + } + throw new Error(); +} +function generateVisitor() { + var result = ""; + result += "///\r\n\r\n"; + result += "module TypeScript {\r\n"; + result += " export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any {\r\n"; + result += " if (element === undefined) { return undefined; }\r\n"; + result += " switch (element.kind) {\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; + result += "return visitor.visit" + getNameWithoutSuffix(definition) + "(<" + definition.name + ">element);\r\n"; + } + result += " default: return visitor.visitToken(element);\r\n"; + result += " }\r\n"; + result += " }\r\n\r\n"; + result += " export interface ISyntaxVisitor {\r\n"; + result += " visitToken(token: ISyntaxToken): any;\r\n"; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; + result += " visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any;\r\n"; + } + result += " }"; + result += "\r\n}"; + return result; +} +var syntaxNodesConcrete = generateNodes(); +var syntaxInterfaces = generateSyntaxInterfaces(); +var walker = generateWalker(); +var scannerUtilities = generateScannerUtilities(); +var visitor = generateVisitor(); +var utilities = generateUtilities(); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxInterfaces.generated.ts", syntaxInterfaces, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxWalker.generated.ts", walker, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxVisitor.generated.ts", visitor, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\utilities.generated.ts", utilities, false); +//# sourceMappingURL=file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.js.map diff --git a/src/services/syntax/SyntaxGenerator.js.map b/src/services/syntax/SyntaxGenerator.js.map new file mode 100644 index 00000000000..bd5d7bd6cb3 --- /dev/null +++ b/src/services/syntax/SyntaxGenerator.js.map @@ -0,0 +1,37 @@ +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< Updated upstream +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAAC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AG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,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,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,MAAMA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;oBACrCA,EAAEA,CAACA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,CAACA,EAAEA,OAAOA,CAACA,CAACA,CAACA,CAACA;wBAC/BA,KAAKA,CAACA;oBACVA,CAACA;gBACLA,CAACA;gBAEDA,EAAEA,CAACA,CAACA,CAACA,KAAKA,MAAMA,CAACA,MAAMA,CAACA,CAACA,CAACA;oBACtBA,MAAMA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;gBACzBA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA;QAClBA,CAACA;QAEaJ,mBAAIA,GAAlBA,UAAsBA,KAAUA;YAC5BK,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACrBA,MAAMA,iBAAMA,CAACA,kBAAkBA,CAACA,OAAOA,CAACA,CAACA;YAC7CA,CAACA;YAEDA,MAAMA,CAACA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;QACnCA,CAACA;QAEaL,4BAAaA,GAA3BA,UAA+BA,KAAUA,EAAEA,SAA2CA;YAClFM,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBACzCA,IAAIA,CAACA,GAAGA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACjBA,EAAEA,CAACA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA,CAACA;oBAClBA,MAAMA,CAACA,CAACA,CAACA;gBACbA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA,SAASA,CAACA;QACrBA,CAACA;QAEaN,6BAAcA,GAA5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CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> Stashed changes +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CA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ript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAAC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,GAAGA,GAAGA,MAAMA,CAACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YAC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MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> e8c937b... Simplify API for nodes htat have both a block and a semicolon token. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,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EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> e070f8f... Simplify API for nodes that have both a block and an expression. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,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;gBACvBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,MAAMA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;oBACrCA,EAAEA,CAACA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,CAACA,EAAEA,OAAOA,CAACA,CAACA,CAACA,CAACA;wBAC/BA,KAAKA,CAACA;oBACVA,CAACA;gBACLA,CAACA;gBAEDA,EAAEA,CAACA,CAACA,CAACA,KAAKA,MAAMA,CAACA,MAAMA,CAACA,CAACA,CAACA;oBACtBA,MAAMA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;gBACzBA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA;QAClBA,CAACA;QAEaJ,mBAAIA,GAAlBA,UAAsBA,KAAUA;YAC5BK,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACrBA,MAAMA,iBAAMA,CAACA,kBAAkBA,CAACA,OAAOA,CAACA,CAACA;YAC7CA,CAACA;YAEDA,MAAMA,CAACA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;QACnCA,CAACA;QAEaL,4BAAaA,GAA3BA,UAA+BA,KAAUA,EAAEA,SAA2CA;YAClFM,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBACzCA,IAAIA,CAACA,GAAGA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACjBA,EAAEA,CAACA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA,CAACA;oBAClBA,MAAMA,CAACA,CAACA,CAACA;gBACbA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA,SAASA,CAACA;QACrBA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AAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> f2c20c8... Use union types to make For/ForIn statements simpler. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IA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A,CAACA,CAACA,CAACA;gBACvBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,MAAMA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;oBACrCA,EAAEA,CAACA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,CAACA,EAAEA,OAAOA,CAACA,CAACA,CAACA,CAACA;wBAC/BA,KAAKA,CAACA;oBACVA,CAACA;gBACLA,CAACA;gBAEDA,EAAEA,CAACA,CAACA,CAACA,KAAKA,MAAMA,CAACA,MAAMA,CAACA,CAACA,CAACA;oBACtBA,MAAMA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;gBACzBA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA;QAClBA,CAACA;QAEaJ,mBAAIA,GAAlBA,UAAsBA,KAAUA;YAC5BK,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACrBA,MAAMA,iBAAMA,CAACA,kBAAkBA,CAACA,OAAOA,CAACA,CAACA;YAC7CA,CAACA;YAEDA,MAAMA,CAACA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;QACnCA,CAACA;QAEaL,4BAAaA,GAA3BA,UAA+BA,KAAUA,EAAEA,SAA2CA;YAClFM,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBACzCA,IAAIA,CAACA,GAAGA,KAAKA,CAACA,CAACA,CAACA,CAACA;gBACjBA,EAAEA,CAACA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA,CAACA;oBAClBA,MAAMA,CAACA,CAACA,CAACA;gBACbA,CAACA;YACLA,CAACA;YAEDA,MAAMA,CAACA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IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 6d94dc3... Body is optional. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAEr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GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> f4fb252... Add support for parsing generator declarations. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,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407f9... Function property assignments can also be generators. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAA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AG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 99981aa... Add support for parsing yield expressions. diff --git a/src/services/syntax/constants.ts b/src/services/syntax/constants.ts index 13b3d8ad754..8845af18af6 100644 --- a/src/services/syntax/constants.ts +++ b/src/services/syntax/constants.ts @@ -1,7 +1,7 @@ /// module TypeScript { - export enum SyntaxConstants { + export enum SyntaxNodeConstants { None = 0, // Masks that we use to place information about a node into a single int. The first bit tells @@ -15,12 +15,15 @@ module TypeScript { // only be used by the incremental parser if it is parsed in the same strict context as before. // last masks off the part of the int // - // The width of the node is stored in the remainder of the int. This allows us up to 512MB - // for a node by using all 29 bits. However, in the common case, we'll use less than 29 bits + // The width of the node is stored in the remainder of the int. This allows us up to 128MB + // for a node by using all 27 bits. However, in the common case, we'll use less than 27 bits // for the width. Thus, the info will be stored in a single int in chakra. - NodeDataComputed = 0x00000001, // 0000 0000 0000 0000 0000 0000 0000 0001 - NodeIncrementallyUnusableMask = 0x00000002, // 0000 0000 0000 0000 0000 0000 0000 0010 - NodeParsedInStrictModeMask = 0x00000004, // 0000 0000 0000 0000 0000 0000 0000 0100 - NodeFullWidthShift = 3, // 1111 1111 1111 1111 1111 1111 1111 1000 + DataComputed = 0x00000001, // 0000 0000 0000 0000 0000 0000 0000 0001 + IncrementallyUnusableMask = 0x00000002, // 0000 0000 0000 0000 0000 0000 0000 0010 + ParsedInStrictModeContext = 0x00000004, // 0000 0000 0000 0000 0000 0000 0000 0100 + ParsedInDisallowInContext = 0x00000008, // 0000 0000 0000 0000 0000 0000 0000 1000 + ParsedInYieldContext = 0x00000010, // 0000 0000 0000 0000 0000 0000 0001 0000 + ParsedInGeneratorParameterContext = 0x00000020, // 0000 0000 0000 0000 0000 0000 0010 0000 + FullWidthShift = 1 << 6, // 1111 1111 1111 1111 1111 1111 1100 0000 } } \ No newline at end of file diff --git a/src/services/syntax/defaultSyntaxVisitor.generated.ts b/src/services/syntax/defaultSyntaxVisitor.generated.ts deleted file mode 100644 index 32a0cfad4a5..00000000000 --- a/src/services/syntax/defaultSyntaxVisitor.generated.ts +++ /dev/null @@ -1,357 +0,0 @@ -/// - -module TypeScript { - export class SyntaxVisitor implements ISyntaxVisitor { - public defaultVisit(node: ISyntaxNodeOrToken): any { - return null; - } - - public visitToken(token: ISyntaxToken): any { - return this.defaultVisit(token); - } - - public visitSourceUnit(node: SourceUnitSyntax): any { - return this.defaultVisit(node); - } - - public visitQualifiedName(node: QualifiedNameSyntax): any { - return this.defaultVisit(node); - } - - public visitObjectType(node: ObjectTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionType(node: FunctionTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitArrayType(node: ArrayTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitConstructorType(node: ConstructorTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitGenericType(node: GenericTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeQuery(node: TypeQuerySyntax): any { - return this.defaultVisit(node); - } - - public visitTupleType(node: TupleTypeSyntax): any { - return this.defaultVisit(node); - } - - public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionDeclaration(node: FunctionDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitModuleDeclaration(node: ModuleDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitClassDeclaration(node: ClassDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitEnumDeclaration(node: EnumDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitImportDeclaration(node: ImportDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitExportAssignment(node: ExportAssignmentSyntax): any { - return this.defaultVisit(node); - } - - public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitGetAccessor(node: GetAccessorSyntax): any { - return this.defaultVisit(node); - } - - public visitSetAccessor(node: SetAccessorSyntax): any { - return this.defaultVisit(node); - } - - public visitPropertySignature(node: PropertySignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitCallSignature(node: CallSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitConstructSignature(node: ConstructSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitIndexSignature(node: IndexSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitMethodSignature(node: MethodSignatureSyntax): any { - return this.defaultVisit(node); - } - - public visitBlock(node: BlockSyntax): any { - return this.defaultVisit(node); - } - - public visitIfStatement(node: IfStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitVariableStatement(node: VariableStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitExpressionStatement(node: ExpressionStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitReturnStatement(node: ReturnStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitSwitchStatement(node: SwitchStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitBreakStatement(node: BreakStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitContinueStatement(node: ContinueStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitForStatement(node: ForStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitForInStatement(node: ForInStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitEmptyStatement(node: EmptyStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitThrowStatement(node: ThrowStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitWhileStatement(node: WhileStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitTryStatement(node: TryStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitLabeledStatement(node: LabeledStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitDoStatement(node: DoStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitDebuggerStatement(node: DebuggerStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitWithStatement(node: WithStatementSyntax): any { - return this.defaultVisit(node); - } - - public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitDeleteExpression(node: DeleteExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeOfExpression(node: TypeOfExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitVoidExpression(node: VoidExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitConditionalExpression(node: ConditionalExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitBinaryExpression(node: BinaryExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitInvocationExpression(node: InvocationExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitCastExpression(node: CastExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitElementAccessExpression(node: ElementAccessExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionExpression(node: FunctionExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitOmittedExpression(node: OmittedExpressionSyntax): any { - return this.defaultVisit(node); - } - - public visitVariableDeclaration(node: VariableDeclarationSyntax): any { - return this.defaultVisit(node); - } - - public visitVariableDeclarator(node: VariableDeclaratorSyntax): any { - return this.defaultVisit(node); - } - - public visitArgumentList(node: ArgumentListSyntax): any { - return this.defaultVisit(node); - } - - public visitParameterList(node: ParameterListSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeArgumentList(node: TypeArgumentListSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeParameterList(node: TypeParameterListSyntax): any { - return this.defaultVisit(node); - } - - public visitHeritageClause(node: HeritageClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitEqualsValueClause(node: EqualsValueClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitDefaultSwitchClause(node: DefaultSwitchClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitElseClause(node: ElseClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitCatchClause(node: CatchClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitFinallyClause(node: FinallyClauseSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeParameter(node: TypeParameterSyntax): any { - return this.defaultVisit(node); - } - - public visitConstraint(node: ConstraintSyntax): any { - return this.defaultVisit(node); - } - - public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any { - return this.defaultVisit(node); - } - - public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): any { - return this.defaultVisit(node); - } - - public visitParameter(node: ParameterSyntax): any { - return this.defaultVisit(node); - } - - public visitEnumElement(node: EnumElementSyntax): any { - return this.defaultVisit(node); - } - - public visitTypeAnnotation(node: TypeAnnotationSyntax): any { - return this.defaultVisit(node); - } - - public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any { - return this.defaultVisit(node); - } - - public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any { - return this.defaultVisit(node); - } - } -} \ No newline at end of file diff --git a/src/services/syntax/depthLimitedWalker.ts b/src/services/syntax/depthLimitedWalker.ts index 79df1ebd836..e69de29bb2d 100644 --- a/src/services/syntax/depthLimitedWalker.ts +++ b/src/services/syntax/depthLimitedWalker.ts @@ -1,21 +0,0 @@ -/// - -module TypeScript { - export class DepthLimitedWalker extends SyntaxWalker { - private _depth: number = 0; - private _maximumDepth: number = 0; - - constructor(maximumDepth: number) { - super(); - this._maximumDepth = maximumDepth; - } - - public visitNode(node: ISyntaxNode): void { - if (this._depth < this._maximumDepth) { - this._depth++; - super.visitNode(node); - this._depth--; - } - } - } -} \ No newline at end of file diff --git a/src/services/syntax/incrementalParser.ts b/src/services/syntax/incrementalParser.ts index 94423418f42..b234b77e03f 100644 --- a/src/services/syntax/incrementalParser.ts +++ b/src/services/syntax/incrementalParser.ts @@ -88,8 +88,8 @@ module TypeScript.IncrementalParser { function release() { _scannerParserSource.release(); - _scannerParserSource = null; - _oldSourceUnitCursor = null; + _scannerParserSource = undefined; + _oldSourceUnitCursor = undefined; _outstandingRewindPointCount = 0; } @@ -177,13 +177,13 @@ module TypeScript.IncrementalParser { // Null out the cursor that the rewind point points to. This way we don't try // to return it in 'releaseRewindPoint'. - rewindPoint.oldSourceUnitCursor = null; + rewindPoint.oldSourceUnitCursor = undefined; _scannerParserSource.rewind(rewindPoint); } function releaseRewindPoint(rewindPoint: IParserRewindPoint): void { - if (rewindPoint.oldSourceUnitCursor !== null) { + if (rewindPoint.oldSourceUnitCursor) { returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); } @@ -220,7 +220,7 @@ module TypeScript.IncrementalParser { // If our current absolute position is in the middle of the changed range in the new text // then we definitely can't read from the old source unit right now. - if (_changeRange !== null && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { + if (_changeRange && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { return false; } @@ -235,7 +235,7 @@ module TypeScript.IncrementalParser { !_oldSourceUnitCursor.isFinished(); } - function updateTokens(nodeOrToken: ISyntaxNodeOrToken): void { + function updateTokenPosition(token: ISyntaxToken): void { // If we got a node or token, and we're past the range of edited text, then walk its // constituent tokens, making sure all their positions are correct. We don't need to // do this for the tokens before the edited range (since their positions couldn't have @@ -243,38 +243,70 @@ module TypeScript.IncrementalParser { // edited range, as their positions will be correct when the underlying parser source // creates them. - var position = absolutePosition(); - var tokenWasMoved = isPastChangeRange() && fullStart(nodeOrToken) !== position; - - if (tokenWasMoved) { - setTokenFullStartWalker.position = position; - - visitNodeOrToken(setTokenFullStartWalker, nodeOrToken); + if (isPastChangeRange()) { + token.setFullStart(absolutePosition()); } } + function updateNodePosition(node: ISyntaxNode): void { + // If we got a node or token, and we're past the range of edited text, then walk its + // constituent tokens, making sure all their positions are correct. We don't need to + // do this for the tokens before the edited range (since their positions couldn't have + // been affected by the edit), and we don't need to do this for the tokens in the + // edited range, as their positions will be correct when the underlying parser source + // creates them. + + if (isPastChangeRange()) { + var position = absolutePosition(); + + var tokens = getTokens(node); + + for (var i = 0, n = tokens.length; i < n; i++) { + var token = tokens[i]; + token.setFullStart(position); + + position += token.fullWidth(); + } + } + } + + function getTokens(node: ISyntaxNode): ISyntaxToken[] { + var tokens = node.__cachedTokens; + if (!tokens) { + tokens = []; + tokenCollectorWalker.tokens = tokens; + + visitNodeOrToken(tokenCollectorWalker, node); + + node.__cachedTokens = tokens; + tokenCollectorWalker.tokens = undefined; + } + + return tokens; + } + function currentNode(): ISyntaxNode { if (canReadFromOldSourceUnit()) { // Try to read a node. If we can't then our caller will call back in and just try // to get a token. var node = tryGetNodeFromOldSourceUnit(); - if (node !== null) { + if (node) { // Make sure the positions for the tokens in this node are correct. - updateTokens(node); + updateNodePosition(node); return node; } } // Either we were ahead of the old text, or we were pinned. No node can be read here. - return null; + return undefined; } function currentToken(): ISyntaxToken { if (canReadFromOldSourceUnit()) { var token = tryGetTokenFromOldSourceUnit(); - if (token !== null) { + if (token) { // Make sure the token's position/text is correct. - updateTokens(token); + updateTokenPosition(token); return token; } } @@ -354,9 +386,9 @@ module TypeScript.IncrementalParser { // e) we are still in the same strict or non-strict state that the node was originally parsed in. while (true) { var node = _oldSourceUnitCursor.currentNode(); - if (node === null) { + if (node === undefined) { // Couldn't even read a node, nothing to return. - return null; + return undefined; } if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), fullWidth(node))) { @@ -395,7 +427,7 @@ module TypeScript.IncrementalParser { // need to make sure that if that the parser asks for a *token* we don't return it. // Converted identifiers can't ever be created by the scanner, and as such, should not // be returned by this source. - if (token !== null) { + if (token) { if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { // Didn't intersect with the change range. if (!token.isIncrementallyUnusable() && !Scanner.isContextualToken(token)) { @@ -417,13 +449,13 @@ module TypeScript.IncrementalParser { var token = _oldSourceUnitCursor.currentToken(); return canReuseTokenFromOldSourceUnit(absolutePosition(), token) - ? token : null; + ? token : undefined; } function peekToken(n: number): ISyntaxToken { if (canReadFromOldSourceUnit()) { var token = tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { + if (token) { return token; } } @@ -462,7 +494,7 @@ module TypeScript.IncrementalParser { var interimToken = _oldSourceUnitCursor.currentToken(); if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; + return undefined; } currentPosition += interimToken.fullWidth(); @@ -471,7 +503,7 @@ module TypeScript.IncrementalParser { var token = _oldSourceUnitCursor.currentToken(); return canReuseTokenFromOldSourceUnit(currentPosition, token) - ? token : null; + ? token : undefined; } function consumeNode(node: ISyntaxNode): void { @@ -486,7 +518,7 @@ module TypeScript.IncrementalParser { var _absolutePosition = absolutePosition() + fullWidth(node); _scannerParserSource.resetToPosition(_absolutePosition); - // Debug.assert(previousToken !== null); + // Debug.assert(previousToken !== undefined); // Debug.assert(previousToken.width() > 0); //if (!isPastChangeRange()) { @@ -497,6 +529,8 @@ module TypeScript.IncrementalParser { } function consumeToken(currentToken: ISyntaxToken): void { + // Debug.assert(currentToken.fullWidth() > 0 || currentToken.kind === SyntaxKind.EndOfFileToken); + // This token may have come from the old source unit, or from the new text. Handle // both accordingly. @@ -515,7 +549,7 @@ module TypeScript.IncrementalParser { var _absolutePosition = absolutePosition() + currentToken.fullWidth(); _scannerParserSource.resetToPosition(_absolutePosition); - // Debug.assert(previousToken !== null); + // Debug.assert(previousToken !== undefined); // Debug.assert(previousToken.width() > 0); //if (!isPastChangeRange()) { @@ -543,15 +577,15 @@ module TypeScript.IncrementalParser { // Once we're past the change range, we no longer need it. Null it out. // From now on we can check if we're past the change range just by seeing - // if this is null. - _changeRange = null; + // if this is undefined. + _changeRange = undefined; } } } } function isPastChangeRange(): boolean { - return _changeRange === null; + return _changeRange === undefined; } return { @@ -605,7 +639,7 @@ module TypeScript.IncrementalParser { if (syntaxCursorPoolCount > 0) { // If we reused an existing cursor, take it out of the pool so no one else uses it. syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = null; + syntaxCursorPool[syntaxCursorPoolCount] = undefined; } return cursor; @@ -652,11 +686,11 @@ module TypeScript.IncrementalParser { for (var i = 0, n = pieces.length; i < n; i++) { var piece = pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } - piece.element = null; + piece.element = undefined; piece.indexInParent = -1; } @@ -669,7 +703,7 @@ module TypeScript.IncrementalParser { for (var i = 0, n = other.pieces.length; i < n; i++) { var piece = other.pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } @@ -685,13 +719,13 @@ module TypeScript.IncrementalParser { function currentNodeOrToken(): ISyntaxNodeOrToken { if (isFinished()) { - return null; + return undefined; } var result = pieces[currentPieceIndex].element; // The current element must always be a node or a token. - // Debug.assert(result !== null); + // Debug.assert(result !== undefined); // Debug.assert(result.isNode() || result.isToken()); return result; @@ -699,12 +733,16 @@ module TypeScript.IncrementalParser { function currentNode(): ISyntaxNode { var element = currentNodeOrToken(); - return isNode(element) ? element : null; + return isNode(element) ? element : undefined; + } + + function isEmptyList(element: ISyntaxElement) { + return isList(element) && (element).length === 0; } function moveToFirstChild() { var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === null) { + if (nodeOrToken === undefined) { return; } @@ -721,7 +759,7 @@ module TypeScript.IncrementalParser { // next sibling of the empty node. for (var i = 0, n = childCount(nodeOrToken); i < n; i++) { var child = childAt(nodeOrToken, i); - if (child !== null && !isShared(child)) { + if (child && !isEmptyList(child)) { // Great, we found a real child. Push that. pushElement(child, /*indexInParent:*/ i); @@ -749,14 +787,13 @@ module TypeScript.IncrementalParser { for (var i = currentPiece.indexInParent + 1, n = childCount(parent); i < n; i++) { var sibling = childAt(parent, i); - if (sibling !== null && !isShared(sibling)) { + if (sibling && !isEmptyList(sibling)) { // We found a good sibling that we can move to. Just reuse our existing piece // so we don't have to push/pop. currentPiece.element = sibling; currentPiece.indexInParent = i; - // The sibling might have been a list. Move to it's first child. it must have - // one since this was a non-shared element. + // The sibling might have been a list. Move to it's first child. moveToFirstChildIfList(); return; } @@ -766,7 +803,7 @@ module TypeScript.IncrementalParser { // Clear the data from the old piece. We don't want to keep any elements around // unintentionally. - currentPiece.element = null; + currentPiece.element = undefined; currentPiece.indexInParent = -1; // Point at the parent. if we move past the top of the path, then we're finished. @@ -777,7 +814,7 @@ module TypeScript.IncrementalParser { function moveToFirstChildIfList(): void { var element = pieces[currentPieceIndex].element; - if (isList(element) || isSeparatedList(element)) { + if (isList(element)) { // We cannot ever get an empty list in our piece path. Empty lists are 'shared' and // we make sure to filter that out before pushing any children. // Debug.assert(childCount(element) > 0); @@ -787,7 +824,7 @@ module TypeScript.IncrementalParser { } function pushElement(element: ISyntaxElement, indexInParent: number): void { - // Debug.assert(element !== null); + // Debug.assert(element !== undefined); // Debug.assert(indexInParent >= 0); currentPieceIndex++; @@ -819,8 +856,8 @@ module TypeScript.IncrementalParser { moveToFirstToken(); var element = currentNodeOrToken(); - // Debug.assert(element === null || element.isToken()); - return element === null ? null : element; + // Debug.assert(element === undefined || element.isToken()); + return element; } return { @@ -841,21 +878,17 @@ module TypeScript.IncrementalParser { // A simple walker we use to hit all the tokens of a node and update their positions when they // are reused in a different location because of an incremental parse. - class SetTokenFullStartWalker extends SyntaxWalker { - public position: number; + class TokenCollectorWalker extends SyntaxWalker { + public tokens: ISyntaxToken[] = []; public visitToken(token: ISyntaxToken): void { - var position = this.position; - token.setFullStart(position); - - this.position = position + token.fullWidth(); + this.tokens.push(token); } } - var setTokenFullStartWalker = new SetTokenFullStartWalker(); + var tokenCollectorWalker = new TokenCollectorWalker(); export function parse(oldSyntaxTree: SyntaxTree, textChangeRange: TextChangeRange, newText: ISimpleText): SyntaxTree { - Debug.assert(oldSyntaxTree.isConcrete(), "Can only incrementally parse a concrete syntax tree."); if (textChangeRange.isUnchanged()) { return oldSyntaxTree; } diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index a35ddc5737b..8f8bae4e549 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -1,10 +1,6 @@ /// module TypeScript.Parser { - // The factory used to produce parse tree nodes. Injected normally by the - // TypeScript.Syntax.Abstract or TypeScript.Syntax.Conrete modules. - export var syntaxFactory: Syntax.ISyntaxFactory; - // Interface that represents the source that the parser pulls tokens from. Essentially, this // is the interface that the parser needs an underlying scanner to provide. This allows us to // separate out "what" the parser does with the tokens it retrieves versus "how" it obtains @@ -120,33 +116,6 @@ module TypeScript.Parser { export interface IRewindPoint { } - var arrayPool: any[][] = []; - var arrayPoolCount: number = 0; - - function getArray(): any[] { - if (arrayPoolCount === 0) { - return []; - } - - arrayPoolCount--; - var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = null; - - return result; - } - - function returnZeroLengthArray(array: any[]) { - if (array.length === 0) { - returnArray(array); - } - } - - function returnArray(array: any[]) { - array.length = 0; - arrayPool[arrayPoolCount] = array; - arrayPoolCount++; - } - interface IParserRewindPoint extends IRewindPoint { // As we speculatively parse, we may build up diagnostics. When we rewind we want to // 'forget' that information.In order to do that we store the count of diagnostics and @@ -154,13 +123,11 @@ module TypeScript.Parser { // speculative parse does not affect any further results. diagnosticsCount: number; - // isInStrictMode and listParsingState should not have to be tracked by a rewind point. - // Because they are naturally mutated and restored based on the normal stack movement of - // the parser, they should automatically return to whatever value they had to begin with - // if the parser decides to rewind or not. However, to ensure that this is true, we track - // these variables and check if they have the same value when we're rewinding/releasing. - isInStrictMode: boolean; - listParsingState: ListParsingState; + // As we speculatively parse we may end up adding additional skipped tokens to the + // _skippedTokens array in the parser. When we rewind we don't want those items in the + // array. We may also, during speculative parsing, attach our skipped tokens to some + // new token. When we rewind we need to restore whatever skipped tokens we started with. + skippedTokens: ISyntaxToken[]; } // Contains the actual logic to parse typescript/javascript. This is the code that generally @@ -187,7 +154,49 @@ module TypeScript.Parser { // TODO: do we need to store/restore this when speculative parsing? I don't think so. The // parsing logic already handles storing/restoring this and should work properly even if we're // speculative parsing. - var isInStrictMode: boolean = false; + // + // When adding more parser context flags, consider which is the more common case that the + // flag will be in. This should be hte 'false' state for that flag. The reason for this is + // that we don't store data in our nodes unless the value is in the *non-default* state. So, + // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for + // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost + // all nodes would need extra state on them to store this info. + // + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // grammar specification. + // + // An important thing about these context concepts. By default they are effectively inherited + // while parsing through every grammar production. i.e. if you don't change them, then when + // you parse a sub-production, it will have the same context values as hte parent production. + // This is great most of the time. After all, consider all the 'expression' grammar productions + // and how nearly all of them pass along the 'in' and 'yield' context values: + // + // EqualityExpression[In, Yield] : + // RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] + // + // Where you have to be careful is then understanding what the points are in the grammar + // where the values are *not* passed along. For example: + // + // SingleNameBinding[Yield,GeneratorParameter] + // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + // + // Here this is saying that if the GeneratorParameter context flag is set, that we should + // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier + // and we should explicitly unset the 'yield' context flag before calling into the Initializer. + // production. Conversely, if the GeneratorParameter context flag is not set, then we + // should leave the 'yield' context flag alone. + // + // Getting this all correct is tricky and requires careful reading of the grammar to + // understand when these values should be changed versus when they should be inherited. + var strictModeContext: boolean = false; + var disallowInContext: boolean = false; + var yieldContext: boolean = false; + var generatorParameterContext: boolean = false; // Current state of the parser. If we need to rewind we will store and reset these values as // appropriate. @@ -200,6 +209,8 @@ module TypeScript.Parser { var parseNodeData: number = 0; + var _skippedTokens: ISyntaxToken[] = undefined; + function parseSyntaxTree(_source: IParserSource, isDeclaration: boolean): SyntaxTree { // First, set up our state. fileName = _source.fileName; @@ -211,10 +222,11 @@ module TypeScript.Parser { // Now, clear out our state so that our singleton parser doesn't keep things alive. diagnostics = []; - parseNodeData = SyntaxConstants.None; - fileName = null; + parseNodeData = SyntaxNodeConstants.None; + fileName = undefined; source.release(); - source = null; _source = null; + source = undefined; + _source = undefined; return result; } @@ -225,17 +237,16 @@ module TypeScript.Parser { var allDiagnostics = source.tokenDiagnostics().concat(diagnostics); allDiagnostics.sort((a: Diagnostic, b: Diagnostic) => a.start() - b.start()); - return new SyntaxTree(syntaxFactory.isConcrete, sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); + return new SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); } function getRewindPoint(): IParserRewindPoint { var rewindPoint = source.getRewindPoint(); + // See the comments in IParserRewindPoint for the explanation on why we need to store + // this data, and what it is used for. rewindPoint.diagnosticsCount = diagnostics.length; - - // Values we keep around for debug asserting purposes. - rewindPoint.isInStrictMode = isInStrictMode; - rewindPoint.listParsingState = listParsingState; + rewindPoint.skippedTokens = _skippedTokens ? _skippedTokens.slice(0) : undefined; return rewindPoint; } @@ -244,6 +255,7 @@ module TypeScript.Parser { source.rewind(rewindPoint); diagnostics.length = rewindPoint.diagnosticsCount; + _skippedTokens = rewindPoint.skippedTokens; } function releaseRewindPoint(rewindPoint: IParserRewindPoint): void { @@ -254,22 +266,33 @@ module TypeScript.Parser { } function currentNode(): ISyntaxNode { - var node = source.currentNode(); + // If we have any outstanding tokens, then don't reuse a node. + // TODO(cyrusn): This may be too conservative. Perhaps we could reuse hte node and + // attach the skipped tokens in front? For now though, being conservative is nice and + // safe, and likely won't ever affect perf. + if (!_skippedTokens) { + var node = source.currentNode(); - // We can only reuse a node if it was parsed under the same strict mode that we're - // currently in. i.e. if we originally parsed a node in non-strict mode, but then - // the user added 'using strict' at the top of the file, then we can't use that node - // again as the presense of strict mode may cause us to parse the tokens in the file - // differetly. - // - // Note: we *can* reuse tokens when the strict mode changes. That's because tokens - // are unaffected by strict mode. It's just the parser will decide what to do with it - // differently depending on what mode it is in. - if (node === null || parsedInStrictMode(node) !== isInStrictMode) { - return null; + // We can only reuse a node if it was parsed under the same strict mode that we're + // currently in. i.e. if we originally parsed a node in non-strict mode, but then + // the user added 'using strict' at the top of the file, then we can't use that node + // again as the presense of strict mode may cause us to parse the tokens in the file + // differetly. + // + // Note: we *can* reuse tokens when the strict mode changes. That's because tokens + // are unaffected by strict mode. It's just the parser will decide what to do with it + // differently depending on what mode it is in. + if (node && + parsedInStrictModeContext(node) === strictModeContext && + parsedInDisallowInContext(node) === disallowInContext && + parsedInYieldContext(node) === yieldContext && + parsedInGeneratorParameterContext(node) === generatorParameterContext) { + + return node; + } } - return node; + return undefined; } function currentToken(): ISyntaxToken { @@ -286,12 +309,79 @@ module TypeScript.Parser { return source.peekToken(n); } + function skipToken(token: ISyntaxToken): void { + _skippedTokens = _skippedTokens || []; + _skippedTokens.push(token); + + // directly tell the source to just consume the token we're skipping. i.e. do not + // call 'consumeToken'. Doing so would attempt to add any previous skipped tokens + // to this token we're skipping. We don't want to do that. Instead, we want to add + // all the skipped tokens when we finally eat the next good token. + source.consumeToken(token) + } + function consumeToken(token: ISyntaxToken): ISyntaxToken { + // Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); + + // First, tell our source that the token has been consumed. source.consumeToken(token); + + // Now, if we had any skipped tokens, we want to add them to the start of this token + // we're consuming. + if (_skippedTokens) { + token = addSkippedTokensBeforeToken(token, _skippedTokens); + _skippedTokens = undefined; + } + return token; } + function addSkippedTokensBeforeToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { + //Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); + //Debug.assert(skippedTokens.length > 0); + + var leadingTrivia: ISyntaxTrivia[] = []; + for (var i = 0, n = skippedTokens.length; i < n; i++) { + var skippedToken = skippedTokens[i]; + addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); + } + + addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); + + var updatedToken = Syntax.withLeadingTrivia(token, Syntax.triviaList(leadingTrivia), source.text); + + // We've prepending this token with new leading trivia. This means the full start of + // the token is not where the scanner originally thought it was, but is instead at the + // start of the first skipped token. + updatedToken.setFullStart(skippedTokens[0].fullStart()); + + return updatedToken; + } + + function addSkippedTokenToTriviaArray(array: ISyntaxTrivia[], skippedToken: ISyntaxToken): void { + // Debug.assert(skippedToken.text().length > 0); + + // first, add the leading trivia of the skipped token to the array + addTriviaTo(skippedToken.leadingTrivia(source.text), array); + + // now, add the text of the token as skipped text to the trivia array. + var trimmedToken = Syntax.withLeadingTrivia(skippedToken, Syntax.emptyTriviaList, source.text); + + // Because we removed the leading trivia from the skipped token, the full start of the + // trimmed token is the start of the skipped token. + trimmedToken.setFullStart(start(skippedToken, source.text)); + + array.push(Syntax.skippedTokenTrivia(trimmedToken, source.text)); + } + + function addTriviaTo(list: ISyntaxTriviaList, array: ISyntaxTrivia[]): void { + for (var i = 0, n = list.count(); i < n; i++) { + array.push(list.syntaxTriviaAt(i)); + } + } + function consumeNode(node: ISyntaxNode): void { + Debug.assert(_skippedTokens === undefined); source.consumeNode(node); } @@ -299,7 +389,7 @@ module TypeScript.Parser { //we should keep it simple so that it can be inlined. function eatToken(kind: SyntaxKind): ISyntaxToken { var token = currentToken(); - if (token.kind() === kind) { + if (token.kind === kind) { return consumeToken(token); } @@ -310,11 +400,11 @@ module TypeScript.Parser { // Eats the token if it is there. Otherwise does nothing. Will not report errors. function tryEatToken(kind: SyntaxKind): ISyntaxToken { var _currentToken = currentToken(); - if (_currentToken.kind() === kind) { + if (_currentToken.kind === kind) { return consumeToken(_currentToken); } - return null; + return undefined; } // An identifier is basically any word, unless it is a reserved keyword. so 'foo' is an @@ -322,19 +412,25 @@ module TypeScript.Parser { // on the state of the parser. For example, 'yield' is an identifier *unless* the parser // is in strict mode. function isIdentifier(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.IdentifierName) { return true; } + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + // considered a keyword and is not an identifier. + if (tokenKind === SyntaxKind.YieldKeyword && yieldContext) { + return false; + } + // Keywords are only identifiers if they're FutureReservedStrictWords and we're in // strict mode. *Or* if it's a typescript 'keyword'. if (tokenKind >= SyntaxKind.FirstFutureReservedStrictKeyword) { if (tokenKind <= SyntaxKind.LastFutureReservedStrictKeyword) { // Could be a keyword or identifier. It's an identifier if we're not in strict // mode. - return !isInStrictMode; + return !strictModeContext; } // If it's typescript keyword, then it's actually a javascript identifier. @@ -351,7 +447,7 @@ module TypeScript.Parser { var token = currentToken(); // If we have an identifier name, then consume and return it. - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.IdentifierName) { return consumeToken(token); } @@ -367,7 +463,7 @@ module TypeScript.Parser { } function eatOptionalIdentifierToken(): ISyntaxToken { - return isIdentifier(currentToken()) ? eatIdentifierToken() : null; + return isIdentifier(currentToken()) ? eatIdentifierToken() : undefined; } // This method should be called when the grammar calls for an *Identifier* and not an @@ -375,39 +471,25 @@ module TypeScript.Parser { function eatIdentifierToken(diagnosticCode?: string): ISyntaxToken { var token = currentToken(); if (isIdentifier(token)) { - consumeToken(token); - - if (token.kind() === SyntaxKind.IdentifierName) { - return token; + if (token.kind === SyntaxKind.IdentifierName) { + return consumeToken(token); } - return TypeScript.Syntax.convertKeywordToIdentifier(token); + return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); } return createMissingToken(SyntaxKind.IdentifierName, token, diagnosticCode); } - function previousTokenHasTrailingNewLine(token: ISyntaxToken): boolean { - var tokenFullStart = token.fullStart(); - if (tokenFullStart === 0) { - // First token in the document. Thus it has no 'previous' token, and there is - // no preceding newline. - return false; - } - - // If our previous token ended with a newline, then *by definition* we must have started - // at the beginning of a line. - var lineNumber = source.text.lineMap().getLineNumberFromPosition(tokenFullStart); - var lineStart = source.text.lineMap().getLineStartPosition(lineNumber); - - return lineStart == tokenFullStart; + function isOnDifferentLineThanPreviousToken(token: ISyntaxToken): boolean { + return token.hasLeadingNewLine(); } function canEatAutomaticSemicolon(allowWithoutNewLine: boolean): boolean { var token = currentToken(); // An automatic semicolon is always allowed if we're at the end of the file. - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.EndOfFileToken) { return true; } @@ -422,7 +504,7 @@ module TypeScript.Parser { } // It is also allowed if there is a newline between the last token seen and the next one. - if (previousTokenHasTrailingNewLine(token)) { + if (isOnDifferentLineThanPreviousToken(token)) { return true; } @@ -432,7 +514,7 @@ module TypeScript.Parser { function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline: boolean): boolean { var token = currentToken(); - if (token.kind() === SyntaxKind.SemicolonToken) { + if (token.kind === SyntaxKind.SemicolonToken) { return true; } @@ -443,15 +525,15 @@ module TypeScript.Parser { var token = currentToken(); // If we see a semicolon, then we can definitely eat it. - if (token.kind() === SyntaxKind.SemicolonToken) { + if (token.kind === SyntaxKind.SemicolonToken) { return consumeToken(token); } // Check if an automatic semicolon could go here. If so, then there's no problem and - // we can proceed without error. Return 'null' as there's no actual token for this + // we can proceed without error. Return 'undefined' as there's no actual token for this // position. if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return null; + return undefined; } // No semicolon could be consumed here at all. Just call the standard eating function @@ -468,10 +550,10 @@ module TypeScript.Parser { return Syntax.emptyToken(expectedKind); } - function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode: string): Diagnostic { + function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual?: ISyntaxToken, diagnosticCode?: string): Diagnostic { var token = currentToken(); - var args: any[] = null; + var args: any[] = undefined; // If a specialized diagnostic message was provided, just use that. if (!diagnosticCode) { // They wanted something specific, just report that that token was missing. @@ -483,9 +565,9 @@ module TypeScript.Parser { // They wanted an identifier. // If the user supplied a keyword, give them a specialized message. - if (actual !== null && SyntaxFacts.isAnyKeyword(actual.kind())) { + if (actual && SyntaxFacts.isAnyKeyword(actual.kind)) { diagnosticCode = DiagnosticCode.Identifier_expected_0_is_a_keyword; - args = [SyntaxFacts.getText(actual.kind())]; + args = [SyntaxFacts.getText(actual.kind)]; } else { // Otherwise just report that an identifier was expected. @@ -532,194 +614,47 @@ module TypeScript.Parser { throw Errors.invalidOperation(); } - function addSkippedTokenAfterNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, skippedToken: ISyntaxToken): ISyntaxNodeOrToken { - if (isToken(nodeOrToken)) { - return addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } - else if (isNode(nodeOrToken)) { - return addSkippedTokenAfterNode(nodeOrToken, skippedToken); - } - else { - throw Errors.invalidOperation(); - } + function updateParseNodeData() { + parseNodeData = + (strictModeContext ? SyntaxNodeConstants.ParsedInStrictModeContext : 0) | + (disallowInContext ? SyntaxNodeConstants.ParsedInDisallowInContext : 0) | + (yieldContext ? SyntaxNodeConstants.ParsedInYieldContext : 0) | + (generatorParameterContext ? SyntaxNodeConstants.ParsedInGeneratorParameterContext : 0); } - function replaceTokenInParent(node: ISyntaxNode, oldToken: ISyntaxToken, newToken: ISyntaxToken): void { - // oldToken may be parented by a node or a list. - replaceTokenInParentWorker(oldToken, newToken); - - var parent = oldToken.parent; - newToken.parent = parent; - - // Walk upwards to our outermost node, clearing hte cached 'data' in it. This will - // make sure that the fullWidths and incrementally unusable bits are computed correctly - // when next requested. - while (true) { - // Parent must be a list or a node. All of those have a 'data' element. - Debug.assert(isNode(parent) || isList(parent) || isSeparatedList(parent)); - var dataElement = <{ data: number }>parent; - if (dataElement.data) { - dataElement.data &= SyntaxConstants.NodeParsedInStrictModeMask - } - - if (parent === node) { - break; - } - - parent = parent.parent; - } + function setStrictModeContext(val: boolean) { + strictModeContext = val; + updateParseNodeData(); } - function replaceTokenInParentWorker(oldToken: ISyntaxToken, newToken: ISyntaxToken): void { - var parent = oldToken.parent; - - if (isNode(parent)) { - var node = parent; - for (var key in node) { - if (node[key] === oldToken) { - node[key] = newToken; - return; - } - } - } - else if (isList(parent)) { - var list1 = parent; - for (var i = 0, n = list1.length; i < n; i++) { - if (list1[i] === oldToken) { - list1[i] = newToken; - return; - } - } - } - else if (isSeparatedList(parent)) { - var list2 = parent; - for (var i = 0, n = childCount(list2); i < n; i++) { - if (childAt(list2, i) === oldToken) { - if (i % 2 === 0) { - list2[i / 2] = newToken; - } - else { - list2.separators[(i - 1) / 2] = newToken; - } - return; - } - } - } - - throw Errors.invalidOperation(); + function setDisallowInContext(val: boolean) { + disallowInContext = val; + updateParseNodeData(); } - function addSkippedTokenAfterNode(node: ISyntaxNode, skippedToken: ISyntaxToken): ISyntaxNode { - var oldToken = lastToken(node); - var newToken = addSkippedTokenAfterToken(oldToken, skippedToken); - - replaceTokenInParent(node, oldToken, newToken); - return node; + function setYieldContext(val: boolean) { + yieldContext = val; + updateParseNodeData(); } - function addSkippedTokensBeforeNode(node: ISyntaxNode, skippedTokens: ISyntaxToken[]): ISyntaxNode { - if (skippedTokens.length > 0) { - var oldToken = firstToken(node); - var newToken = addSkippedTokensBeforeToken(oldToken, skippedTokens); - - replaceTokenInParent(node, oldToken, newToken); - } - - return node; - } - - function addSkippedTokensBeforeToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0 || token.kind() === SyntaxKind.EndOfFileToken); - // Debug.assert(skippedTokens.length > 0); - - var leadingTrivia: ISyntaxTrivia[] = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - var skippedToken = skippedTokens[i]; - addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); - } - - addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); - - var updatedToken = Syntax.withLeadingTrivia(token, Syntax.triviaList(leadingTrivia), source.text); - - // We've prepending this token with new leading trivia. This means the full start of - // the token is not where the scanner originally thought it was, but is instead at the - // start of the first skipped token. - updatedToken.setFullStart(skippedTokens[0].fullStart()); - - // Don't need this array anymore. Give it back so we can reuse it. - returnArray(skippedTokens); - - return updatedToken; - } - - function addSkippedTokensAfterToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0); - if (skippedTokens.length === 0) { - returnArray(skippedTokens); - return token; - } - - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - - for (var i = 0, n = skippedTokens.length; i < n; i++) { - addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - - // Don't need this array anymore. Give it back so we can reuse it. - returnArray(skippedTokens); - return Syntax.withTrailingTrivia(token, Syntax.triviaList(trailingTrivia), source.text); - } - - function addSkippedTokenAfterToken(token: ISyntaxToken, skippedToken: ISyntaxToken): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0); - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - - return Syntax.withTrailingTrivia(token, Syntax.triviaList(trailingTrivia), source.text); - } - - function addSkippedTokenToTriviaArray(array: ISyntaxTrivia[], skippedToken: ISyntaxToken): void { - // Debug.assert(skippedToken.text().length > 0); - - // first, add the leading trivia of the skipped token to the array - addTriviaTo(skippedToken.leadingTrivia(source.text), array); - - // now, add the text of the token as skipped text to the trivia array. - var trimmedToken = Syntax.withTrailingTrivia(Syntax.withLeadingTrivia(skippedToken, Syntax.emptyTriviaList, source.text), Syntax.emptyTriviaList, source.text); - - // Because we removed the leading trivia from the skipped token, the full start of the - // trimmed token is the start of the skipped token. - trimmedToken.setFullStart(start(skippedToken, source.text)); - - array.push(Syntax.skippedTokenTrivia(trimmedToken, source.text)); - - // Finally, add the trailing trivia of the skipped token to the trivia array. - addTriviaTo(skippedToken.trailingTrivia(source.text), array); - } - - function addTriviaTo(list: ISyntaxTriviaList, array: ISyntaxTrivia[]): void { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - } - - function setStrictMode(_isInStrictMode: boolean) { - isInStrictMode = _isInStrictMode; - parseNodeData = _isInStrictMode ? SyntaxConstants.NodeParsedInStrictModeMask : 0; + function setGeneratorParameterContext(val: boolean) { + generatorParameterContext = val; + updateParseNodeData(); } function parseSourceUnit(): SourceUnitSyntax { - var savedIsInStrictMode = isInStrictMode + // Note: saving and restoring the 'isInStrictMode' state is not really necessary here + // (as it will never be read afterwards). However, for symmetry with the rest of the + // parsing code, we do the same here. + var savedIsInStrictMode = strictModeContext - var skippedTokens: ISyntaxToken[] = getArray(); - var moduleElements = parseSyntaxList(ListParsingState.SourceUnit_ModuleElements, skippedTokens, updateStrictModeState); - - setStrictMode(savedIsInStrictMode); - - var sourceUnit = new syntaxFactory.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); - - sourceUnit = addSkippedTokensBeforeNode(sourceUnit, skippedTokens); + // Note: any skipped tokens produced after the end of all the module elements will be + // added as skipped trivia to the start of the EOF token. + var moduleElements = parseSyntaxList(ListParsingState.SourceUnit_ModuleElements, updateStrictModeState); + + setStrictModeContext(savedIsInStrictMode); + + var sourceUnit = new SourceUnitSyntax(parseNodeData, moduleElements, consumeToken(currentToken())); if (Debug.shouldAssert(AssertionLevel.Aggressive)) { Debug.assert(fullWidth(sourceUnit) === source.text.length()); @@ -732,17 +667,21 @@ module TypeScript.Parser { return sourceUnit; } + function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean { + return node.kind === SyntaxKind.ExpressionStatement && + (node).expression.kind === SyntaxKind.StringLiteral; + } + function updateStrictModeState(items: any[]): void { - if (!isInStrictMode) { + if (!strictModeContext) { // Check if all the items are directive prologue elements. - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!SyntaxFacts.isDirectivePrologueElement(item)) { + for (var i = 0, n = items.length; i < n; i++) { + if (!isDirectivePrologueElement(items[i])) { return; } } - setStrictMode(SyntaxFacts.isUseStrictDirective(items[items.length - 1])); + setStrictModeContext(SyntaxFacts.isUseStrictDirective(items[items.length - 1])); } } @@ -769,7 +708,7 @@ module TypeScript.Parser { if (_modifierCount) { // if we have modifiers, then these are definitely TS constructs and we can // immediately start parsing them. - switch (peekToken(_modifierCount).kind()) { + switch (peekToken(_modifierCount).kind) { case SyntaxKind.ImportKeyword: return parseImportDeclaration(); case SyntaxKind.ModuleKeyword: return parseModuleDeclaration(); case SyntaxKind.InterfaceKeyword: return parseInterfaceDeclaration(); @@ -785,10 +724,10 @@ module TypeScript.Parser { // consuming these, we only parse them out if we can see enough context to 'prove' that // they really do start the module element var nextToken = peekToken(1); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.ModuleKeyword: - if (isIdentifier(nextToken) || nextToken.kind() === SyntaxKind.StringLiteral) { + if (isIdentifier(nextToken) || nextToken.kind === SyntaxKind.StringLiteral) { return parseModuleDeclaration(); } break; @@ -820,7 +759,7 @@ module TypeScript.Parser { case SyntaxKind.ExportKeyword: // 'export' could be a modifier on a statement (like export var ...). So we // only want to parse out an export assignment here if we actually see the equals. - if (nextToken.kind() === SyntaxKind.EqualsToken) { + if (nextToken.kind === SyntaxKind.EqualsToken) { return parseExportAssignment(); } break; @@ -830,12 +769,12 @@ module TypeScript.Parser { } function parseImportDeclaration(): ImportDeclarationSyntax { - return new syntaxFactory.ImportDeclarationSyntax(parseNodeData, + return new ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(SyntaxKind.ImportKeyword), eatIdentifierToken(), eatToken(SyntaxKind.EqualsToken), parseModuleReference(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseExportAssignment(): ExportAssignmentSyntax { - return new syntaxFactory.ExportAssignmentSyntax(parseNodeData, + return new ExportAssignmentSyntax(parseNodeData, eatToken(SyntaxKind.ExportKeyword), eatToken(SyntaxKind.EqualsToken), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } @@ -844,35 +783,32 @@ module TypeScript.Parser { } function isExternalModuleReference(): boolean { - return currentToken().kind() === SyntaxKind.RequireKeyword && - peekToken(1).kind() === SyntaxKind.OpenParenToken; + return currentToken().kind === SyntaxKind.RequireKeyword && + peekToken(1).kind === SyntaxKind.OpenParenToken; } function parseExternalModuleReference(): ExternalModuleReferenceSyntax { - return new syntaxFactory.ExternalModuleReferenceSyntax(parseNodeData, + return new ExternalModuleReferenceSyntax(parseNodeData, eatToken(SyntaxKind.RequireKeyword), eatToken(SyntaxKind.OpenParenToken), eatToken(SyntaxKind.StringLiteral), eatToken(SyntaxKind.CloseParenToken)); } function parseModuleNameModuleReference(): ModuleNameModuleReferenceSyntax { - return new syntaxFactory.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(/*allowIdentifierNames:*/ false)); + return new ModuleNameModuleReferenceSyntax(parseNodeData, parseName(/*allowIdentifierNames:*/ false)); } function tryParseTypeArgumentList(inExpression: boolean): TypeArgumentListSyntax { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.LessThanToken) { - return null; + if (_currentToken.kind !== SyntaxKind.LessThanToken) { + return undefined; } if (!inExpression) { // if we're not in an expression, this must be a type argument list. Just parse // it out as such. - var lessThanToken = consumeToken(_currentToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeArguments = parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - - return new syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(SyntaxKind.GreaterThanToken)); + return new TypeArgumentListSyntax(parseNodeData, + consumeToken(_currentToken), + parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types), + eatToken(SyntaxKind.GreaterThanToken)); } // If we're in an expression, then we only want to consume this as a type argument list @@ -882,24 +818,20 @@ module TypeScript.Parser { // We've seen a '<'. Try to parse it out as a type argument list. var lessThanToken = consumeToken(_currentToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeArguments = parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types, skippedTokens); - var lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - + var typeArguments = parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types); var greaterThanToken = eatToken(SyntaxKind.GreaterThanToken); // We're in a context where '<' could be the start of a type argument list, or part // of an arithmetic expression. We'll presume it's the latter unless we see the '>' // and a following token that guarantees that it's supposed to be a type argument list. - if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { + if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind)) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); + return new TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); } } @@ -964,8 +896,8 @@ module TypeScript.Parser { // the code would be implicitly: "name.keyword; identifierNameOrKeyword". // In the first case though, ASI will not take effect because there is not a // line terminator after the keyword. - if (SyntaxFacts.isAnyKeyword(_currentToken.kind()) && - previousTokenHasTrailingNewLine(_currentToken)) { + if (SyntaxFacts.isAnyKeyword(_currentToken.kind) && + isOnDifferentLineThanPreviousToken(_currentToken)) { var token1 = peekToken(1); if (!existsNewLineBetweenTokens(_currentToken, token1, source.text) && @@ -982,17 +914,17 @@ module TypeScript.Parser { var token0 = currentToken(); var shouldContinue = isIdentifier(token0); if (!shouldContinue) { - return null; + return undefined; } // Call eatIdentifierName to convert the token to an identifier if it is as keyword. var current: INameSyntax = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === SyntaxKind.DotToken) { + while (shouldContinue && currentToken().kind === SyntaxKind.DotToken) { var dotToken = consumeToken(currentToken()); var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new syntaxFactory.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); + current = new QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); shouldContinue = identifierName.fullWidth() > 0; } @@ -1000,47 +932,114 @@ module TypeScript.Parser { } function parseEnumDeclaration(): EnumDeclarationSyntax { - var modifiers = parseModifiers(); - var enumKeyword = eatToken(SyntaxKind.EnumKeyword); - var identifier = eatIdentifierToken(); + var openBraceToken: ISyntaxToken; - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var enumElements = Syntax.emptySeparatedList(); - - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - enumElements = parseSeparatedSyntaxList(ListParsingState.EnumDeclaration_EnumElements, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements, eatToken(SyntaxKind.CloseBraceToken)); + return new EnumDeclarationSyntax(parseNodeData, + parseModifiers(), + eatToken(SyntaxKind.EnumKeyword), + eatIdentifierToken(), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.EnumDeclaration_EnumElements) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function isEnumElement(inErrorRecovery: boolean): boolean { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.EnumElement) { + if (node && node.kind === SyntaxKind.EnumElement) { return true; } - return isPropertyName(currentToken(), inErrorRecovery); + return isPropertyName(/*peekToken:*/ 0, inErrorRecovery); } + function allowInAnd(func: () => T): T { + if (disallowInContext) { + setDisallowInContext(false); + var result = func(); + setDisallowInContext(true); + return result; + } + + // no need to do anything special if 'in' is already allowed. + return func(); + } + + function disallowInAnd(func: () => T): T { + if (disallowInContext) { + // no need to do anything special if 'in' is already disallowed. + return func(); + } + + setDisallowInContext(true); + var result = func(); + setDisallowInContext(false); + return result; + } + + function enterYieldContextAnd(func: () => T): T { + if (yieldContext) { + // no need to do anything special if we're already in the [Yield] context. + return func(); + } + + setYieldContext(true); + var result = func(); + setYieldContext(false); + return result; + } + + function exitYieldContextAnd(func: () => T): T { + if (yieldContext) { + setYieldContext(false); + var result = func(); + setYieldContext(true); + return result; + } + + // no need to do anything special if we're not in the [Yield] context. + return func(); + } + + function enterGeneratorParameterContextAnd(func: () => T): T { + if (generatorParameterContext) { + // no need to do anything special if we're already in the [GeneratorParameter] context + return func(); + } + + setGeneratorParameterContext(true); + var result = func(); + setGeneratorParameterContext(false); + return result; + } + + function exitGeneratorParameterContextAnd(func: () => T): T { + if (generatorParameterContext) { + setGeneratorParameterContext(false); + var result = func(); + setGeneratorParameterContext(true); + return result; + } + + // no need to do anything special if we're not in the [GeneratorParameter] context + return func(); + } + function tryParseEnumElementEqualsValueClause(): EqualsValueClauseSyntax { - return isEqualsValueClause(/*inParameter*/ false) ? parseEqualsValueClause(/*allowIn:*/ true) : null; + return isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined; } function tryParseEnumElement(inErrorRecovery: boolean): EnumElementSyntax { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.EnumElement) { + if (node && node.kind === SyntaxKind.EnumElement) { consumeNode(node); return node; } - if (!isPropertyName(currentToken(), inErrorRecovery)) { - return null; + if (!isPropertyName(/*peekToken:*/ 0, inErrorRecovery)) { + return undefined; } - return new syntaxFactory.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); + return new EnumElementSyntax(parseNodeData, parsePropertyName(), tryParseEnumElementEqualsValueClause()); } function isModifierKind(kind: SyntaxKind): boolean { @@ -1058,19 +1057,22 @@ module TypeScript.Parser { } function isModifier(token: ISyntaxToken, index: number): boolean { - if (isModifierKind(token.kind())) { + if (isModifierKind(token.kind)) { // These are modifiers only if we see an actual keyword, identifier, string literal // or number following. - // Note: we also allow [ for error conditions. - // [ is for: static [a: number] + // + // [ is for: static [a: number] ... + // [ is for: static [computedProp()] ... var nextToken = peekToken(index + 1); - var nextTokenKind = nextToken.kind(); + var nextTokenKind = nextToken.kind; switch (nextTokenKind) { case SyntaxKind.IdentifierName: case SyntaxKind.OpenBracketToken: case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.AsteriskToken: return true; default: return SyntaxFacts.isAnyKeyword(nextTokenKind); @@ -1090,7 +1092,7 @@ module TypeScript.Parser { } function parseModifiers(): ISyntaxToken[] { - var tokens: ISyntaxToken[] = getArray(); + var tokens: ISyntaxToken[] = []; while (true) { var token = currentToken(); @@ -1102,89 +1104,100 @@ module TypeScript.Parser { break; } - var result = Syntax.list(tokens); - - // If the tokens array is greater than one, then we can't return it. It will have been - // copied directly into the syntax list. - returnZeroLengthArray(tokens); - - return result; + return Syntax.list(tokens); } - function parseHeritageClauses(): HeritageClauseSyntax[] { - var heritageClauses = Syntax.emptyList(); + function parseHeritageClauses(isClassHeritageClause: boolean): HeritageClauseSyntax[] { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { - // NOTE: we can pass "null" for the skipped tokens here as we know we can't get - // any leading skipped tokens. We have an 'extends' or 'implements' keyword, so - // any skipped tokeds will get attached to that instead. - heritageClauses= parseSyntaxList(ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses, null); + return isClassHeritageClause && generatorParameterContext + ? exitYieldContextAnd(parseHeritageClausesWorker) + : parseHeritageClausesWorker(); } - return heritageClauses; + return []; + } + + function parseHeritageClausesWorker() { + return parseSyntaxList(ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses) } function tryParseHeritageClauseTypeName(): ITypeSyntax { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : null; + return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : undefined; } function parseClassDeclaration(): ClassDeclarationSyntax { - var modifiers = parseModifiers(); - var classKeyword = eatToken(SyntaxKind.ClassKeyword); - var identifier = eatIdentifierToken(); - var typeParameterList = tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false); - var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var classElements = Syntax.emptyList(); + var openBraceToken: ISyntaxToken; + return new ClassDeclarationSyntax(parseNodeData, + parseModifiers(), + eatToken(SyntaxKind.ClassKeyword), + eatIdentifierToken(), + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseHeritageClauses(/*isClassHeritageClauses:*/ true), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.ClassDeclaration_ClassElements) : [], + eatToken(SyntaxKind.CloseBraceToken)); + } + + function parseClassElement(openBraceToken: ISyntaxToken): IClassElementSyntax[] { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - classElements = parseSyntaxList(ListParsingState.ClassDeclaration_ClassElements, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - }; + return generatorParameterContext + ? exitYieldContextAnd(parseClassElements) + : parseClassElements(); + } - return new syntaxFactory.ClassDeclarationSyntax(parseNodeData, - modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, eatToken(SyntaxKind.CloseBraceToken)); + return []; + } + + function parseClassElements() { + return parseSyntaxList(ListParsingState.ClassDeclaration_ClassElements) } function isAccessor(modifierCount: number, inErrorRecovery: boolean): boolean { - var tokenKind = peekToken(modifierCount).kind(); + var tokenKind = peekToken(modifierCount).kind; if (tokenKind !== SyntaxKind.GetKeyword && tokenKind !== SyntaxKind.SetKeyword) { return false; } - return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); + return isPropertyName(/*peekIndex:*/ modifierCount + 1, inErrorRecovery); } - function parseAccessor(checkForStrictMode: boolean): ISyntaxNode { + function parseAccessor(): IAccessorSyntax { var modifiers = parseModifiers(); - var _currenToken = currentToken(); - var tokenKind = _currenToken.kind(); + var _currentToken = currentToken(); + var tokenKind = _currentToken.kind; if (tokenKind === SyntaxKind.GetKeyword) { - return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); + return parseGetAccessor(modifiers, _currentToken); } else if (tokenKind === SyntaxKind.SetKeyword) { - return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); + return parseSetAccessor(modifiers, _currentToken); } else { throw Errors.invalidOperation(); } } - function parseGetMemberAccessorDeclaration(modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, checkForStrictMode: boolean): GetAccessorSyntax { - return new syntaxFactory.GetAccessorSyntax(parseNodeData, - modifiers, consumeToken(getKeyword), eatPropertyName(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, checkForStrictMode)); + function parseGetAccessor(modifiers: ISyntaxToken[], getKeyword: ISyntaxToken): GetAccessorSyntax { + return new GetAccessorSyntax(parseNodeData, + modifiers, consumeToken(getKeyword), parsePropertyName(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameter:*/ false), + parseFunctionBlock(/*allowYield:*/ false)); } - function parseSetMemberAccessorDeclaration(modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, checkForStrictMode: boolean): SetAccessorSyntax { - return new syntaxFactory.SetAccessorSyntax(parseNodeData, - modifiers, consumeToken(setKeyword), eatPropertyName(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, checkForStrictMode)); + function parseSetAccessor(modifiers: ISyntaxToken[], setKeyword: ISyntaxToken): SetAccessorSyntax { + return new SetAccessorSyntax(parseNodeData, + modifiers, consumeToken(setKeyword), parsePropertyName(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false), + parseFunctionBlock(/*allowYield:*/ false)); } function isClassElement(inErrorRecovery: boolean): boolean { @@ -1196,10 +1209,65 @@ module TypeScript.Parser { // checks for a subset of the conditions of the previous two calls. var _modifierCount = modifierCount(); return isConstructorDeclaration(_modifierCount) || - isMemberFunctionDeclaration(_modifierCount, inErrorRecovery) || isAccessor(_modifierCount, inErrorRecovery) || - isMemberVariableDeclaration(_modifierCount, inErrorRecovery) || - isIndexMemberDeclaration(_modifierCount); + isIndexMemberDeclaration(_modifierCount) || + isMemberVariableOrFunctionDeclaration(_modifierCount, inErrorRecovery); + } + + function isMemberVariableOrFunctionDeclaration(peekIndex: number, inErrorRecovery: boolean) { + var tokenN = peekToken(peekIndex); + var tokenNKind = tokenN.kind; + + // If we have a '*', then this is a generator function. + if (tokenNKind === SyntaxKind.AsteriskToken) { + if (inErrorRecovery) { + // If we're in error recovery, we might see a random * that is part of some + // expression. Really, in order to view this as a generator function, we want + // to see at least '*id<' or '*id('. Otherwise, we won't think of this as the + // start of a member variable/function. + return peekToken(peekIndex + 1).kind === SyntaxKind.IdentifierName && + (peekToken(peekIndex + 2).kind === SyntaxKind.LessThanToken || peekToken(peekIndex + 2).kind === SyntaxKind.OpenParenToken); + } + + return true; + } + + // Check if its the start of a property or method. Both must start with a property name. + if (!isPropertyName(peekIndex, inErrorRecovery)) { + return false; + } + + if (!SyntaxFacts.isAnyKeyword(tokenNKind)) { + // It wasn't a keyword. So this is definitely a member variable or function. + return true; + } + + // Keywords *can* technically start properties and methods. However, they often + // are actually intended to start a real ts/js construct. Only accept a keyword + // if it is definitely a property or method. + // keywords are also property names. Only accept a keyword as a property + // name if is of the form: + // public; + // public= + // public: + // public } + // public( + // public< + // public + // public + var nextToken = peekToken(peekIndex + 1); + switch (nextToken.kind) { + case SyntaxKind.SemicolonToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.ColonToken: + case SyntaxKind.CloseBraceToken: + case SyntaxKind.OpenParenToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.EndOfFileToken: + return true; + default: + return isOnDifferentLineThanPreviousToken(nextToken); + } } function tryParseClassElement(inErrorRecovery: boolean): IClassElementSyntax { @@ -1209,24 +1277,36 @@ module TypeScript.Parser { return node; } + // Have to check for indexers before anything else. That way if we see "[foo:" we + // parse it out as an indexer and not a member function or variable. var _modifierCount = modifierCount(); if (isConstructorDeclaration(_modifierCount)) { return parseConstructorDeclaration(); } - else if (isMemberFunctionDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberFunctionDeclaration(); - } - else if (isAccessor(_modifierCount, inErrorRecovery)) { - return parseAccessor(/*checkForStrictMode:*/ false); - } - else if (isMemberVariableDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberVariableDeclaration(); - } else if (isIndexMemberDeclaration(_modifierCount)) { return parseIndexMemberDeclaration(); } + else if (isAccessor(_modifierCount, inErrorRecovery)) { + return parseAccessor(); + } + else if (isMemberVariableOrFunctionDeclaration(/*peekIndex:*/ _modifierCount, inErrorRecovery)) { + var modifiers = parseModifiers(); + var asterixToken = tryEatToken(SyntaxKind.AsteriskToken); + var propertyName = parsePropertyName(); + + // If we got a '*', then this is definitely a method. If we didn't get a '*', then + // we must have gotten a property name. And if that's all we have, we have to check + // if we have a call signature. If so, then this is a member function, otherwise + // it's a member variable. + if (asterixToken || isCallSignature(/*peekIndex:*/ 0)) { + return parseMemberFunctionDeclaration(modifiers, asterixToken, propertyName); + } + else { + return parseMemberVariableDeclaration(modifiers, propertyName); + } + } else { - return null; + return undefined; } } @@ -1235,89 +1315,42 @@ module TypeScript.Parser { // assume this is a constructor. That means, if a user writes "public constructor;" // it won't be viewed as a member. As a workaround, they can simply write: // public 'constructor'; - return peekToken(modifierCount).kind() === SyntaxKind.ConstructorKeyword; + return peekToken(modifierCount).kind === SyntaxKind.ConstructorKeyword; } function parseConstructorDeclaration(): ConstructorDeclarationSyntax { - var modifiers = parseModifiers(); - var constructorKeyword = eatToken(SyntaxKind.ConstructorKeyword); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); - - var semicolonToken: ISyntaxToken = null; - var block: BlockSyntax = null; - - if (isBlock()) { - block = parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); - } - - return new syntaxFactory.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); + // Note: if we see an arrow after the close paren, then try to parse out a function + // block anyways. It's likely the user just though '=> expr' was legal anywhere a + // block was legal. + return new ConstructorDeclarationSyntax(parseNodeData, + parseModifiers(), + eatToken(SyntaxKind.ConstructorKeyword), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false), + isBlockOrArrow() ? parseFunctionBlock(/*allowYield:*/ false) : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } - function isMemberFunctionDeclaration(modifierCount: number, inErrorRecovery: boolean): boolean { - return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); - } - - function parseMemberFunctionDeclaration(): MemberFunctionDeclarationSyntax { - var modifiers = parseModifiers(); - var propertyName = eatPropertyName(); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); - - // If we got an errant => then we want to parse what's coming up without requiring an - // open brace. - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - - var block: BlockSyntax = null; - var semicolon: ISyntaxToken = null; - - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, /*checkForStrictMode:*/ true); - } - else { - semicolon = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); - } - - return new syntaxFactory.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); + function parseMemberFunctionDeclaration(modifiers: ISyntaxToken[], asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): MemberFunctionDeclarationSyntax { + // Note: if we see an arrow after the close paren, then try to parse out a function + // block anyways. It's likely the user just though '=> expr' was legal anywhere a + // block was legal. + var isGeneratorFunction = asteriskToken !== undefined; + return new MemberFunctionDeclarationSyntax(parseNodeData, + modifiers, + asteriskToken, + propertyName, + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ isGeneratorFunction, /*generatorParameterContext:*/ isGeneratorFunction), + isBlockOrArrow() + ? parseFunctionBlock(/*yieldContext:*/ isGeneratorFunction) + : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } - function isDefinitelyMemberVariablePropertyName(index: number): boolean { - // keywords are also property names. Only accept a keyword as a property - // name if is of the form: - // public; - // public= - // public: - // public } - // public - // public - if (SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { - var nextToken = peekToken(index + 1); - switch (nextToken.kind()) { - case SyntaxKind.SemicolonToken: - case SyntaxKind.EqualsToken: - case SyntaxKind.ColonToken: - case SyntaxKind.CloseBraceToken: - case SyntaxKind.EndOfFileToken: - return true; - default: - return previousTokenHasTrailingNewLine(nextToken); - } - } - else { - // If was a property name and not a keyword, then we're good to go. - return true; - } - } - - function isMemberVariableDeclaration(modifierCount: number, inErrorRecover: boolean): boolean { - return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); - } - - function parseMemberVariableDeclaration(): MemberVariableDeclarationSyntax { - return new syntaxFactory.MemberVariableDeclarationSyntax(parseNodeData, - parseModifiers(), - tryParseVariableDeclarator(/*allowIn:*/ true, /*allowPropertyName:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + function parseMemberVariableDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): MemberVariableDeclarationSyntax { + return new MemberVariableDeclarationSyntax(parseNodeData, + modifiers, + new VariableDeclaratorSyntax(parseNodeData, propertyName, + parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), + isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined), + eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function isIndexMemberDeclaration(modifierCount: number): boolean { @@ -1325,127 +1358,75 @@ module TypeScript.Parser { } function parseIndexMemberDeclaration(): IndexMemberDeclarationSyntax { - return new syntaxFactory.IndexMemberDeclarationSyntax(parseNodeData, + return new IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewLine:*/ false)); } - function tryAddUnexpectedEqualsGreaterThanToken(callSignature: CallSignatureSyntax): boolean { - var token0 = currentToken(); - - var hasEqualsGreaterThanToken = token0.kind() === SyntaxKind.EqualsGreaterThanToken; - if (hasEqualsGreaterThanToken) { - // We can only do this if the call signature actually contains a final token that we - // could add the => to. - var _lastToken = lastToken(callSignature); - if (_lastToken && _lastToken.fullWidth() > 0) { - // Previously the language allowed "function f() => expr;" as a shorthand for - // "function f() { return expr; }. - // - // Detect if the user is typing this and attempt recovery. - var diagnostic = new Diagnostic(fileName, source.text.lineMap(), - start(token0, source.text), width(token0), DiagnosticCode.Unexpected_token_0_expected, [SyntaxFacts.getText(SyntaxKind.OpenBraceToken)]); - addDiagnostic(diagnostic); - - consumeToken(token0); - - // Note: we only do this if we're creating a concrete syntax tree (which contains - // everything, including skipped tokens, in it). - if (syntaxFactory.isConcrete) { - addSkippedTokenAfterNode(callSignature, token0); - } - return true; - } - } - - - return false; - } - function isFunctionDeclaration(modifierCount: number): boolean { - return peekToken(modifierCount).kind() === SyntaxKind.FunctionKeyword; + return peekToken(modifierCount).kind === SyntaxKind.FunctionKeyword; } function parseFunctionDeclaration(): FunctionDeclarationSyntax { - var modifiers = parseModifiers(); - var functionKeyword = eatToken(SyntaxKind.FunctionKeyword); - var identifier = eatIdentifierToken(); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); + return parseFunctionDeclarationWorker( + parseModifiers(), eatToken(SyntaxKind.FunctionKeyword), tryEatToken(SyntaxKind.AsteriskToken)); + } - // If we got an errant => then we want to parse what's coming up without requiring an - // open brace. - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); + function parseFunctionDeclarationWorker(modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken): FunctionDeclarationSyntax { + // GeneratorDeclaration[Yield, Default] : + // function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + var isGenerator = asteriskToken !== undefined; + return new FunctionDeclarationSyntax(parseNodeData, + modifiers, + functionKeyword, + asteriskToken, + eatIdentifierToken(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ isGenerator, /*generatorParameterContext:*/ isGenerator), + isBlockOrArrow() + ? parseFunctionBlock(/*yieldContext:*/ isGenerator) + : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + } - var semicolonToken: ISyntaxToken = null; - var block: BlockSyntax = null; - - // Parse a block if we're on a bock, or if we saw a '=>' - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, /*checkForStrictMode:*/ true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); - } - - return new syntaxFactory.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); + function parseModuleName(): INameSyntax { + return currentToken().kind === SyntaxKind.StringLiteral + ? eatToken(SyntaxKind.StringLiteral) + : parseName(/*allowIdentifierNames*/ false); } function parseModuleDeclaration(): ModuleDeclarationSyntax { - var modifiers = parseModifiers(); - var moduleKeyword = eatToken(SyntaxKind.ModuleKeyword); - - var moduleName: INameSyntax = null; - var stringLiteral: ISyntaxToken = null; - - if (currentToken().kind() === SyntaxKind.StringLiteral) { - stringLiteral = eatToken(SyntaxKind.StringLiteral); - } - else { - moduleName = parseName(/*allowIdentifierNames*/ false); - } - - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - - var moduleElements = Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - moduleElements = parseSyntaxList(ListParsingState.ModuleDeclaration_ModuleElements, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.ModuleDeclarationSyntax(parseNodeData, - modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, eatToken(SyntaxKind.CloseBraceToken)); + var openBraceToken: ISyntaxToken; + return new ModuleDeclarationSyntax(parseNodeData, + parseModifiers(), + eatToken(SyntaxKind.ModuleKeyword), + parseModuleName(), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.ModuleDeclaration_ModuleElements) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function parseInterfaceDeclaration(): InterfaceDeclarationSyntax { - return new syntaxFactory.InterfaceDeclarationSyntax(parseNodeData, - parseModifiers(), eatToken(SyntaxKind.InterfaceKeyword), eatIdentifierToken(), - tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), parseHeritageClauses(), parseObjectType()); + return new InterfaceDeclarationSyntax(parseNodeData, + parseModifiers(), + eatToken(SyntaxKind.InterfaceKeyword), + eatIdentifierToken(), + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseHeritageClauses(/*isClassHeritageClauses:*/ false), + parseObjectType()); } function parseObjectType(): ObjectTypeSyntax { - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - - var typeMembers = Syntax.emptySeparatedList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - typeMembers = parseSeparatedSyntaxList(ListParsingState.ObjectType_TypeMembers, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(SyntaxKind.CloseBraceToken)); + var openBraceToken: ISyntaxToken; + + return new ObjectTypeSyntax(parseNodeData, + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.ObjectType_TypeMembers) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function parseTupleType(currentToken: ISyntaxToken): TupleTypeSyntax { - var openBracket = consumeToken(currentToken); - - var types = Syntax.emptySeparatedList(); - if (openBracket.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - types = parseSeparatedSyntaxList(ListParsingState.TupleType_Types, skippedTokens); - openBracket = addSkippedTokensAfterToken(openBracket, skippedTokens); - } - - return new syntaxFactory.TupleTypeSyntax(parseNodeData, openBracket, types, eatToken(SyntaxKind.CloseBracketToken)); + return new TupleTypeSyntax(parseNodeData, + consumeToken(currentToken), + parseSeparatedSyntaxList(ListParsingState.TupleType_Types), + eatToken(SyntaxKind.CloseBracketToken)); } function isTypeMember(inErrorRecovery: boolean): boolean { @@ -1456,99 +1437,10 @@ module TypeScript.Parser { return isCallSignature(/*tokenIndex:*/ 0) || isConstructSignature() || isIndexSignature(/*tokenIndex:*/ 0) || - isMethodSignature(inErrorRecovery) || - isPropertySignature(inErrorRecovery); + isMethodOrPropertySignature(inErrorRecovery); } - function tryParseTypeMember(inErrorRecovery: boolean): ITypeMemberSyntax { - var node = currentNode(); - if (SyntaxUtilities.isTypeMember(node)) { - consumeNode(node); - return node; - } - - if (isCallSignature(/*tokenIndex:*/ 0)) { - return parseCallSignature(/*requireCompleteTypeParameterList:*/ false); - } - else if (isConstructSignature()) { - return parseConstructSignature(); - } - else if (isIndexSignature(/*tokenIndex:*/ 0)) { - return parseIndexSignature(); - } - else if (isMethodSignature(inErrorRecovery)) { - // Note: it is important that isFunctionSignature is called before isPropertySignature. - // isPropertySignature checks for a subset of isFunctionSignature. - return parseMethodSignature(); - } - else if (isPropertySignature(inErrorRecovery)) { - return parsePropertySignature(); - } - else { - return null; - } - } - - function parseConstructSignature(): ConstructSignatureSyntax { - return new syntaxFactory.ConstructSignatureSyntax(parseNodeData, eatToken(SyntaxKind.NewKeyword), parseCallSignature(/*requireCompleteTypeParameterList:*/ false)); - } - - function parseIndexSignature(): IndexSignatureSyntax { - var openBracketToken = eatToken(SyntaxKind.OpenBracketToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var parameters = parseSeparatedSyntaxList(ListParsingState.IndexSignature_Parameters, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - - return new syntaxFactory.IndexSignatureSyntax(parseNodeData, - openBracketToken, parameters, eatToken(SyntaxKind.CloseBracketToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); - } - - function parseMethodSignature(): MethodSignatureSyntax { - return new syntaxFactory.MethodSignatureSyntax(parseNodeData, - eatPropertyName(), tryEatToken(SyntaxKind.QuestionToken), parseCallSignature(/*requireCompleteTypeParameterList:*/ false)); - } - - function parsePropertySignature(): PropertySignatureSyntax { - return new syntaxFactory.PropertySignatureSyntax(parseNodeData, - eatPropertyName(), tryEatToken(SyntaxKind.QuestionToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); - } - - function isCallSignature(peekIndex: number): boolean { - var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === SyntaxKind.OpenParenToken || tokenKind === SyntaxKind.LessThanToken; - } - - function isConstructSignature(): boolean { - if (currentToken().kind() !== SyntaxKind.NewKeyword) { - return false; - } - - return isCallSignature(/*peekIndex:*/1); - } - - function isIndexSignature(peekIndex: number): boolean { - return peekToken(peekIndex).kind() === SyntaxKind.OpenBracketToken; - } - - function isMethodSignature(inErrorRecovery: boolean): boolean { - if (isPropertyName(currentToken(), inErrorRecovery)) { - // id( - if (isCallSignature(1)) { - return true; - } - - // id?( - if (peekToken(1).kind() === SyntaxKind.QuestionToken && - isCallSignature(2)) { - return true; - } - } - - return false; - } - - function isPropertySignature(inErrorRecovery: boolean): boolean { + function isMethodOrPropertySignature(inErrorRecovery: boolean): boolean { var _currentToken = currentToken(); // Keywords can start properties. However, they're often intended to start something @@ -1564,8 +1456,9 @@ module TypeScript.Parser { // // Then we *should* parse it as a property name, as ASI takes effect here. if (isModifier(_currentToken, /*index:*/ 0)) { - if (!existsNewLineBetweenTokens(_currentToken, peekToken(1), source.text) && - isPropertyName(peekToken(1), inErrorRecovery)) { + var token1 = peekToken(1); + if (!existsNewLineBetweenTokens(_currentToken, token1, source.text) && + isPropertyNameToken(token1, inErrorRecovery)) { return false; } @@ -1573,16 +1466,123 @@ module TypeScript.Parser { // Note: property names also start function signatures. So it's important that we call this // after we calll isFunctionSignature. - return isPropertyName(_currentToken, inErrorRecovery); + return isPropertyName(/*peekIndex:*/ 0, inErrorRecovery); + } + + function tryParseTypeMember(inErrorRecovery: boolean): ITypeMemberSyntax { + var node = currentNode(); + if (SyntaxUtilities.isTypeMember(node)) { + consumeNode(node); + return node; + } + + if (isCallSignature(/*tokenIndex:*/ 0)) { + // A call signature for a type member can both use 'yield' as a parameter name, and + // does not have parameter initializers. So we can pass 'false' for both [Yield] + // and [GeneratorParameter]. + return parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false); + } + else if (isConstructSignature()) { + return parseConstructSignature(); + } + else if (isIndexSignature(/*tokenIndex:*/ 0)) { + return parseIndexSignature(); + } + else if (isMethodOrPropertySignature(inErrorRecovery)) { + var propertyName = parsePropertyName(); + var questionToken = tryEatToken(SyntaxKind.QuestionToken); + + if (isCallSignature(/*peekIndex:*/ 0)) { + return parseMethodSignature(propertyName, questionToken); + } + else { + return parsePropertySignature(propertyName, questionToken); + } + } + else { + return undefined; + } + } + + function parseConstructSignature(): ConstructSignatureSyntax { + // Construct signatures have no [Yield] or [GeneratorParameter] restrictions. + return new ConstructSignatureSyntax(parseNodeData, + eatToken(SyntaxKind.NewKeyword), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false)); + } + + function parseIndexSignature(): IndexSignatureSyntax { + return new IndexSignatureSyntax(parseNodeData, + eatToken(SyntaxKind.OpenBracketToken), + parseSeparatedSyntaxList(ListParsingState.IndexSignature_Parameters), + eatToken(SyntaxKind.CloseBracketToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + } + + function parseMethodSignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): MethodSignatureSyntax { + // Method signatues don't exist in expression contexts. So they have neither + // [Yield] nor [GeneratorParameter] + return new MethodSignatureSyntax(parseNodeData, + propertyName, + questionToken, + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false)); + } + + function parsePropertySignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): PropertySignatureSyntax { + return new PropertySignatureSyntax(parseNodeData, + propertyName, questionToken, parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + } + + function isCallSignature(peekIndex: number): boolean { + var tokenKind = peekToken(peekIndex).kind; + return tokenKind === SyntaxKind.OpenParenToken || tokenKind === SyntaxKind.LessThanToken; + } + + function isConstructSignature(): boolean { + if (currentToken().kind !== SyntaxKind.NewKeyword) { + return false; + } + + return isCallSignature(/*peekIndex:*/1); + } + + function isIndexSignature(peekIndex: number): boolean { + // In order to be considered an index signature, we need to see at least: + // + // [a: + // [... + // [a, + // [public a + // [] + // + // Otherwise, we will think that this is the start of a computed property name + // for a function or variable. + if (peekToken(peekIndex).kind === SyntaxKind.OpenBracketToken) { + var token1 = peekToken(peekIndex + 1); + if (token1.kind === SyntaxKind.DotDotDotToken || token1.kind === SyntaxKind.CloseBracketToken) { + return true; + } + if (isIdentifier(token1)) { + var token2 = peekToken(peekIndex + 2); + if (token2.kind === SyntaxKind.ColonToken || token2.kind === SyntaxKind.CommaToken) { + return true; + } + } + if (token1.kind === SyntaxKind.PublicKeyword || token1.kind === SyntaxKind.PrivateKeyword) { + var token2 = peekToken(peekIndex + 2); + return isIdentifier(token2); + } + } + + return false; } function isHeritageClause(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; return tokenKind === SyntaxKind.ExtendsKeyword || tokenKind === SyntaxKind.ImplementsKeyword; } function isNotHeritageClauseTypeName(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.ImplementsKeyword || tokenKind === SyntaxKind.ExtendsKeyword) { @@ -1604,26 +1604,20 @@ module TypeScript.Parser { function tryParseHeritageClause(): HeritageClauseSyntax { var extendsOrImplementsKeyword = currentToken(); - var tokenKind = extendsOrImplementsKeyword.kind(); + var tokenKind = extendsOrImplementsKeyword.kind; if (tokenKind !== SyntaxKind.ExtendsKeyword && tokenKind !== SyntaxKind.ImplementsKeyword) { - return null; + return undefined; } - consumeToken(extendsOrImplementsKeyword); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeNames = parseSeparatedSyntaxList(ListParsingState.HeritageClause_TypeNameList, skippedTokens); - extendsOrImplementsKeyword = addSkippedTokensAfterToken(extendsOrImplementsKeyword, skippedTokens); - - return new syntaxFactory.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); + return new HeritageClauseSyntax(parseNodeData, + consumeToken(extendsOrImplementsKeyword), + parseSeparatedSyntaxList(ListParsingState.HeritageClause_TypeNameList)); } - function isInterfaceEnumClassModuleImportOrExport(modifierCount: number): boolean { - var _currentToken = currentToken(); - + function isInterfaceEnumClassModuleImportOrExport(modifierCount: number, _currentToken?: ISyntaxToken): boolean { if (modifierCount) { // Any of these keywords following a modifier is definitely a TS construct. - switch (peekToken(modifierCount).kind()) { + switch (peekToken(modifierCount).kind) { case SyntaxKind.ImportKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.InterfaceKeyword: @@ -1633,6 +1627,8 @@ module TypeScript.Parser { } } + _currentToken = _currentToken || currentToken(); + // no modifiers. While certain of these keywords are javascript keywords as well, it // is possible to run into them in some circumstances in error recovery where we don't // want to consider them the start of the module element construct. For example, they @@ -1640,27 +1636,18 @@ module TypeScript.Parser { // make sure it really is the start of a module element. var nextToken = peekToken(1); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.ModuleKeyword: - if (isIdentifier(nextToken) || nextToken.kind() === SyntaxKind.StringLiteral) { - return true; - } - break; + return isIdentifier(nextToken) || nextToken.kind === SyntaxKind.StringLiteral; case SyntaxKind.ImportKeyword: case SyntaxKind.ClassKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.InterfaceKeyword: - if (isIdentifier(nextToken)) { - return true; - } - break; + return isIdentifier(nextToken); case SyntaxKind.ExportKeyword: - if (nextToken.kind() === SyntaxKind.EqualsToken) { - return true; - } - break; + return nextToken.kind === SyntaxKind.EqualsToken; } return false; @@ -1672,7 +1659,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { // ERROR RECOVERY case SyntaxKind.PublicKeyword: @@ -1713,7 +1700,7 @@ module TypeScript.Parser { // do not want to consume. This can happen when the user does not terminate their // existing block properly. We don't want to accidently consume these as expression // below. - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { return false; } @@ -1737,7 +1724,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; return tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount(), inErrorRecovery); } @@ -1754,14 +1741,14 @@ module TypeScript.Parser { // and we should not parse it out here. if (SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { // Definitely not a statement. - return null; + return undefined; } else { break; } case SyntaxKind.IfKeyword: return parseIfStatement(_currentToken); - case SyntaxKind.OpenBraceToken: return parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + case SyntaxKind.OpenBraceToken: return parseStatementBlock(); case SyntaxKind.ReturnKeyword: return parseReturnStatement(_currentToken); case SyntaxKind.SwitchKeyword: return parseSwitchStatement(_currentToken); case SyntaxKind.ThrowKeyword: return parseThrowStatement(_currentToken); @@ -1779,8 +1766,8 @@ module TypeScript.Parser { // do not want to consume. This can happen when the user does not terminate their // existing block properly. We don't want to accidently consume these as expression // below. - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return null; + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { + return undefined; } else if (isVariableStatement(modifierCount)) { return parseVariableStatement(); @@ -1798,30 +1785,33 @@ module TypeScript.Parser { return parseExpressionStatement(); } else { - return null; + return undefined; } } function parseDebuggerStatement(debuggerKeyword: ISyntaxToken): DebuggerStatementSyntax { - return new syntaxFactory.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + return new DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseDoStatement(doKeyword: ISyntaxToken): DoStatementSyntax { + // IterationStatement[Yield, Return] : + // do Statement[?Yield, ?Return]while (Expression[In, ?Yield]); opt + // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby // do;while(0)x will have a semicolon inserted before x. - return new syntaxFactory.DoStatementSyntax(parseNodeData, + return new DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(/*inErrorRecovery:*/ false), eatToken(SyntaxKind.WhileKeyword), eatToken(SyntaxKind.OpenParenToken), - parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ true)); + allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ true)); } function isLabeledStatement(currentToken: ISyntaxToken): boolean { - return isIdentifier(currentToken) && peekToken(1).kind() === SyntaxKind.ColonToken; + return isIdentifier(currentToken) && peekToken(1).kind === SyntaxKind.ColonToken; } function parseLabeledStatement(identifierToken: ISyntaxToken): LabeledStatementSyntax { - return new syntaxFactory.LabeledStatementSyntax(parseNodeData, + return new LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(SyntaxKind.ColonToken), parseStatement(/*inErrorRecovery:*/ false)); } @@ -1830,52 +1820,67 @@ module TypeScript.Parser { var savedListParsingState = listParsingState; listParsingState |= (1 << ListParsingState.TryBlock_Statements); - var block = parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + var block = parseStatementBlock(); listParsingState = savedListParsingState; - var catchClause: CatchClauseSyntax = null; - if (currentToken().kind() === SyntaxKind.CatchKeyword) { + var catchClause: CatchClauseSyntax = undefined; + if (currentToken().kind === SyntaxKind.CatchKeyword) { catchClause = parseCatchClause(); } // If we don't have a catch clause, then we must have a finally clause. Try to parse // one out no matter what. - var finallyClause: FinallyClauseSyntax = null; - if (catchClause === null || currentToken().kind() === SyntaxKind.FinallyKeyword) { + var finallyClause: FinallyClauseSyntax = undefined; + if (!catchClause || currentToken().kind === SyntaxKind.FinallyKeyword) { finallyClause = parseFinallyClause(); } - return new syntaxFactory.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); + return new TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); } function parseCatchClauseBlock(): BlockSyntax { var savedListParsingState = listParsingState; listParsingState |= (1 << ListParsingState.CatchBlock_Statements); - var block = parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + var block = parseStatementBlock(); listParsingState = savedListParsingState; return block; } function parseCatchClause(): CatchClauseSyntax { - return new syntaxFactory.CatchClauseSyntax(parseNodeData, + return new CatchClauseSyntax(parseNodeData, eatToken(SyntaxKind.CatchKeyword), eatToken(SyntaxKind.OpenParenToken), eatIdentifierToken(), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), eatToken(SyntaxKind.CloseParenToken), parseCatchClauseBlock()); } function parseFinallyClause(): FinallyClauseSyntax { - return new syntaxFactory.FinallyClauseSyntax(parseNodeData, - eatToken(SyntaxKind.FinallyKeyword), parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false)); + return new FinallyClauseSyntax(parseNodeData, + eatToken(SyntaxKind.FinallyKeyword), + parseStatementBlock()); } function parseWithStatement(withKeyword: ISyntaxToken): WithStatementSyntax { - return new syntaxFactory.WithStatementSyntax(parseNodeData, - consumeToken(withKeyword), eatToken(SyntaxKind.OpenParenToken), parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); + // WithStatement[Yield, Return] : + // with (Expression[In, ?Yield]) Statement[?Yield, ?Return] + + return new WithStatementSyntax(parseNodeData, + consumeToken(withKeyword), + eatToken(SyntaxKind.OpenParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken), + parseStatement(/*inErrorRecovery:*/ false)); } function parseWhileStatement(whileKeyword: ISyntaxToken): WhileStatementSyntax { - return new syntaxFactory.WhileStatementSyntax(parseNodeData, - consumeToken(whileKeyword), eatToken(SyntaxKind.OpenParenToken), parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); + // IterationStatement[Yield, Return] : + // while (Expression[In, ?Yield]) Statement[?Yield, ?Return] + + return new WhileStatementSyntax(parseNodeData, + consumeToken(whileKeyword), + eatToken(SyntaxKind.OpenParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken), + parseStatement(/*inErrorRecovery:*/ false)); } function isEmptyStatement(currentToken: ISyntaxToken, inErrorRecovery: boolean): boolean { @@ -1889,151 +1894,134 @@ module TypeScript.Parser { return false; } - return currentToken.kind() === SyntaxKind.SemicolonToken; + return currentToken.kind === SyntaxKind.SemicolonToken; } function parseEmptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax { - return new syntaxFactory.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); + return new EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); } function parseForOrForInStatement(forKeyword: ISyntaxToken): IStatementSyntax { // Debug.assert(isForOrForInStatement()); - consumeToken(forKeyword); + forKeyword = consumeToken(forKeyword); var openParenToken = eatToken(SyntaxKind.OpenParenToken); var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === SyntaxKind.VarKeyword) { - // for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement - // for ( var VariableDeclarationNoIn in Expression ) Statement - return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } - else if (tokenKind === SyntaxKind.SemicolonToken) { - // for ( ; Expressionopt ; Expressionopt ) Statement - return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); + var tokenKind = _currentToken.kind; + + // If we see 'for ( ;' then there is no initializer, and this must be a 'for' statement. + // If we don't see a semicolon, then parse our a variable declaration or an initializer + // expression. Both could be hte start of a 'for' or 'for-in' statement. So, after that + // check to see if we have an 'in' keyword to make the final determination as to what we + // have. + + // When trying to parse either a variable declaration or an expression do not allow 'in' + // to be parsed, as that will actually be consumed by the 'for in' statement production + // instead. Also, we allow any expression here (even though the grammar only allows for + // LeftHandSideExpression). We will make sure we actually have a LHS expression in the + // grammar walker. + var initializer = tokenKind === SyntaxKind.SemicolonToken + ? undefined + : tokenKind === SyntaxKind.VarKeyword + ? disallowInAnd(parseVariableDeclaration) + : disallowInAnd(parseExpression) + + // In order to be a 'for-in' statement, we had to have an initializer of some sort, and + // we had to actually get an 'in' keyword. + if (initializer !== undefined && currentToken().kind === SyntaxKind.InKeyword) { + // for ([lookahead not-in {let [ }] LeftHandSideExpression[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] + // for ( var ForBinding[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] + // for ( ForDeclaration[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] + + return new ForInStatementSyntax(parseNodeData, + forKeyword, openParenToken, initializer, eatToken(SyntaxKind.InKeyword), + allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); } else { - // for ( ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement - // for ( LeftHandSideExpression in Expression ) Statement - return parseForOrForInStatementWithInitializer(forKeyword, openParenToken); + // NOTE: From the es5 section on Automatic Semicolon Insertion. + // a semicolon is never inserted automatically if the semicolon would then ... become + // one of the two semicolons in the header of a for statement + + // for (ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement + // for (var VariableDeclarationListNoIn; Expressionopt; Expressionopt) Statement + return new ForStatementSyntax(parseNodeData, + forKeyword, openParenToken, initializer, + eatToken(SyntaxKind.SemicolonToken), tryParseForStatementCondition(), + eatToken(SyntaxKind.SemicolonToken), tryParseForStatementIncrementor(), + eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); } } - function parseForOrForInStatementWithVariableDeclaration(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): IStatementSyntax { - // Debug.assert(forKeyword.kind === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - // Debug.assert(currentToken().kind() === SyntaxKind.VarKeyword); - - // for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement - // for ( var VariableDeclarationNoIn in Expression ) Statement - - var variableDeclaration = parseVariableDeclaration(/*allowIn:*/ false); - return currentToken().kind() === SyntaxKind.InKeyword - ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null) - : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - } - - function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax): ForInStatementSyntax { - // for ( var VariableDeclarationNoIn in Expression ) Statement - - return new syntaxFactory.ForInStatementSyntax(parseNodeData, - forKeyword, openParenToken, variableDeclaration, initializer, eatToken(SyntaxKind.InKeyword), - parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); - } - - function parseForOrForInStatementWithInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): IStatementSyntax { - // Debug.assert(forKeyword.kind() === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - - // for ( ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement - // for ( LeftHandSideExpression in Expression ) Statement - - var initializer = parseExpression(/*allowIn:*/ false); - return currentToken().kind() === SyntaxKind.InKeyword - ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer) - : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } - - function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): ForStatementSyntax { - // Debug.assert(forKeyword.kind() === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - // Debug.assert(currentToken().kind() === SyntaxKind.SemicolonToken); - // for ( ; Expressionopt ; Expressionopt ) Statement - - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, /*variableDeclaration:*/ null, /*initializer:*/ null); - } - function tryParseForStatementCondition(): IExpressionSyntax { - var tokenKind = currentToken().kind(); + // for ( Expression[?Yield]opt ; Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) + + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.SemicolonToken && tokenKind !== SyntaxKind.CloseParenToken && tokenKind !== SyntaxKind.EndOfFileToken) { - return parseExpression(/*allowIn:*/ true); + return allowInAnd(parseExpression); } - return null; + return undefined; } function tryParseForStatementIncrementor(): IExpressionSyntax { - var tokenKind = currentToken().kind(); + // for ( Expression[?Yield]opt ; Expression[In, ?Yield]opt ; Expression[In, ?Yield]opt ) + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.CloseParenToken && tokenKind !== SyntaxKind.EndOfFileToken) { - return parseExpression(/*allowIn:*/ true); + return allowInAnd(parseExpression); } - return null; - } - - function parseForStatementWithVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax): ForStatementSyntax { - // NOTE: From the es5 section on Automatic Semicolon Insertion. - // a semicolon is never inserted automatically if the semicolon would then ... become - // one of the two semicolons in the header of a for statement - - return new syntaxFactory.ForStatementSyntax(parseNodeData, - forKeyword, openParenToken, variableDeclaration, initializer, - eatToken(SyntaxKind.SemicolonToken), tryParseForStatementCondition(), - eatToken(SyntaxKind.SemicolonToken), tryParseForStatementIncrementor(), - eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); + return undefined; } function tryEatBreakOrContinueLabel(): ISyntaxToken { // If there is no newline after the break keyword, then we can consume an optional // identifier. - var identifier: ISyntaxToken = null; + var identifier: ISyntaxToken = undefined; if (!canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)) { if (isIdentifier(currentToken())) { return eatIdentifierToken(); } } - return null; + return undefined; } function parseBreakStatement(breakKeyword: ISyntaxToken): BreakStatementSyntax { - return new syntaxFactory.BreakStatementSyntax(parseNodeData, + return new BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseContinueStatement(continueKeyword: ISyntaxToken): ContinueStatementSyntax { - return new syntaxFactory.ContinueStatementSyntax(parseNodeData, + return new ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } + function parseSwitchExpression(openParenToken: ISyntaxToken) { + // SwitchStatement[Yield, Return] : + // switch (Expression[In, ?Yield] ) CaseBlock[?Yield, ?Return] + + return openParenToken.fullWidth() === 0 && currentToken().kind === SyntaxKind.OpenBraceToken + ? eatIdentifierToken() + : allowInAnd(parseExpression); + } + function parseSwitchStatement(switchKeyword: ISyntaxToken) { // Debug.assert(isSwitchStatement()); + var openParenToken: ISyntaxToken; + var openBraceToken: ISyntaxToken; - consumeToken(switchKeyword); - var openParenToken = eatToken(SyntaxKind.OpenParenToken); - var expression = parseExpression(/*allowIn:*/ true); - var closeParenToken = eatToken(SyntaxKind.CloseParenToken); - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - - var switchClauses = Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - switchClauses = parseSyntaxList(ListParsingState.SwitchStatement_SwitchClauses, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - - return new syntaxFactory.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, eatToken(SyntaxKind.CloseBraceToken)); + return new SwitchStatementSyntax(parseNodeData, + consumeToken(switchKeyword), + openParenToken = eatToken(SyntaxKind.OpenParenToken), + parseSwitchExpression(openParenToken), + eatToken(SyntaxKind.CloseParenToken), + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.SwitchStatement_SwitchClauses) : [], + eatToken(SyntaxKind.CloseBraceToken)); } function isSwitchClause(): boolean { @@ -2041,7 +2029,7 @@ module TypeScript.Parser { return true; } - var currentTokenKind = currentToken().kind(); + var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.CaseKeyword || currentTokenKind === SyntaxKind.DefaultKeyword; } @@ -2054,7 +2042,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var kind = _currentToken.kind(); + var kind = _currentToken.kind; if (kind === SyntaxKind.CaseKeyword) { return parseCaseSwitchClause(_currentToken); } @@ -2062,98 +2050,95 @@ module TypeScript.Parser { return parseDefaultSwitchClause(_currentToken); } else { - return null; + return undefined; } } function parseCaseSwitchClause(caseKeyword: ISyntaxToken): CaseSwitchClauseSyntax { // Debug.assert(isCaseSwitchClause()); + // CaseClause[Yield, Return] : + // case Expression[In, ?Yield] : StatementList[?Yield, ?Return]opt - consumeToken(caseKeyword); - var expression = parseExpression(/*allowIn:*/ true); - var colonToken = eatToken(SyntaxKind.ColonToken); - var statements = Syntax.emptyList(); - - // TODO: allow parsing of the list evne if there's no colon. However, we have to make - // sure we add any skipped tokens to the right previous node or token. - if (colonToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - statements = parseSyntaxList(ListParsingState.SwitchClause_Statements, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - - return new syntaxFactory.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements); + return new CaseSwitchClauseSyntax(parseNodeData, + consumeToken(caseKeyword), + allowInAnd(parseExpression), + eatToken(SyntaxKind.ColonToken), + parseSyntaxList(ListParsingState.SwitchClause_Statements)); } function parseDefaultSwitchClause(defaultKeyword: ISyntaxToken): DefaultSwitchClauseSyntax { // Debug.assert(isDefaultSwitchClause()); - consumeToken(defaultKeyword); - var colonToken = eatToken(SyntaxKind.ColonToken); - var statements = Syntax.emptyList(); - - // TODO: Allow parsing without a colon here. However, ensure that we attach any skipped - // tokens to the defaultKeyword. - if (colonToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - statements = parseSyntaxList(ListParsingState.SwitchClause_Statements, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - - return new syntaxFactory.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements); + return new DefaultSwitchClauseSyntax(parseNodeData, + consumeToken(defaultKeyword), + eatToken(SyntaxKind.ColonToken), + parseSyntaxList(ListParsingState.SwitchClause_Statements)); } function parseThrowStatementExpression(): IExpressionSyntax { + // ThrowStatement[Yield] : + // throw [no LineTerminator here]Expression[In, ?Yield]; + // Because of automatic semicolon insertion, we need to report error if this // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' // directly as that might consume an expression on the following line. return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) - ? createMissingToken(SyntaxKind.IdentifierName, null) - : parseExpression(/*allowIn:*/ true); + ? createMissingToken(SyntaxKind.IdentifierName, undefined) + : allowInAnd(parseExpression); } function parseThrowStatement(throwKeyword: ISyntaxToken): ThrowStatementSyntax { - return new syntaxFactory.ThrowStatementSyntax(parseNodeData, + return new ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function tryParseReturnStatementExpression(): IExpressionSyntax { - return !canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? parseExpression(/*allowIn:*/ true) : null; + // ReturnStatement[Yield] : + // return [no LineTerminator here]Expression[In, ?Yield]; + + return !canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? allowInAnd(parseExpression) : undefined; } function parseReturnStatement(returnKeyword: ISyntaxToken): ReturnStatementSyntax { - return new syntaxFactory.ReturnStatementSyntax(parseNodeData, + return new ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function isExpressionStatement(currentToken: ISyntaxToken): boolean { // As per the gramar, neither { nor 'function' can start an expression statement. - var tokenKind = currentToken.kind(); + var tokenKind = currentToken.kind; return tokenKind !== SyntaxKind.OpenBraceToken && tokenKind !== SyntaxKind.FunctionKeyword && isExpression(currentToken); } function isAssignmentOrOmittedExpression(): boolean { var _currentToken = currentToken(); - return _currentToken.kind() === SyntaxKind.CommaToken || isExpression(_currentToken); + return _currentToken.kind === SyntaxKind.CommaToken || isExpression(_currentToken); } function tryParseAssignmentOrOmittedExpression(): IExpressionSyntax { // Debug.assert(isAssignmentOrOmittedExpression()); - if (currentToken().kind() === SyntaxKind.CommaToken) { - return new syntaxFactory.OmittedExpressionSyntax(parseNodeData); + // ElementList[Yield] : + // Elisionopt AssignmentExpression[In, ?Yield] + + if (currentToken().kind === SyntaxKind.CommaToken) { + return new OmittedExpressionSyntax(parseNodeData); } - return tryParseAssignmentExpressionOrHigher(/*force:*/ false, /*allowIn:*/ true); + return allowInAnd(tryParseAssignmentExpressionOrHigher); } function isExpression(currentToken: ISyntaxToken): boolean { - switch (currentToken.kind()) { + switch (currentToken.kind) { // Literals case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: case SyntaxKind.RegularExpressionLiteral: + // Templates + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + // For array literals. case SyntaxKind.OpenBracketToken: @@ -2209,58 +2194,70 @@ module TypeScript.Parser { // For function expressions. case SyntaxKind.FunctionKeyword: return true; + + case SyntaxKind.YieldKeyword: + // Yield always starts an expression. Either it is an identifier (in which case + // it is definitely an expression). Or it's a keyword (either because we're in + // a generator, or in strict mode (or both)) and it started a yield expression. + return true; } return isIdentifier(currentToken); } function parseExpressionStatement(): ExpressionStatementSyntax { - return new syntaxFactory.ExpressionStatementSyntax(parseNodeData, parseExpression(/*allowIn:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + // ExpressionStatement[Yield] : + // [lookahead not-in {{, function, class, let [ }] Expression[In, ?Yield]; + + return new ExpressionStatementSyntax(parseNodeData, + allowInAnd(parseExpression), + eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseIfStatement(ifKeyword: ISyntaxToken): IfStatementSyntax { - return new syntaxFactory.IfStatementSyntax(parseNodeData, - consumeToken(ifKeyword), eatToken(SyntaxKind.OpenParenToken), parseExpression(/*allowIn:*/ true), - eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false), parseOptionalElseClause()); + // IfStatement[Yield, Return] : + // if (Expression[In, ?Yield]) Statement[?Yield, ?Return] else Statement[?Yield, ?Return] + // if (Expression[In, ?Yield]) Statement[?Yield, ?Return] + + return new IfStatementSyntax(parseNodeData, + consumeToken(ifKeyword), + eatToken(SyntaxKind.OpenParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken), + parseStatement(/*inErrorRecovery:*/ false), parseOptionalElseClause()); } function parseOptionalElseClause(): ElseClauseSyntax { - return currentToken().kind() === SyntaxKind.ElseKeyword ? parseElseClause() : null; + return currentToken().kind === SyntaxKind.ElseKeyword ? parseElseClause() : undefined; } function parseElseClause(): ElseClauseSyntax { - return new syntaxFactory.ElseClauseSyntax(parseNodeData, eatToken(SyntaxKind.ElseKeyword), parseStatement(/*inErrorRecovery:*/ false)); + return new ElseClauseSyntax(parseNodeData, eatToken(SyntaxKind.ElseKeyword), parseStatement(/*inErrorRecovery:*/ false)); } function isVariableStatement(modifierCount: number): boolean { - return peekToken(modifierCount).kind() === SyntaxKind.VarKeyword; + return peekToken(modifierCount).kind === SyntaxKind.VarKeyword; } function parseVariableStatement(): VariableStatementSyntax { - return new syntaxFactory.VariableStatementSyntax(parseNodeData, - parseModifiers(), parseVariableDeclaration(/*allowIn:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + // VariableStatement[Yield] : + // var VariableDeclarationList[In, ?Yield]; + + return new VariableStatementSyntax(parseNodeData, + parseModifiers(), allowInAnd(parseVariableDeclaration), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } - function parseVariableDeclaration(allowIn: boolean): VariableDeclarationSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.VarKeyword); + function parseVariableDeclaration(): VariableDeclarationSyntax { + // Debug.assert(currentToken().kind === SyntaxKind.VarKeyword); - var varKeyword = eatToken(SyntaxKind.VarKeyword); - // Debug.assert(varKeyword.fullWidth() > 0); - - var listParsingState = allowIn - ? ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn - : ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn; - - var skippedTokens: ISyntaxToken[] = getArray(); - var variableDeclarators = parseSeparatedSyntaxList(listParsingState, skippedTokens); - varKeyword = addSkippedTokensAfterToken(varKeyword, skippedTokens); - - return new syntaxFactory.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); + return new VariableDeclarationSyntax(parseNodeData, + eatToken(SyntaxKind.VarKeyword), + parseSeparatedSyntaxList(ListParsingState.VariableDeclaration_VariableDeclarators)); } function isVariableDeclarator(): boolean { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.VariableDeclarator) { + if (node && node.kind === SyntaxKind.VariableDeclarator) { return true; } @@ -2268,7 +2265,7 @@ module TypeScript.Parser { } function canReuseVariableDeclaratorNode(node: ISyntaxNode) { - if (node === null || node.kind() !== SyntaxKind.VariableDeclarator) { + if (!node || node.kind !== SyntaxKind.VariableDeclarator) { return false; } @@ -2287,56 +2284,46 @@ module TypeScript.Parser { // In order to prevent this, we do not allow a variable declarator to be reused if it // has an initializer. var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; + return variableDeclarator.equalsValueClause === undefined; } - function tryParseVariableDeclarator(allowIn: boolean, allowPropertyName: boolean): VariableDeclaratorSyntax { - // TODO(cyrusn): What if the 'allowIn' context has changed between when we last parsed - // and now? We could end up with an incorrect tree. For example, say we had in the old - // tree "var i = a in b". Then, in the new tree the declarator portion moved into: - // "for (var i = a in b". We would not want to reuse the declarator as the "in b" portion - // would need to be consumed by the for declaration instead. Need to see if it is possible - // to hit this case. + function tryParseVariableDeclarator(): VariableDeclaratorSyntax { var node = currentNode(); if (canReuseVariableDeclaratorNode(node)) { consumeNode(node); return node; } - if (allowPropertyName) { - // Debug.assert(isPropertyName(currentToken(), /*inErrorRecovery:*/ false)); + if (!isIdentifier(currentToken())) { + return undefined; } - if (!allowPropertyName && !isIdentifier(currentToken())) { - return null; - } + var propertyName = eatIdentifierToken(); + var equalsValueClause: EqualsValueClauseSyntax = undefined; + var typeAnnotation: TypeAnnotationSyntax = undefined; - var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause: EqualsValueClauseSyntax = null; - var typeAnnotation: TypeAnnotationSyntax = null; - - if (propertyName.fullWidth() > 0) { + if (fullWidth(propertyName) > 0) { typeAnnotation = parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false); if (isEqualsValueClause(/*inParameter*/ false)) { - equalsValueClause = parseEqualsValueClause(allowIn); + equalsValueClause = parseEqualsValueClause(); } } - return new syntaxFactory.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); + return new VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); } function isEqualsValueClause(inParameter: boolean): boolean { var token0 = currentToken(); - if (token0.kind() === SyntaxKind.EqualsToken) { + if (token0.kind === SyntaxKind.EqualsToken) { return true; } // It's not uncommon during typing for the user to miss writing the '=' token. Check if // there is no newline after the last token and if we're on an expression. If so, parse // this as an equals-value clause with a missing equals. - if (!previousTokenHasTrailingNewLine(token0)) { - var tokenKind = token0.kind(); + if (!isOnDifferentLineThanPreviousToken(token0)) { + var tokenKind = token0.kind; // The 'isExpression' call below returns true for "=>". That's because it smartly // assumes that there is just a missing identifier and the user wanted a lambda. @@ -2363,52 +2350,57 @@ module TypeScript.Parser { return false; } - function parseEqualsValueClause(allowIn: boolean): EqualsValueClauseSyntax { - return new syntaxFactory.EqualsValueClauseSyntax(parseNodeData, - eatToken(SyntaxKind.EqualsToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + function parseEqualsValueClause(): EqualsValueClauseSyntax { + // Initializer[In, Yield] : + // = AssignmentExpression[?In, ?Yield] + + return new EqualsValueClauseSyntax(parseNodeData, + eatToken(SyntaxKind.EqualsToken), + parseAssignmentExpressionOrHigher()); } - function parseExpression(allowIn: boolean): IExpressionSyntax { + function parseExpression(): IExpressionSyntax { // Expression[in]: // AssignmentExpression[in] // Expression[in] , AssignmentExpression[in] - var leftOperand = tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn); + var leftOperand = parseAssignmentExpressionOrHigher(); while (true) { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.CommaToken) { + if (_currentToken.kind !== SyntaxKind.CommaToken) { break; } - leftOperand = new syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), - tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + leftOperand = new BinaryExpressionSyntax(parseNodeData, + leftOperand, + consumeToken(_currentToken), + parseAssignmentExpressionOrHigher()); } return leftOperand; } + function tryParseAssignmentExpressionOrHigher(): IExpressionSyntax { + return tryParseAssignmentExpressionOrHigherWorker(/*force:*/ false); + } + + function parseAssignmentExpressionOrHigher(): IExpressionSyntax { + return tryParseAssignmentExpressionOrHigherWorker(/*force:*/ true); + } + // Called when you need to parse an expression, but you do not want to allow 'CommaExpressions'. // i.e. if you have "var a = 1, b = 2" then when we parse '1' we want to parse with higher // precedence than 'comma'. Otherwise we'll get: "var a = (1, (b = 2))", instead of // "var a = (1), b = (2)"); - function tryParseAssignmentExpressionOrHigher(force: boolean, allowIn: boolean): IExpressionSyntax { + function tryParseAssignmentExpressionOrHigherWorker(force: boolean): IExpressionSyntax { // Augmented by TypeScript: // - // AssignmentExpression[in]: - // 1) ConditionalExpression[in] - // 2) LeftHandSideExpression = AssignmentExpression[in] - // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[in] - // 4) ArrowFunctionExpression <-- added by TypeScript - // - // Open spec question. Right now, there is no 'ArrowFunctionExpression[in]' variant. - // Thus, if the user has: - // - // for (var a = () => b in c) {} - // - // Then we will fail to parse (because the 'in' will be consumed as part of the body of - // the lambda, and not as part of the 'for' statement). This is likely not an issue - // whatsoever as there seems to be no good reason why anyone would ever write code like - // the above. + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] // // Note: for ease of implementation we treat productions '2' and '3' as the same thing. // (i.e. they're both BinaryExpressions with an assignment operator in it). @@ -2418,8 +2410,12 @@ module TypeScript.Parser { // LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. var _currentToken = currentToken(); + if (isYieldExpression(_currentToken)) { + return parseYieldExpression(_currentToken); + } + var arrowFunction = tryParseAnyArrowFunctionExpression(_currentToken); - if (arrowFunction !== null) { + if (arrowFunction) { return arrowFunction; } @@ -2432,9 +2428,9 @@ module TypeScript.Parser { // Otherwise, we try to parse out the conditional expression bit. We want to allow any // binary expression here, so we pass in the 'lowest' precedence here so that it matches // and consumes anything. - var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, BinaryExpressionPrecedence.Lowest, allowIn); - if (leftOperand === null) { - return null; + var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, BinaryExpressionPrecedence.Lowest); + if (leftOperand === undefined) { + return undefined; } if (SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { @@ -2443,14 +2439,74 @@ module TypeScript.Parser { var operatorToken = currentOperatorToken(); // Check for recursive assignment expressions. - if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), - tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind)) { + return new BinaryExpressionSyntax(parseNodeData, + leftOperand, + consumeToken(operatorToken), + parseAssignmentExpressionOrHigher()); } } // It wasn't an assignment or a lambda. This is a conditional expression: - return parseConditionalExpressionRest(allowIn, leftOperand); + return parseConditionalExpressionRest(leftOperand); + } + + function isYieldExpression(_currentToken: ISyntaxToken): boolean { + if (_currentToken.kind === SyntaxKind.YieldKeyword) { + // If we have a 'yield' keyword, and htis is a context where yield expressions are + // allowed, then definitely parse out a yield expression. + if (yieldContext) { + return true; + } + + if (strictModeContext) { + // If we're in strict mode, then 'yield' is a keyword, could only ever start + // a yield expression. + return true; + } + + // We're in a context where 'yield expr' is not allowed. However, if we can + // definitely tell that the user was trying to parse a 'yield expr' and not + // just a normal expr that start with a 'yield' identifier, then parse out + // a 'yield expr'. We can then report an error later that they are only + // allowed in generator expressions. + // + // for example, if we see 'yield(foo)', then we'll have to treat that as an + // invocation expression of something called 'yield'. However, if we have + // 'yield foo' then that is not legal as a normal expression, so we can + // definitely recognize this as a yield expression. + // + // for now we just check if the next token is an identifier. More heuristics + // can be added here later as necessary. We just need to make sure that we + // don't accidently consume something legal. + var token1 = peekToken(1); + if (!isOnDifferentLineThanPreviousToken(token1) && isIdentifier(token1)) { + return true; + } + } + + return false; + } + + function parseYieldExpression(yieldKeyword: ISyntaxToken): YieldExpressionSyntax { + // YieldExpression[In] : + // yield + // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + + yieldKeyword = consumeToken(yieldKeyword); + var _currentToken = currentToken(); + + if (!isOnDifferentLineThanPreviousToken(_currentToken) && + (_currentToken.kind === SyntaxKind.AsteriskToken || isExpression(_currentToken))) { + + return new YieldExpressionSyntax(parseNodeData, yieldKeyword, tryEatToken(SyntaxKind.AsteriskToken), parseAssignmentExpressionOrHigher()); + } + else { + // if the next token is not on the same line as yield. or we don't have an '*' or + // the start of an expressin, then this is just a simple "yield" expression. + return new YieldExpressionSyntax(parseNodeData, yieldKeyword, /*asterixToken:*/ undefined, /*expression;*/ undefined); + } } function tryParseAnyArrowFunctionExpression(_currentToken: ISyntaxToken): IExpressionSyntax { @@ -2460,7 +2516,7 @@ module TypeScript.Parser { } function tryParseUnaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IUnaryExpressionSyntax { - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.PlusToken: @@ -2469,7 +2525,7 @@ module TypeScript.Parser { case SyntaxKind.ExclamationToken: case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: - return new syntaxFactory.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); case SyntaxKind.TypeOfKeyword: return parseTypeOfExpression(_currentToken); case SyntaxKind.VoidKeyword: return parseVoidExpression(_currentToken); case SyntaxKind.DeleteKeyword: return parseDeleteExpression(_currentToken); @@ -2479,7 +2535,7 @@ module TypeScript.Parser { } } - function tryParseBinaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean, precedence: BinaryExpressionPrecedence, allowIn: boolean): IExpressionSyntax { + function tryParseBinaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean, precedence: BinaryExpressionPrecedence): IExpressionSyntax { // The binary expressions are incredibly left recursive in their definitions. We // clearly can't implement that through recursion. So, instead, we first bottom out // of all the recursion by jumping to this production and consuming a UnaryExpression @@ -2488,39 +2544,42 @@ module TypeScript.Parser { // MultiplicativeExpression: See 11.5 // UnaryExpression var leftOperand = tryParseUnaryExpressionOrHigher(_currentToken, force); - if (leftOperand === null) { - return null; + if (leftOperand === undefined) { + return undefined; } // We then pop up the stack consuming the other side of the binary exprssion if it exists. - return parseBinaryExpressionRest(precedence, allowIn, leftOperand); + return parseBinaryExpressionRest(precedence, leftOperand); } - function parseConditionalExpressionRest(allowIn: boolean, leftOperand: IExpressionSyntax): IExpressionSyntax { + function parseConditionalExpressionRest(leftOperand: IExpressionSyntax): IExpressionSyntax { // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher. var _currentToken = currentToken(); // Now check for conditional expression. - if (_currentToken.kind() !== SyntaxKind.QuestionToken) { + if (_currentToken.kind !== SyntaxKind.QuestionToken) { return leftOperand; } - // Note: we explicitly do *not* pass 'allowIn' to the whenTrue part. An 'in' expression is always - // allowed in the 'true' part of a conditional expression. + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. - return new syntaxFactory.ConditionalExpressionSyntax(parseNodeData, - leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true), - eatToken(SyntaxKind.ColonToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); + return new ConditionalExpressionSyntax(parseNodeData, + leftOperand, + consumeToken(_currentToken), + allowInAnd(parseAssignmentExpressionOrHigher), + eatToken(SyntaxKind.ColonToken), + parseAssignmentExpressionOrHigher()); } - function parseBinaryExpressionRest(precedence: BinaryExpressionPrecedence, allowIn: boolean, leftOperand: IExpressionSyntax): IExpressionSyntax { + function parseBinaryExpressionRest(precedence: BinaryExpressionPrecedence, leftOperand: IExpressionSyntax): IExpressionSyntax { while (true) { // We either have a binary operator here, or we're finished. We call // currentOperatorToken versus currentToken here so that we merge token sequences // like > and = into >= var operatorToken = currentOperatorToken(); - var tokenKind = operatorToken.kind(); + var tokenKind = operatorToken.kind; // Only proceed if we see binary expression token. However we don't parse // assignment expressions or comma expressions here. Those are taken care of @@ -2533,7 +2592,7 @@ module TypeScript.Parser { } // also, if it's the 'in' operator, only allow if our caller allows it. - if (tokenKind === SyntaxKind.InKeyword && !allowIn) { + if (tokenKind === SyntaxKind.InKeyword && disallowInContext) { break; } @@ -2550,8 +2609,8 @@ module TypeScript.Parser { // Precedence is okay, so we'll "take" this operator. // Now skip the operator token we're on. - leftOperand = new syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), - tryParseBinaryExpressionOrHigher(currentToken(), /*force:*/ true, newPrecedence, allowIn)); + leftOperand = new BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), + tryParseBinaryExpressionOrHigher(currentToken(), /*force:*/ true, newPrecedence)); } return leftOperand; @@ -2562,7 +2621,7 @@ module TypeScript.Parser { // If we see a > we need to see if we can actually merge this contextually into a // >> >>> >= >>= >>>= token. - if (token0.kind() === SyntaxKind.GreaterThanToken) { + if (token0.kind === SyntaxKind.GreaterThanToken) { return currentContextualToken(); // var kind = token0.kind; //Debug.assert(kind() === SyntaxKind.GreaterThanToken || kind() === SyntaxKind.GreaterThanGreaterThanToken || @@ -2622,8 +2681,8 @@ module TypeScript.Parser { // Because CallExpression and MemberExpression are left recursive, we need to bottom out // of the recursion immediately. So we parse out a primary expression to start with. var expression: IMemberExpressionSyntax = tryParsePrimaryExpression(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } return parseMemberExpressionRest(expression, inObjectCreation); @@ -2632,11 +2691,11 @@ module TypeScript.Parser { function parseCallExpressionRest(expression: ILeftHandSideExpressionSyntax): ILeftHandSideExpressionSyntax { while (true) { var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenParenToken: - expression = new syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(/*typeArgumentList:*/ null)); + expression = new InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(/*typeArgumentList:*/ undefined, _currentToken)); continue; case SyntaxKind.LessThanToken: @@ -2645,11 +2704,11 @@ module TypeScript.Parser { // part of an arithmetic expression. Break out so we consume it higher in the // stack. var argumentList = tryParseArgumentList(); - if (argumentList === null) { + if (argumentList === undefined) { break; } - expression = new syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, argumentList); + expression = new InvocationExpressionSyntax(parseNodeData, expression, argumentList); continue; case SyntaxKind.OpenBracketToken: @@ -2657,7 +2716,12 @@ module TypeScript.Parser { continue; case SyntaxKind.DotToken: - expression = new syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + expression = new MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + continue; + + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + expression = new TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); continue; } @@ -2668,7 +2732,7 @@ module TypeScript.Parser { function parseMemberExpressionRest(expression: IMemberExpressionSyntax, inObjectCreation: boolean): IMemberExpressionSyntax { while (true) { var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenBracketToken: @@ -2676,7 +2740,12 @@ module TypeScript.Parser { continue; case SyntaxKind.DotToken: - expression = new syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + expression = new MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + continue; + + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + expression = new TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); continue; } @@ -2716,14 +2785,14 @@ module TypeScript.Parser { // completes the LeftHandSideExpression, or starts the beginning of the first four // CallExpression productions. - var expression: ILeftHandSideExpressionSyntax = null; - if (_currentToken.kind() === SyntaxKind.SuperKeyword) { + var expression: ILeftHandSideExpressionSyntax = undefined; + if (_currentToken.kind === SyntaxKind.SuperKeyword) { expression = parseSuperExpression(_currentToken); } else { expression = tryParseMemberExpressionOrHigher(_currentToken, force, /*inObjectCreation:*/ false); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } } @@ -2733,63 +2802,65 @@ module TypeScript.Parser { } function parseSuperExpression(superToken: ISyntaxToken): ILeftHandSideExpressionSyntax { - var expression: ILeftHandSideExpressionSyntax = consumeToken(superToken); + var expression = consumeToken(superToken); // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var currentTokenKind = currentToken().kind(); + var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.OpenParenToken || currentTokenKind === SyntaxKind.DotToken ? expression - : new syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); + : new MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); } function tryParsePostfixExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IPostfixExpressionSyntax { var expression = tryParseLeftHandSideExpressionOrHigher(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: // Because of automatic semicolon insertion, we should only consume the ++ or -- // if it is on the same line as the previous token. - if (previousTokenHasTrailingNewLine(_currentToken)) { + if (isOnDifferentLineThanPreviousToken(_currentToken)) { break; } - return new syntaxFactory.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); + return new PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); } return expression; } function tryParseGenericArgumentList(): ArgumentListSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.LessThanToken); + // Debug.assert(currentToken().kind === SyntaxKind.LessThanToken); // If we have a '<', then only parse this as a arugment list if the type arguments // are complete and we have an open paren. if we don't, rewind and return nothing. var rewindPoint = getRewindPoint(); var typeArgumentList = tryParseTypeArgumentList(/*inExpression:*/ true); var token0 = currentToken(); - var tokenKind = token0.kind(); + var tokenKind = token0.kind; var isOpenParen = tokenKind === SyntaxKind.OpenParenToken; var isDot = tokenKind === SyntaxKind.DotToken; var isOpenParenOrDot = isOpenParen || isDot; - var argumentList: ArgumentListSyntax = null; - if (typeArgumentList === null || !isOpenParenOrDot) { + var argumentList: ArgumentListSyntax = undefined; + if (!typeArgumentList || !isOpenParenOrDot) { // Wasn't generic. Rewind to where we started so this can be parsed as an // arithmetic expression. rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { + Debug.assert(typeArgumentList && isOpenParenOrDot); + releaseRewindPoint(rewindPoint); // It's not uncommon for a user to type: "Foo." // @@ -2800,78 +2871,80 @@ module TypeScript.Parser { if (isDot) { // A parameter list must follow a generic type argument list. var diagnostic = new Diagnostic(fileName, source.text.lineMap(), start(token0, source.text), width(token0), - DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); + DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, undefined); addDiagnostic(diagnostic); - return new syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, - Syntax.emptyToken(SyntaxKind.OpenParenToken), Syntax.emptySeparatedList(), Syntax.emptyToken(SyntaxKind.CloseParenToken)); + return new ArgumentListSyntax(parseNodeData, typeArgumentList, + Syntax.emptyToken(SyntaxKind.OpenParenToken), [], Syntax.emptyToken(SyntaxKind.CloseParenToken)); } else { - return parseArgumentList(typeArgumentList); + Debug.assert(token0.kind === SyntaxKind.OpenParenToken); + return parseArgumentList(typeArgumentList, token0); } } } function tryParseArgumentList(): ArgumentListSyntax { - var tokenKind = currentToken().kind(); + var _currentToken = currentToken(); + var tokenKind = _currentToken.kind; if (tokenKind === SyntaxKind.LessThanToken) { return tryParseGenericArgumentList(); } if (tokenKind === SyntaxKind.OpenParenToken) { - return parseArgumentList(null); + return parseArgumentList(/*typeArgumentList:*/ undefined, /*openParenToken:*/ _currentToken); } - return null; + return undefined; } - function parseArgumentList(typeArgumentList: TypeArgumentListSyntax): ArgumentListSyntax { - var openParenToken = eatToken(SyntaxKind.OpenParenToken); + function parseArgumentList(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken): ArgumentListSyntax { + Debug.assert(openParenToken.kind === SyntaxKind.OpenParenToken && openParenToken.fullWidth() > 0); - // Don't use the name 'arguments' it prevents V8 from optimizing this method. - var _arguments = Syntax.emptySeparatedList(); - - if (openParenToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - _arguments = parseSeparatedSyntaxList(ListParsingState.ArgumentList_AssignmentExpressions, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - - return new syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments, eatToken(SyntaxKind.CloseParenToken)); + return new ArgumentListSyntax(parseNodeData, + typeArgumentList, + consumeToken(openParenToken), + parseSeparatedSyntaxList(ListParsingState.ArgumentList_AssignmentExpressions), + eatToken(SyntaxKind.CloseParenToken)); } function tryParseArgumentListExpression(): IExpressionSyntax { + // ArgumentList[Yield] : + // AssignmentExpression[In, ?Yield] + // Generally while parsing lists, we don't want to 'force' the parser to parse - // the item. That way, if the expected item isn't htere, we can bail out and + // the item. That way, if the expected item isn't there, we can bail out and // move to a higher stage of list parsing. However, it's extremely common to // see something like "Foo(, a". in this case, even though there isn't an expression // after the open paren, we still want to force parsing an expression (which will // cause a missing identiifer to be created), so that we will then consume the // comma and the following list items). - var force = currentToken().kind() === SyntaxKind.CommaToken; - return tryParseAssignmentExpressionOrHigher(force, /*allowIn:*/ true); + var force = currentToken().kind === SyntaxKind.CommaToken; + return allowInAnd(force ? parseAssignmentExpressionOrHigher : tryParseAssignmentExpressionOrHigher); } function parseElementAccessArgumentExpression(openBracketToken: ISyntaxToken, inObjectCreation: boolean) { + // MemberExpression[?Yield] [ Expression[In, ?Yield] ] + // It's not uncommon for a user to write: "new Type[]". Check for that common pattern // and report a better error message. - if (inObjectCreation && currentToken().kind() === SyntaxKind.CloseBracketToken) { + if (inObjectCreation && currentToken().kind === SyntaxKind.CloseBracketToken) { var errorStart = start(openBracketToken, source.text); - var errorEnd = end(currentToken(), source.text); + var errorEnd = fullEnd(currentToken()); var diagnostic = new Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, - DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); + DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, undefined); addDiagnostic(diagnostic); return Syntax.emptyToken(SyntaxKind.IdentifierName); } else { - return parseExpression(/*allowIn:*/ true); + return allowInAnd(parseExpression); } } function parseElementAccessExpression(expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, inObjectCreation: boolean): ElementAccessExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBracketToken); - return new syntaxFactory.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), + // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); + return new ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(SyntaxKind.CloseBracketToken)); } @@ -2880,7 +2953,7 @@ module TypeScript.Parser { return eatIdentifierToken(); } - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.ThisKeyword: case SyntaxKind.TrueKeyword: @@ -2891,11 +2964,15 @@ module TypeScript.Parser { case SyntaxKind.StringLiteral: return consumeToken(_currentToken); - case SyntaxKind.FunctionKeyword: return parseFunctionExpression(_currentToken); - case SyntaxKind.OpenBracketToken: return parseArrayLiteralExpression(_currentToken); - case SyntaxKind.OpenBraceToken: return parseObjectLiteralExpression(_currentToken); - case SyntaxKind.OpenParenToken: return parseParenthesizedExpression(_currentToken); - case SyntaxKind.NewKeyword: return parseObjectCreationExpression(_currentToken); + case SyntaxKind.FunctionKeyword: return parseFunctionExpression(_currentToken); + case SyntaxKind.OpenBracketToken: return parseArrayLiteralExpression(_currentToken); + case SyntaxKind.OpenBraceToken: return parseObjectLiteralExpression(_currentToken); + case SyntaxKind.OpenParenToken: return parseParenthesizedExpression(_currentToken); + case SyntaxKind.NewKeyword: return parseObjectCreationExpression(_currentToken); + + case SyntaxKind.NoSubstitutionTemplateToken: + case SyntaxKind.TemplateStartToken: + return parseTemplateExpression(_currentToken); case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: @@ -2911,7 +2988,7 @@ module TypeScript.Parser { } if (!force) { - return null; + return undefined; } // Nothing else worked, report an error and produce a missing token. @@ -2923,7 +3000,7 @@ module TypeScript.Parser { // contexts. // var currentToken = this.currentToken(); - // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken.kind)); // Ok, from our quick lexical check, this could be a place where a regular expression could // go. Now we have to do a bunch of work. Ask the source to retrive the token at the @@ -2932,12 +3009,12 @@ module TypeScript.Parser { // Note: we *must* have gotten a /, /= or regular expression. Or else something went *very* // wrong with our logic above. - // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind)); - var tokenKind = currentToken.kind(); + var tokenKind = currentToken.kind; if (tokenKind === SyntaxKind.SlashToken || tokenKind === SyntaxKind.SlashEqualsToken) { // Still came back as a / or /=. This is not a regular expression literal. - return null; + return undefined; } else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { return consumeToken(currentToken); @@ -2950,22 +3027,32 @@ module TypeScript.Parser { } function parseTypeOfExpression(typeOfKeyword: ISyntaxToken): TypeOfExpressionSyntax { - return new syntaxFactory.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseDeleteExpression(deleteKeyword: ISyntaxToken): DeleteExpressionSyntax { - return new syntaxFactory.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseVoidExpression(voidKeyword: ISyntaxToken): VoidExpressionSyntax { - return new syntaxFactory.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseFunctionExpression(functionKeyword: ISyntaxToken): FunctionExpressionSyntax { - return new syntaxFactory.FunctionExpressionSyntax(parseNodeData, - consumeToken(functionKeyword), eatOptionalIdentifierToken(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true)); + return parseFunctionExpressionWorker(consumeToken(functionKeyword), tryEatToken(SyntaxKind.AsteriskToken)); + } + + function parseFunctionExpressionWorker(functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken) { + // GeneratorExpression : + // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + + var isGenerator = asteriskToken !== undefined; + return new FunctionExpressionSyntax(parseNodeData, + functionKeyword, + asteriskToken, + enterYieldContextAnd(eatOptionalIdentifierToken), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yield:*/ isGenerator, /*generatorParameter:*/ isGenerator), + parseFunctionBlock(/*yield:*/ isGenerator)); } function parseObjectCreationExpression(newKeyword: ISyntaxToken): ObjectCreationExpressionSyntax { @@ -2978,24 +3065,70 @@ module TypeScript.Parser { // See comment in tryParseMemberExpressionOrHigher for a more complete explanation of // this decision. - return new syntaxFactory.ObjectCreationExpressionSyntax(parseNodeData, + return new ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), /*force:*/ true, /*inObjectCreation:*/ true), tryParseArgumentList()); } + function parseTemplateExpression(startToken: ISyntaxToken): IPrimaryExpressionSyntax { + startToken = consumeToken(startToken); + + if (startToken.kind === SyntaxKind.NoSubstitutionTemplateToken) { + return startToken; + } + + var templateClauses: TemplateClauseSyntax[] = []; + + do { + // Keep consuming template spans as long as the last one we keep getting template + // middle pieces. + templateClauses.push(parseTemplateClause()); + } + while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind === SyntaxKind.TemplateMiddleToken); + + return new TemplateExpressionSyntax(parseNodeData, startToken, Syntax.list(templateClauses)); + } + + function parseTemplateClause(): TemplateClauseSyntax { + // TemplateLiteral[Yield] : See 12.2.8 + // NoSubstitutionTemplate + // TemplateHead Expression[In, ?Yield] + // [Lexical goal InputElementTemplateTail] TemplateSpans[?Yield] + + var expression = allowInAnd(parseExpression); + var token = currentToken(); + + if (token.kind === SyntaxKind.CloseBraceToken) { + token = currentContextualToken(); + Debug.assert(token.kind === SyntaxKind.TemplateMiddleToken || token.kind === SyntaxKind.TemplateEndToken); + token = consumeToken(token); + } + else { + var diagnostic = getExpectedTokenDiagnostic(SyntaxKind.CloseBraceToken); + addDiagnostic(diagnostic); + token = Syntax.emptyToken(SyntaxKind.TemplateEndToken); + } + + return new TemplateClauseSyntax(parseNodeData, expression, token); + } + function parseCastExpression(lessThanToken: ISyntaxToken): CastExpressionSyntax { - return new syntaxFactory.CastExpressionSyntax(parseNodeData, + return new CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(SyntaxKind.GreaterThanToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseParenthesizedExpression(openParenToken: ISyntaxToken): ParenthesizedExpressionSyntax { - return new syntaxFactory.ParenthesizedExpressionSyntax(parseNodeData, - consumeToken(openParenToken), parseExpression(/*allowIn:*/ true), eatToken(SyntaxKind.CloseParenToken)); + // ( Expression[In, ?Yield] ) + + return new ParenthesizedExpressionSyntax(parseNodeData, + consumeToken(openParenToken), + allowInAnd(parseExpression), + eatToken(SyntaxKind.CloseParenToken)); } function tryParseParenthesizedArrowFunctionExpression(): ParenthesizedArrowFunctionExpressionSyntax { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.OpenParenToken && tokenKind !== SyntaxKind.LessThanToken) { - return null; + return undefined; } // Because arrow functions and parenthesized expressions look similar, we have to check far @@ -3016,14 +3149,14 @@ module TypeScript.Parser { // Now, look for cases where we're sure it's not an arrow function. This will help save us // a costly parse. if (!isPossiblyArrowFunctionExpression()) { - return null; + return undefined; } // Then, try to actually parse it as a arrow function, and only return if we see an => var rewindPoint = getRewindPoint(); var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(/*requiresArrow:*/ true); - if (arrowFunction === null) { + if (arrowFunction === undefined) { rewind(rewindPoint); } @@ -3033,95 +3166,103 @@ module TypeScript.Parser { function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow: boolean): ParenthesizedArrowFunctionExpressionSyntax { var _currentToken = currentToken(); - // Debug.assert(currentToken.kind() === SyntaxKind.OpenParenToken || currentToken.kind() === SyntaxKind.LessThanToken); + // Debug.assert(currentToken.kind === SyntaxKind.OpenParenToken || currentToken.kind === SyntaxKind.LessThanToken); - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true); + // Note: ES6 specifies the formal parametes of an arrow function like this: + // + // ArrowFormalParameters[Yield, GeneratorParameter] : + // (StrictFormalParameters[?Yield, ?GeneratorParameter]) + // + // However, the 'GeneratorParameter' portion appears to be a spec bug. There does not + // appear to be any way for that value to be passed in through any grammar constructs. + // + // [Yield], on the other hand, is available, and is passed through. - if (requireArrow && currentToken().kind() !== SyntaxKind.EqualsGreaterThanToken) { - return null; + var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true, /*yield:*/ yieldContext, /*generatorParameter:*/ false); + + if (requireArrow && currentToken().kind !== SyntaxKind.EqualsGreaterThanToken) { + return undefined; } - var equalsGreaterThanToken = eatToken(SyntaxKind.EqualsGreaterThanToken); - - var block = tryParseArrowFunctionBlock(); - var expression: IExpressionSyntax = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true); - } - - return new syntaxFactory.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); + return new ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, + callSignature, + eatToken(SyntaxKind.EqualsGreaterThanToken), + parseArrowFunctionBody()); } - function tryParseArrowFunctionBlock(): BlockSyntax { + function parseArrowFunctionBody(): BlockSyntax | IExpressionSyntax { + // ConciseBody[In] : + // [lookahead not in {] AssignmentExpression[?In] + // { FunctionBody } + if (isBlock()) { - return parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ false); + return parseFunctionBlock(/*allowYield:*/ false); } - else { - // We didn't have a block. However, we may be in an error situation. For example, - // if the user wrote: - // - // a => - // var v = 0; - // } - // - // (i.e. they're missing the open brace). See if that's the case so we can try to - // recover better. If we don't do this, then the next close curly we see may end - // up preemptively closing the containing construct. - var _modifierCount = modifierCount(); - if (isStatement(_modifierCount, /*inErrorRecovery:*/ false) && - !isExpressionStatement(currentToken()) && - !isFunctionDeclaration(_modifierCount)) { - // We've seen a statement (and it isn't an expressionStatement like 'foo()'), - // so treat this like a block with a missing open brace. - return parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ true, /*checkForStrictMode:*/ false); - } - else { - return null; - } + + // We didn't have a block. However, we may be in an error situation. For example, + // if the user wrote: + // + // a => + // var v = 0; + // } + // + // (i.e. they're missing the open brace). See if that's the case so we can try to + // recover better. If we don't do this, then the next close curly we see may end + // up preemptively closing the containing construct. + var _modifierCount = modifierCount(); + if (isStatement(_modifierCount, /*inErrorRecovery:*/ false) && + !isExpression(currentToken())) { + // We've seen a statement (and it isn't an expressionStatement like 'foo()'), so + // treat this like a block with a missing open brace. + + return new BlockSyntax(parseNodeData, + eatToken(SyntaxKind.OpenBraceToken), + parseFunctionBlockStatements(), + eatToken(SyntaxKind.CloseBraceToken)); } + + return parseAssignmentExpressionOrHigher(); } function isSimpleArrowFunctionExpression(_currentToken: ISyntaxToken): boolean { // ERROR RECOVERY TWEAK: // If we see a standalone => try to parse it as an arrow function as that's likely what // the user intended to write. - if (_currentToken.kind() === SyntaxKind.EqualsGreaterThanToken) { + if (_currentToken.kind === SyntaxKind.EqualsGreaterThanToken) { return true; } return isIdentifier(_currentToken) && - peekToken(1).kind() === SyntaxKind.EqualsGreaterThanToken; + peekToken(1).kind === SyntaxKind.EqualsGreaterThanToken; } function parseSimpleArrowFunctionExpression(): SimpleArrowFunctionExpressionSyntax { // Debug.assert(isSimpleArrowFunctionExpression()); - - var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(SyntaxKind.EqualsGreaterThanToken); - - var block = tryParseArrowFunctionBlock(); - var expression: IExpressionSyntax = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true); - } - - return new syntaxFactory.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); + return new SimpleArrowFunctionExpressionSyntax(parseNodeData, + eatSimpleParameter(), + eatToken(SyntaxKind.EqualsGreaterThanToken), + parseArrowFunctionBody()); } function isBlock(): boolean { - return currentToken().kind() === SyntaxKind.OpenBraceToken; + return currentToken().kind === SyntaxKind.OpenBraceToken; + } + + function isBlockOrArrow(): boolean { + var _currentToken = currentToken(); + return _currentToken.kind === SyntaxKind.OpenBraceToken || _currentToken.kind === SyntaxKind.EqualsGreaterThanToken; } function isDefinitelyArrowFunctionExpression(): boolean { var token0 = currentToken(); - if (token0.kind() !== SyntaxKind.OpenParenToken) { + if (token0.kind !== SyntaxKind.OpenParenToken) { // If it didn't start with an (, then it could be generic. That's too complicated // and we can't say it's 'definitely' an arrow function. return false; } var token1 = peekToken(1); - var token1Kind = token1.kind(); + var token1Kind = token1.kind; var token2: ISyntaxToken; @@ -3134,7 +3275,7 @@ module TypeScript.Parser { // "():" or "() =>" or "() {}". Note: the last one is illegal. However it // most likely is a missing => and not a parenthesized expression. token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; return token2Kind === SyntaxKind.ColonToken || token2Kind === SyntaxKind.EqualsGreaterThanToken || token2Kind === SyntaxKind.OpenBraceToken; @@ -3147,7 +3288,7 @@ module TypeScript.Parser { } token2 = peekToken(2); - token2Kind = token2.kind(); + token2Kind = token2.kind; if (SyntaxFacts.isAccessibilityModifier(token1Kind)) { if (isIdentifier(token2)) { @@ -3176,7 +3317,7 @@ module TypeScript.Parser { } var token3 = peekToken(3); - var token3Kind = token3.kind(); + var token3Kind = token3.kind; if (token2Kind === SyntaxKind.QuestionToken) { // (id? // Could be an arrow function, or a parenthesized conditional expression. @@ -3219,7 +3360,7 @@ module TypeScript.Parser { function isPossiblyArrowFunctionExpression(): boolean { var token0 = currentToken(); - if (token0.kind() !== SyntaxKind.OpenParenToken) { + if (token0.kind !== SyntaxKind.OpenParenToken) { // If it didn't start with an (, then it could be generic. That's too complicated // and we have to say it's possibly an arrow function. return true; @@ -3234,7 +3375,7 @@ module TypeScript.Parser { } var token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; if (token2Kind === SyntaxKind.EqualsToken) { // (id = // @@ -3257,7 +3398,7 @@ module TypeScript.Parser { // (id) var token3 = peekToken(3); - if (token3.kind() === SyntaxKind.ColonToken) { + if (token3.kind === SyntaxKind.ColonToken) { // (id): // // This could be an arrow function. i.e. (id): number => { } @@ -3272,69 +3413,95 @@ module TypeScript.Parser { } function parseObjectLiteralExpression(openBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBraceToken); - - consumeToken(openBraceToken); - // Debug.assert(openBraceToken.fullWidth() > 0); - - var skippedTokens: ISyntaxToken[] = getArray(); - var propertyAssignments = parseSeparatedSyntaxList(ListParsingState.ObjectLiteralExpression_PropertyAssignments, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - - return new syntaxFactory.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(SyntaxKind.CloseBraceToken)); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBraceToken); + return new ObjectLiteralExpressionSyntax(parseNodeData, + consumeToken(openBraceToken), + parseSeparatedSyntaxList(ListParsingState.ObjectLiteralExpression_PropertyAssignments), + eatToken(SyntaxKind.CloseBraceToken)); } function tryParsePropertyAssignment(inErrorRecovery: boolean): IPropertyAssignmentSyntax { // Debug.assert(isPropertyAssignment(/*inErrorRecovery:*/ false)); if (isAccessor(modifierCount(), inErrorRecovery)) { - return parseAccessor(/*checkForStrictMode:*/ true); + return parseAccessor(); } - else if (isFunctionPropertyAssignment(inErrorRecovery)) { - return parseFunctionPropertyAssignment(); + + // Note: we don't want to call parsePropertyName here yet as it will convert a keyword + // to an identifier name. We don't want to do that yet as a keyword is not legal as a + // shorthand property assignment. + + var _currentToken = currentToken(); + if (isIdentifier(_currentToken)) { + var token1 = peekToken(1); + if (token1.kind !== SyntaxKind.ColonToken && + token1.kind !== SyntaxKind.OpenParenToken && + token1.kind !== SyntaxKind.LessThanToken) { + + // If we don't have one of: + // + // id: + // id( + // id< + // + // then this is a shorthand property assignment. Just return the identifier + // token as is. + return consumeToken(_currentToken); + } } - else if (isSimplePropertyAssignment(inErrorRecovery)) { - return parseSimplePropertyAssignment(); - } - else { - return null; + + // All the rest of the property assignments start with property names or an asterix. + // They are: + // id: e + // [e1]: e2 + // id() { } + // [e]() { } + // *id() { } + // *[e]() { } + if (_currentToken.kind === SyntaxKind.AsteriskToken || isPropertyName(/*peekIndex:*/ 0, inErrorRecovery)) { + var asterixToken = tryEatToken(SyntaxKind.AsteriskToken); + var propertyName = parsePropertyName(); + + if (asterixToken !== undefined || isCallSignature(/*peekIndex:*/ 0)) { + return parseFunctionPropertyAssignment(asterixToken, propertyName); + } + else { + // PropertyName[?Yield] : AssignmentExpression[In, ?Yield] + + // If we didn't have an identifier, then we must have gotten a keyword or a + // literal. Neither of these are allowed in a shorthand property, so this must + // be a simple property assignment. + // + // Also, if we have an identifier and it is followed by a colon then this is + // definitely a simple property assignment. + return new SimplePropertyAssignmentSyntax(parseNodeData, + propertyName, + eatToken(SyntaxKind.ColonToken), + allowInAnd(parseAssignmentExpressionOrHigher)); + } } + + return undefined; } function isPropertyAssignment(inErrorRecovery: boolean): boolean { return isAccessor(modifierCount(), inErrorRecovery) || - isFunctionPropertyAssignment(inErrorRecovery) || - isSimplePropertyAssignment(inErrorRecovery); + currentToken().kind === SyntaxKind.AsteriskToken || + isPropertyName(/*peekIndex:*/ 0, inErrorRecovery); } - function eatPropertyName(): ISyntaxToken { - var _currentToken = currentToken(); - return SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken) - ? eatIdentifierNameToken() - : consumeToken(_currentToken); + function isPropertyName(peekIndex: number, inErrorRecovery: boolean): boolean { + var token = peekToken(peekIndex); + if (token.kind === SyntaxKind.OpenBracketToken) { + // A '[' only starts a property name as long as we're sure it doesn't start an + // index signature. + return !isIndexSignature(peekIndex); + } + + return isPropertyNameToken(token, inErrorRecovery); } - function isFunctionPropertyAssignment(inErrorRecovery: boolean): boolean { - return isPropertyName(currentToken(), inErrorRecovery) && - isCallSignature(/*peekIndex:*/ 1); - } - - function parseFunctionPropertyAssignment(): FunctionPropertyAssignmentSyntax { - return new syntaxFactory.FunctionPropertyAssignmentSyntax(parseNodeData, - eatPropertyName(), parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseBlockEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true)); - } - - function isSimplePropertyAssignment(inErrorRecovery: boolean): boolean { - return isPropertyName(currentToken(), inErrorRecovery); - } - - function parseSimplePropertyAssignment(): SimplePropertyAssignmentSyntax { - return new syntaxFactory.SimplePropertyAssignmentSyntax(parseNodeData, - eatPropertyName(), eatToken(SyntaxKind.ColonToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true)); - } - - function isPropertyName(token: ISyntaxToken, inErrorRecovery: boolean): boolean { + function isPropertyNameToken(token: ISyntaxToken, inErrorRecovery: boolean): boolean { // NOTE: we do *not* want to check "isIdentifier" here. Any IdentifierName is // allowed here, even reserved words like keywords. if (SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { @@ -3353,70 +3520,140 @@ module TypeScript.Parser { } } - var kind = token.kind(); - return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral; + return isLiteralPropertyName(token); + } + + function isLiteralPropertyName(token: ISyntaxToken): boolean { + // We allow a template literal while parser for error tolerance. We'll report errors + // on this later in the grammar checker walker. + var kind = token.kind; + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.NoSubstitutionTemplateToken; + } + + function parsePropertyName(): IPropertyNameSyntax { + // PropertyName[Yield,GeneratorParameter] : See 12.2.5 + // LiteralPropertyName + // [+GeneratorParameter]ComputedPropertyName + // [~GeneratorParameter]ComputedPropertyName[?Yield] + + var _currentToken = currentToken(); + if (_currentToken.kind === SyntaxKind.OpenBracketToken) { + return generatorParameterContext + ? exitYieldContextAnd(parseComputedPropertyName) + : parseComputedPropertyName(); + } + else if (SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken)) { + // If it was a keyword, convert it to an identifier name. + return eatIdentifierNameToken(); + } + else if (isLiteralPropertyName(_currentToken)) { + // Must have been a literal. + return consumeToken(_currentToken); + } + else { + return eatIdentifierToken(); + } + } + + function parseComputedPropertyName(): ComputedPropertyNameSyntax { + // ComputedPropertyName[Yield] : + // [AssignmentExpression[In, ?Yield]] + + return new ComputedPropertyNameSyntax(parseNodeData, + eatToken(SyntaxKind.OpenBracketToken), + allowInAnd(parseAssignmentExpressionOrHigher), + eatToken(SyntaxKind.CloseBracketToken)); + } + + function parseFunctionPropertyAssignment(asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): FunctionPropertyAssignmentSyntax { + var isGenerator = asteriskToken !== undefined; + return new FunctionPropertyAssignmentSyntax(parseNodeData, + asteriskToken, + propertyName, + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yield:*/ isGenerator, /*generatorParameter:*/ isGenerator), + parseFunctionBlock(/*yield:*/ isGenerator)); } function parseArrayLiteralExpression(openBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBracketToken); - consumeToken(openBracketToken); - // Debug.assert(openBracketToken.fullWidth() > 0); - - var skippedTokens: ISyntaxToken[] = getArray(); - var expressions = parseSeparatedSyntaxList(ListParsingState.ArrayLiteralExpression_AssignmentExpressions, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - - return new syntaxFactory.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(SyntaxKind.CloseBracketToken)); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); + return new ArrayLiteralExpressionSyntax(parseNodeData, + consumeToken(openBracketToken), + parseSeparatedSyntaxList(ListParsingState.ArrayLiteralExpression_AssignmentExpressions), + eatToken(SyntaxKind.CloseBracketToken)); } - function parseBlock(parseBlockEvenWithNoOpenBrace: boolean, checkForStrictMode: boolean): BlockSyntax { - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var statements = Syntax.emptyList(); + function parseStatementBlock(): BlockSyntax { + // Different from function blocks in that we don't check for strict mode, nor do accept + // a block without an open curly. + var openBraceToken: ISyntaxToken; + return new BlockSyntax(parseNodeData, + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.Block_Statements) : [], + eatToken(SyntaxKind.CloseBraceToken)); + } - if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { - var savedIsInStrictMode = isInStrictMode; - - var processItems = checkForStrictMode ? updateStrictModeState : null; - var skippedTokens: ISyntaxToken[] = getArray(); - var statements = parseSyntaxList(ListParsingState.Block_Statements, skippedTokens, processItems); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); + function parseFunctionBlock(_allowYield: boolean): BlockSyntax { + // If we got an errant => then we want to parse what's coming up without requiring an + // open brace. ItWe do this because it's not uncommon for people to get confused as to + // where/when they can use an => and we want to have good error recovery here. + var token0 = currentToken(); - setStrictMode(savedIsInStrictMode); + var hasEqualsGreaterThanToken = token0.kind === SyntaxKind.EqualsGreaterThanToken; + if (hasEqualsGreaterThanToken) { + addDiagnostic(new Diagnostic(fileName, source.text.lineMap(), + start(token0, source.text), width(token0), DiagnosticCode.Unexpected_token_0_expected, [SyntaxFacts.getText(SyntaxKind.OpenBraceToken)])); + + // Skip over the => It will get attached to whatever comes next. + skipToken(token0); } - return new syntaxFactory.BlockSyntax(parseNodeData, openBraceToken, statements, eatToken(SyntaxKind.CloseBraceToken)); + var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); + var statements: IStatementSyntax[]; + + if (hasEqualsGreaterThanToken || openBraceToken.fullWidth() > 0) { + statements = _allowYield ? enterYieldContextAnd(parseFunctionBlockStatements) : exitYieldContextAnd(parseFunctionBlockStatements); + } + + return new BlockSyntax(parseNodeData, openBraceToken, statements || [], eatToken(SyntaxKind.CloseBraceToken)); } - function parseCallSignature(requireCompleteTypeParameterList: boolean): CallSignatureSyntax { - return new syntaxFactory.CallSignatureSyntax(parseNodeData, - tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + function parseFunctionBlockStatements() { + var savedIsInStrictMode = strictModeContext; + var statements = parseSyntaxList(ListParsingState.Block_Statements, updateStrictModeState); + setStrictModeContext(savedIsInStrictMode); + + return statements; + } + + function parseCallSignature(requireCompleteTypeParameterList: boolean, _yieldContext: boolean, _generatorParameterContext: boolean): CallSignatureSyntax { + return new CallSignatureSyntax(parseNodeData, + tryParseTypeParameterList(requireCompleteTypeParameterList), + parseParameterList(_yieldContext, _generatorParameterContext), + parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); } function tryParseTypeParameterList(requireCompleteTypeParameterList: boolean): TypeParameterListSyntax { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.LessThanToken) { - return null; + if (_currentToken.kind !== SyntaxKind.LessThanToken) { + return undefined; } var rewindPoint = getRewindPoint(); var lessThanToken = consumeToken(_currentToken); - - var skippedTokens: ISyntaxToken[] = getArray(); - var typeParameters = parseSeparatedSyntaxList(ListParsingState.TypeParameterList_TypeParameters, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); + var typeParameters = parseSeparatedSyntaxList(ListParsingState.TypeParameterList_TypeParameters); var greaterThanToken = eatToken(SyntaxKind.GreaterThanToken); - // return null if we were required to have a '>' token and we did not have one. + // return undefined if we were required to have a '>' token and we did not have one. if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new syntaxFactory.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); + return new TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); } } @@ -3427,53 +3664,62 @@ module TypeScript.Parser { function tryParseTypeParameter(): TypeParameterSyntax { // Debug.assert(isTypeParameter()); if (!isIdentifier(currentToken())) { - return null; + return undefined; } - return new syntaxFactory.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); + return new TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); } function tryParseConstraint(): ConstraintSyntax { - if (currentToken().kind() !== SyntaxKind.ExtendsKeyword) { - return null; + if (currentToken().kind !== SyntaxKind.ExtendsKeyword) { + return undefined; } - return new syntaxFactory.ConstraintSyntax(parseNodeData, eatToken(SyntaxKind.ExtendsKeyword), parseTypeOrExpression()); + return new ConstraintSyntax(parseNodeData, eatToken(SyntaxKind.ExtendsKeyword), parseTypeOrExpression()); } - function tryParseParameterList(): ParameterListSyntax { - if (currentToken().kind() === SyntaxKind.OpenParenToken) { - var token1 = peekToken(1); + function parseParameterList(_yieldContext: boolean, _generatorParameterContext: boolean): ParameterListSyntax { + // FormalParameters[Yield,GeneratorParameter] : + // ... + // + // FormalParameter[Yield,GeneratorParameter] : + // BindingElement[?Yield, ?GeneratorParameter] + // + // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 + // SingleNameBinding[?Yield, ?GeneratorParameter] + // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt + // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt + // + // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - if (token1.kind() === SyntaxKind.CloseParenToken || isParameterHelper(token1)) { - return parseParameterList(); - } - } + var savedYieldContext = yieldContext; + var savedGeneratorParameterContext = generatorParameterContext; - return null; - } + setYieldContext(_yieldContext); + setGeneratorParameterContext(_generatorParameterContext); - function parseParameterList(): ParameterListSyntax { - var openParenToken = eatToken(SyntaxKind.OpenParenToken); - var parameters = Syntax.emptySeparatedList(); + var openParenToken: ISyntaxToken; + var result = new ParameterListSyntax(parseNodeData, + openParenToken = eatToken(SyntaxKind.OpenParenToken), + openParenToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.ParameterList_Parameters) : [], + eatToken(SyntaxKind.CloseParenToken)); - if (openParenToken.fullWidth() > 0) { - var skippedTokens: ISyntaxToken[] = getArray(); - parameters = parseSeparatedSyntaxList(ListParsingState.ParameterList_Parameters, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); - return new syntaxFactory.ParameterListSyntax(parseNodeData, openParenToken, parameters, eatToken(SyntaxKind.CloseParenToken)); + return result; } function parseOptionalTypeAnnotation(allowStringLiteral: boolean): TypeAnnotationSyntax { - return currentToken().kind() === SyntaxKind.ColonToken ? parseTypeAnnotation(allowStringLiteral) : null; + return currentToken().kind === SyntaxKind.ColonToken ? parseTypeAnnotation(allowStringLiteral) : undefined; } function parseTypeAnnotationType(allowStringLiteral: boolean): ITypeSyntax { if (allowStringLiteral) { var _currentToken = currentToken(); - if (_currentToken.kind() === SyntaxKind.StringLiteral) { + if (_currentToken.kind === SyntaxKind.StringLiteral) { return consumeToken(_currentToken); } } @@ -3482,13 +3728,13 @@ module TypeScript.Parser { } function parseTypeAnnotation(allowStringLiteral: boolean): TypeAnnotationSyntax { - return new syntaxFactory.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); + return new TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); } function isType(): boolean { var _currentToken = currentToken(); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.TypeOfKeyword: case SyntaxKind.AnyKeyword: case SyntaxKind.NumberKeyword: @@ -3532,6 +3778,52 @@ module TypeScript.Parser { } function tryParseType(): ITypeSyntax { + // The rules about 'yield' only apply to actual code/expression contexts. They don't + // apply to 'type' contexts. So we disable these parameters here before moving on. + var savedYieldContext = yieldContext; + var savedGeneratorParameterContext = generatorParameterContext; + + setYieldContext(false); + setGeneratorParameterContext(false); + + var result = tryParseTypeWorker(); + + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); + + return result; + } + + function tryParseTypeWorker(): ITypeSyntax { + if (isFunctionType()) { + return parseFunctionType(); + } + + if (currentToken().kind === SyntaxKind.NewKeyword) { + return parseConstructorType(); + } + + return tryParseUnionTypeOrHigher(); + } + + function tryParseUnionTypeOrHigher(): ITypeSyntax { + var type = tryParsePrimaryType(); + + if (type) { + var barToken: ISyntaxToken; + while ((barToken = currentToken()).kind === SyntaxKind.BarToken) { + type = new UnionTypeSyntax(parseNodeData, type, consumeToken(barToken), parsePrimaryType()); + } + } + + return type; + } + + function parsePrimaryType(): ITypeSyntax { + return tryParsePrimaryType() || eatIdentifierToken(DiagnosticCode.Type_expected); + } + + function tryParsePrimaryType(): ITypeSyntax { // First consume any underlying element type. var type = tryParseNonArrayType(); @@ -3543,40 +3835,38 @@ module TypeScript.Parser { while (type) { var _currentToken = currentToken(); - if (previousTokenHasTrailingNewLine(_currentToken) || - _currentToken.kind() !== SyntaxKind.OpenBracketToken) { + if (isOnDifferentLineThanPreviousToken(_currentToken) || + _currentToken.kind !== SyntaxKind.OpenBracketToken) { break; } - type = new syntaxFactory.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(SyntaxKind.CloseBracketToken)); + type = new ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(SyntaxKind.CloseBracketToken)); } return type; } function parseTypeQuery(typeOfKeyword: ISyntaxToken): TypeQuerySyntax { - return new syntaxFactory.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(/*allowIdentifierNames:*/ true)); + return new TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(/*allowIdentifierNames:*/ true)); } function tryParseNonArrayType(): ITypeSyntax { var _currentToken = currentToken(); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.NumberKeyword: case SyntaxKind.BooleanKeyword: case SyntaxKind.StringKeyword: // if any of these are followed by '.', then this is actually a module name, // and these keywords will be reinterpreted as an identifier. - if (peekToken(1).kind() === SyntaxKind.DotToken) { + if (peekToken(1).kind === SyntaxKind.DotToken) { break; } return consumeToken(_currentToken); - case SyntaxKind.OpenParenToken: - case SyntaxKind.LessThanToken: return tryParseFunctionType(); case SyntaxKind.VoidKeyword: return consumeToken(_currentToken); + case SyntaxKind.OpenParenToken: return parseParenthesizedType(_currentToken); case SyntaxKind.OpenBraceToken: return parseObjectType(); - case SyntaxKind.NewKeyword: return parseConstructorType(); case SyntaxKind.TypeOfKeyword: return parseTypeQuery(_currentToken); case SyntaxKind.OpenBracketToken: return parseTupleType(_currentToken); } @@ -3584,51 +3874,113 @@ module TypeScript.Parser { return tryParseNameOrGenericType(); } + function parseParenthesizedType(openParenToken: ISyntaxToken): ParenthesizedTypeSyntax { + return new ParenthesizedTypeSyntax(parseNodeData, consumeToken(openParenToken), parseType(), eatToken(SyntaxKind.CloseParenToken)); + } + function tryParseNameOrGenericType(): ITypeSyntax { var name = tryParseName(/*allowIdentifierNames*/ false); - if (name === null) { - return null; + if (name === undefined) { + return undefined; } // TypeReference: // TypeName [no LineTerminator here] TypeArgumentsopt // // Only consume type arguments if they appear on the same line. - if (previousTokenHasTrailingNewLine(currentToken())) { + if (isOnDifferentLineThanPreviousToken(currentToken())) { return name; } var typeArgumentList = tryParseTypeArgumentList(/*inExpression:*/ false); - return typeArgumentList === null + return !typeArgumentList ? name - : new syntaxFactory.GenericTypeSyntax(parseNodeData, name, typeArgumentList); + : new GenericTypeSyntax(parseNodeData, name, typeArgumentList); } - function tryParseFunctionType(): FunctionTypeSyntax { - var typeParameterList = tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false); - var parameterList: ParameterListSyntax = null; - if (typeParameterList === null) { - parameterList = tryParseParameterList(); - if (parameterList === null) { - return null; - } - } - else { - parameterList = parseParameterList(); + function isFunctionType(): boolean { + var token0 = currentToken(); + var token0Kind = token0.kind; + + // If we see a < then we consider ourselves to be definitely in a (generic) function type. + if (token0Kind === SyntaxKind.LessThanToken) { + return true; } - return new syntaxFactory.FunctionTypeSyntax(parseNodeData, - typeParameterList, parameterList, eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); + // If we don't see a < then we have to see an open paren for this to be a function + // type. However, an open paren may also start a parenthesized type. So we need to + // do some lookahead to see what we've actually got. If we don't see enough to be + // sure that it's a function type, then we go ahead with the assumption that it's a + // parenthesized type. + if (token0Kind === SyntaxKind.OpenParenToken) { + var token1 = peekToken(1); + var token1Kind = token1.kind; + + if (token1Kind === SyntaxKind.CloseParenToken || token1Kind === SyntaxKind.DotDotDotToken) { + // () + // (... + // + // Both are definitely function types, and could not be paren types. + return true; + } + + if (isModifierKind(token1Kind) || isIdentifier(token1)) { + // (id + // could be a function type or a parenthesized type. + + var token2 = peekToken(2); + var token2Kind = token2.kind; + + if (token2Kind === SyntaxKind.ColonToken || + token2Kind === SyntaxKind.CommaToken || + token2Kind === SyntaxKind.QuestionToken || + token2Kind === SyntaxKind.EqualsToken || + isIdentifier(token2) || + isModifierKind(token2Kind)) { + // ( id : + // ( id , + // ( id ? + // ( id = + // ( modifier id + // + // All of these are definitely a function type and not a parenthesized type. + return true; + } + + if (token2Kind === SyntaxKind.CloseParenToken) { + // ( id ) + // + // Only a function type if we see an arrow following it. + return peekToken(3).kind === SyntaxKind.EqualsGreaterThanToken; + } + } + } + + // Anything else is a parenthesized type. + return false; + } + + function parseFunctionType(): FunctionTypeSyntax { + // Function types only exist in the type space and not the expression space. So they + // aren't in the [Yield] or [GeneratorParameter] context. + return new FunctionTypeSyntax(parseNodeData, + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseParameterList(/*yield:*/ false, /*generatorParameter:*/ false), + eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); } function parseConstructorType(): ConstructorTypeSyntax { - return new syntaxFactory.ConstructorTypeSyntax(parseNodeData, - eatToken(SyntaxKind.NewKeyword), tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), - parseParameterList(), eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); + // Constructor types only exist in the type space and not the expression space. So they + // aren't in the [Yield] or [GeneratorParameter] context. + return new ConstructorTypeSyntax(parseNodeData, + eatToken(SyntaxKind.NewKeyword), + tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), + parseParameterList(/*yield:*/ false, /*generatorParameter:*/ false), + eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); } function isParameter(): boolean { - if (currentNode() !== null && currentNode().kind() === SyntaxKind.Parameter) { + if (currentNode() && currentNode().kind === SyntaxKind.Parameter) { return true; } @@ -3636,21 +3988,21 @@ module TypeScript.Parser { } function isParameterHelper(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; return tokenKind === SyntaxKind.DotDotDotToken || isModifierKind(tokenKind) || isIdentifier(token); } function eatSimpleParameter() { - return new syntaxFactory.ParameterSyntax(parseNodeData, - /*dotDotDotToken:*/ null, /*modifiers:*/ Syntax.emptyList(), eatIdentifierToken(), - /*questionToken:*/ null, /*typeAnnotation:*/ null, /*equalsValueClause:*/ null); + return new ParameterSyntax(parseNodeData, + /*dotDotDotToken:*/ undefined, /*modifiers:*/ [], eatIdentifierToken(), + /*questionToken:*/ undefined, /*typeAnnotation:*/ undefined, /*equalsValueClause:*/ undefined); } function tryParseParameter(): ParameterSyntax { var node = currentNode(); - if (node !== null && node.kind() === SyntaxKind.Parameter) { + if (node && node.kind === SyntaxKind.Parameter) { consumeNode(node); return node; } @@ -3661,48 +4013,56 @@ module TypeScript.Parser { // If we're not forcing, and we don't see anything to indicate this is a parameter, then // bail out. var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && dotDotDotToken === null && modifiers.length === 0) { + if (!isIdentifier(_currentToken) && !dotDotDotToken && modifiers.length === 0) { // ERROR RECOVERY: // If we see a modifier alone in a parameter list, like: foo(static) // // then treat it like modifier, and continue parsing the parameter. - if (isModifierKind(_currentToken.kind())) { + if (isModifierKind(_currentToken.kind)) { modifiers = Syntax.list([consumeToken(_currentToken)]); } else { - return null; + return undefined; } } - var identifier = eatIdentifierToken(); + // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + + var identifier = generatorParameterContext + ? enterYieldContextAnd(eatIdentifierToken) + : eatIdentifierToken(); + var questionToken = tryEatToken(SyntaxKind.QuestionToken); var typeAnnotation = parseOptionalTypeAnnotation(/*allowStringLiteral:*/ true); - var equalsValueClause: EqualsValueClauseSyntax = null; + var equalsValueClause: EqualsValueClauseSyntax = undefined; if (isEqualsValueClause(/*inParameter*/ true)) { - equalsValueClause = parseEqualsValueClause(/*allowIn:*/ true); + equalsValueClause = generatorParameterContext + ? exitYieldContextAnd(parseEqualsValueClause) + : parseEqualsValueClause(); } - return new syntaxFactory.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); + return new ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); } - function parseSyntaxList( - currentListType: ListParsingState, skippedTokens: ISyntaxToken[], processItems: (items: any[]) => void = null): T[] { + function parseSyntaxList(currentListType: ListParsingState, processItems?: (items: any[]) => void): T[] { var savedListParsingState = listParsingState; listParsingState |= (1 << currentListType); - var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); + var result = parseSyntaxListWorker(currentListType, processItems); listParsingState = savedListParsingState; return result; } - function parseSeparatedSyntaxList(currentListType: ListParsingState, skippedTokens: ISyntaxToken[]): T[] { + function parseSeparatedSyntaxList(currentListType: ListParsingState): ISeparatedSyntaxList { var savedListParsingState = listParsingState; listParsingState |= (1 << currentListType); - var result = parseSeparatedSyntaxListWorker(currentListType, skippedTokens); + var result = parseSeparatedSyntaxListWorker(currentListType); listParsingState = savedListParsingState; @@ -3710,8 +4070,7 @@ module TypeScript.Parser { } // Returns true if we should abort parsing. - function abortParsingListOrMoveToNextToken( - currentListType: ListParsingState, nodes: T[], separators: ISyntaxToken[], skippedTokens: ISyntaxToken[]): boolean { + function abortParsingListOrMoveToNextToken(currentListType: ListParsingState): boolean { // Ok. We're at a token that is not a terminator for the list and wasn't the start of // an item in the list. Definitely report an error for this token. reportUnexpectedTokenDiagnostic(currentListType); @@ -3731,72 +4090,45 @@ module TypeScript.Parser { // Otherwise, if none of the lists we're in can capture this token, then we need to // unilaterally skip it. Note: we've already reported an error above. - addSkippedTokenToList(nodes, separators, skippedTokens, consumeToken(currentToken())); - + skipToken(currentToken()); + // Continue parsing this list. Attach this token to whatever we've seen already. return false; } - - function addSkippedTokenToList( - nodes: T[], separators: ISyntaxToken[], skippedTokens: ISyntaxToken[], skippedToken: ISyntaxToken): void { - // Now, add this skipped token to the last item we successfully parsed in the list. Or - // add it to the list of skipped tokens if we haven't parsed anything. Our caller will - // have to deal with them. - // - // Note: we only bother doing this if we're creating a concrete syntax tree. - if (syntaxFactory.isConcrete) { - var length = nodes.length + (separators ? separators.length : 0); - for (var i = length - 1; i >= 0; i--) { - var array: ISyntaxNodeOrToken[] = separators && (i % 2 === 1) ? separators : nodes; - var arrayIndex = separators ? IntegerUtilities.integerDivide(i, 2) : i; + function tryParseExpectedListItem( + currentListType: ListParsingState, + inErrorRecovery: boolean, + items: T[], + processItems: (items: ISyntaxNodeOrToken[]) => void): void { + var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - var item = array[arrayIndex]; - var _lastToken = lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - array[arrayIndex] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } + if (item !== undefined) { + // Debug.assert(item !== undefined); + + items.push(item); + + if (processItems) { + processItems(items); } - - // Didn't have anything in the list we could add to. Add to the skipped items array - // for our caller to handle. - skippedTokens.push(skippedToken); } } - function tryParseExpectedListItem( - currentListType: ListParsingState, inErrorRecovery: boolean, items: ISyntaxElement[], processItems: (items: any[]) => void): boolean { - var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - - if (item === null) { - return false; - } - // Debug.assert(item !== null); - - items.push(item); - - if (processItems !== null) { - processItems(items); - } - - return true; - } - function listIsTerminated(currentListType: ListParsingState): boolean { return isExpectedListTerminator(currentListType) || - currentToken().kind() === SyntaxKind.EndOfFileToken; + currentToken().kind === SyntaxKind.EndOfFileToken; } - function parseSyntaxListWorker(currentListType: ListParsingState, skippedTokens: ISyntaxToken[], processItems: (items: any[]) => void ): T[] { - var items: T[] = getArray(); + function parseSyntaxListWorker(currentListType: ListParsingState, processItems: (items: ISyntaxNodeOrToken[]) => void ): T[] { + var items: T[] = []; while (true) { // Try to parse an item of the list. If we fail then decide if we need to abort or // continue parsing. - var succeeded = tryParseExpectedListItem(currentListType, /*inErrorRecovery:*/ false, items, processItems); + var oldItemsLength = items.length; + tryParseExpectedListItem(currentListType, /*inErrorRecovery:*/ false, items, processItems); - if (!succeeded) { + if (items.length === oldItemsLength) { // We weren't able to parse out a list element. // That may have been because the list is complete. In that case, break out @@ -3807,7 +4139,7 @@ module TypeScript.Parser { // List wasn't complete and we didn't get an item. Figure out if we should bail out // or skip a token and continue. - var abort = abortParsingListOrMoveToNextToken(currentListType, items, null, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType); if (abort) { break; } @@ -3817,18 +4149,11 @@ module TypeScript.Parser { // and didn't want to abort. Continue parsing elements. } - var result = Syntax.list(items); - - // Can't return if it has more then 1 element. In that case, the list will have been - // copied into the SyntaxList. - returnZeroLengthArray(items); - - return result; + return Syntax.list(items); } - function parseSeparatedSyntaxListWorker(currentListType: ListParsingState, skippedTokens: ISyntaxToken[]): T[] { - var nodes: T[] = getArray(); - var separators: ISyntaxToken[] = getArray(); + function parseSeparatedSyntaxListWorker(currentListType: ListParsingState): ISeparatedSyntaxList { + var nodesAndSeparators: ISyntaxNodeOrToken[] = []; // Debug.assert(nodes.length === 0); // Debug.assert(separators.length === 0); @@ -3846,11 +4171,12 @@ module TypeScript.Parser { // continue parsing. // Debug.assert(oldItemsCount % 2 === 0); - var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodes, null); + var oldArrayLength = nodesAndSeparators.length; + tryParseExpectedListItem(currentListType, inErrorRecovery, nodesAndSeparators, /*processItems:*/ undefined); - if (!succeeded) { + if (nodesAndSeparators.length === oldArrayLength) { // We weren't able to parse out a list element. - // Debug.assert(items === null || items.length % 2 === 0); + // Debug.assert(items === undefined || items.length % 2 === 0); // That may have been because the list is complete. In that case, break out // and return the items we were able parse. @@ -3860,7 +4186,7 @@ module TypeScript.Parser { // List wasn't complete and we didn't get an item. Figure out if we should bail out // or skip a token and continue. - var abort = abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType); if (abort) { break; } @@ -3882,10 +4208,10 @@ module TypeScript.Parser { // allow 'comma' as a separator (for error tolerance). We will later do a post pass // to report when a comma was used improperly in a list that needed semicolons. var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); + var tokenKind = _currentToken.kind; if (tokenKind === _separatorKind || tokenKind === SyntaxKind.CommaToken) { // Consume the last separator and continue parsing list elements. - separators.push(consumeToken(_currentToken)); + nodesAndSeparators.push(consumeToken(_currentToken)); continue; } @@ -3913,7 +4239,7 @@ module TypeScript.Parser { if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(/*allowWithoutNewline:*/ false)) { var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || Syntax.emptyToken(SyntaxKind.SemicolonToken); - separators.push(semicolonToken); + nodesAndSeparators.push(semicolonToken); // Debug.assert(items.length % 2 === 0); continue; } @@ -3923,7 +4249,7 @@ module TypeScript.Parser { // This time mark that we're in error recovery mode though. // // Note: trying to eat this token will emit the appropriate diagnostic. - separators.push(eatToken(_separatorKind)); + nodesAndSeparators.push(eatToken(_separatorKind)); // Now that we're in 'error recovery' mode we cantweak some parsing rules as // appropriate. For example, if we have: @@ -3939,14 +4265,7 @@ module TypeScript.Parser { inErrorRecovery = true; } - var result = Syntax.separatedList(nodes, separators); - - // Can't return if it has more then 0 elements. In that case, the list will have been - // copied into the SyntaxList. - returnZeroLengthArray(nodes); - returnZeroLengthArray(separators); - - return result; + return Syntax.separatedList(nodesAndSeparators); } function reportUnexpectedTokenDiagnostic(listType: ListParsingState): void { @@ -3981,8 +4300,7 @@ module TypeScript.Parser { case ListParsingState.ObjectType_TypeMembers: return isExpectedObjectType_TypeMembersTerminator(); case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); case ListParsingState.HeritageClause_TypeNameList: return isExpectedHeritageClause_TypeNameListTerminator(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); + case ListParsingState.VariableDeclaration_VariableDeclarators: return isExpectedVariableDeclaration_VariableDeclaratorsTerminator(); case ListParsingState.ArgumentList_AssignmentExpressions: return isExpectedArgumentList_AssignmentExpressionsTerminator(); case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); @@ -3997,32 +4315,32 @@ module TypeScript.Parser { } function isExpectedSourceUnit_ModuleElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.EndOfFileToken; + return currentToken().kind === SyntaxKind.EndOfFileToken; } function isExpectedEnumDeclaration_EnumElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedModuleDeclaration_ModuleElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedObjectType_TypeMembersTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedLiteralExpression_AssignmentExpressionsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBracketToken; + return currentToken().kind === SyntaxKind.CloseBracketToken; } function isExpectedTypeArgumentList_TypesTerminator(): boolean { var token = currentToken(); - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.GreaterThanToken) { return true; } @@ -4039,7 +4357,7 @@ module TypeScript.Parser { function isExpectedTupleType_TypesTerminator(): boolean { var token = currentToken(); - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.CloseBracketToken) { return true; } @@ -4049,7 +4367,7 @@ module TypeScript.Parser { } function isExpectedTypeParameterList_TypeParametersTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.GreaterThanToken) { return true; } @@ -4067,7 +4385,7 @@ module TypeScript.Parser { } function isExpectedParameterList_ParametersTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.CloseParenToken) { return true; } @@ -4088,7 +4406,7 @@ module TypeScript.Parser { } function isExpectedIndexSignature_ParametersTerminator() { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.CloseBracketToken) { return true; } @@ -4102,39 +4420,40 @@ module TypeScript.Parser { return false; } - function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(): boolean { - // This is the case when we're parsing variable declarations in a for/for-in statement. - var tokenKind = currentToken().kind(); + function isExpectedVariableDeclaration_VariableDeclaratorsTerminator(): boolean { + if (disallowInContext) { + // This is the case when we're parsing variable declarations in a for/for-in statement. + var tokenKind = currentToken().kind; - if (tokenKind === SyntaxKind.SemicolonToken || - tokenKind === SyntaxKind.CloseParenToken) { - return true; + if (tokenKind === SyntaxKind.SemicolonToken || + tokenKind === SyntaxKind.CloseParenToken) { + return true; + } + + if (tokenKind === SyntaxKind.InKeyword) { + return true; + } + + return false; } + else { + //// This is the case when we're parsing variable declarations in a variable statement. - if (tokenKind === SyntaxKind.InKeyword) { - return true; + // ERROR RECOVERY TWEAK: + // For better error recovery, if we see a => then we just stop immediately. We've got an + // arrow function here and it's going to be very unlikely that we'll resynchronize and get + // another variable declaration. + if (currentToken().kind === SyntaxKind.EqualsGreaterThanToken) { + return true; + } + + // We're done when we can eat a semicolon. + return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); } - - return false; - } - - function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(): boolean { - //// This is the case when we're parsing variable declarations in a variable statement. - - // ERROR RECOVERY TWEAK: - // For better error recovery, if we see a => then we just stop immediately. We've got an - // arrow function here and it's going to be very unlikely that we'll resynchronize and get - // another variable declaration. - if (currentToken().kind() === SyntaxKind.EqualsGreaterThanToken) { - return true; - } - - // We're done when we can eat a semicolon. - return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); } function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.OpenBraceToken || tokenKind === SyntaxKind.CloseBraceToken) { return true; } @@ -4143,7 +4462,7 @@ module TypeScript.Parser { } function isExpectedHeritageClause_TypeNameListTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.ExtendsKeyword || tokenKind === SyntaxKind.ImplementsKeyword) { return true; } @@ -4157,36 +4476,36 @@ module TypeScript.Parser { function isExpectedArgumentList_AssignmentExpressionsTerminator(): boolean { var token0 = currentToken(); - var tokenKind = token0.kind(); + var tokenKind = token0.kind; return tokenKind === SyntaxKind.CloseParenToken || tokenKind === SyntaxKind.SemicolonToken; } function isExpectedClassDeclaration_ClassElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedSwitchStatement_SwitchClausesTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedSwitchClause_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken || + return currentToken().kind === SyntaxKind.CloseBraceToken || isSwitchClause(); } function isExpectedBlock_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedTryBlock_StatementsTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; return tokenKind === SyntaxKind.CatchKeyword || tokenKind === SyntaxKind.FinallyKeyword; } function isExpectedCatchBlock_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.FinallyKeyword; + return currentToken().kind === SyntaxKind.FinallyKeyword; } function isExpectedListItem(currentListType: ListParsingState, inErrorRecovery: boolean): any { @@ -4201,22 +4520,21 @@ module TypeScript.Parser { // used so we can abort out of the try block if we see a 'catch' or 'finally' // keyword. There are no additional list items that they add, so we just // return 'false' here. - case ListParsingState.TryBlock_Statements: return false; - case ListParsingState.CatchBlock_Statements: return false; - case ListParsingState.EnumDeclaration_EnumElements: return isEnumElement(inErrorRecovery); - case ListParsingState.ObjectType_TypeMembers: return isTypeMember(inErrorRecovery); - case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return isHeritageClause(); - case ListParsingState.HeritageClause_TypeNameList: return isHeritageClauseTypeName(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return isVariableDeclarator(); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return isVariableDeclarator(); - case ListParsingState.ArgumentList_AssignmentExpressions: return isExpectedArgumentList_AssignmentExpression(); - case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return isPropertyAssignment(inErrorRecovery); - case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return isAssignmentOrOmittedExpression(); - case ListParsingState.ParameterList_Parameters: return isParameter(); - case ListParsingState.IndexSignature_Parameters: return isParameter(); - case ListParsingState.TypeArgumentList_Types: return isType(); - case ListParsingState.TypeParameterList_TypeParameters: return isTypeParameter(); - case ListParsingState.TupleType_Types: return isType(); + case ListParsingState.TryBlock_Statements: return false; + case ListParsingState.CatchBlock_Statements: return false; + case ListParsingState.EnumDeclaration_EnumElements: return isEnumElement(inErrorRecovery); + case ListParsingState.ObjectType_TypeMembers: return isTypeMember(inErrorRecovery); + case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return isHeritageClause(); + case ListParsingState.HeritageClause_TypeNameList: return isHeritageClauseTypeName(); + case ListParsingState.VariableDeclaration_VariableDeclarators: return isVariableDeclarator(); + case ListParsingState.ArgumentList_AssignmentExpressions: return isExpectedArgumentList_AssignmentExpression(); + case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return isPropertyAssignment(inErrorRecovery); + case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return isAssignmentOrOmittedExpression(); + case ListParsingState.ParameterList_Parameters: return isParameter(); + case ListParsingState.IndexSignature_Parameters: return isParameter(); + case ListParsingState.TypeArgumentList_Types: return isType(); + case ListParsingState.TypeParameterList_TypeParameters: return isTypeParameter(); + case ListParsingState.TupleType_Types: return isType(); default: throw Errors.invalidOperation(); } } @@ -4230,7 +4548,7 @@ module TypeScript.Parser { // If we're on a comma then the user has written something like "Foo(a,," or "Foo(,". // Instead of skipping the comma, create an empty expression to go before the comma // so that the tree is more well formed and doesn't have skipped tokens. - if (_currentToken.kind() === SyntaxKind.CommaToken) { + if (_currentToken.kind === SyntaxKind.CommaToken) { return true; } @@ -4239,55 +4557,53 @@ module TypeScript.Parser { function tryParseExpectedListItemWorker(currentListType: ListParsingState, inErrorRecovery: boolean): ISyntaxNodeOrToken { switch (currentListType) { - case ListParsingState.SourceUnit_ModuleElements: return tryParseModuleElement(inErrorRecovery); - case ListParsingState.ClassDeclaration_ClassElements: return tryParseClassElement(inErrorRecovery); - case ListParsingState.ModuleDeclaration_ModuleElements: return tryParseModuleElement(inErrorRecovery); - case ListParsingState.SwitchStatement_SwitchClauses: return tryParseSwitchClause(); - case ListParsingState.SwitchClause_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.Block_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.TryBlock_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.CatchBlock_Statements: return tryParseStatement(inErrorRecovery); - case ListParsingState.EnumDeclaration_EnumElements: return tryParseEnumElement(inErrorRecovery); - case ListParsingState.ObjectType_TypeMembers: return tryParseTypeMember(inErrorRecovery); - case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return tryParseHeritageClause(); - case ListParsingState.HeritageClause_TypeNameList: return tryParseHeritageClauseTypeName(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return tryParseVariableDeclarator(/*allowIn:*/ true, /*allowIdentifierName:*/ false); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return tryParseVariableDeclarator(/*allowIn:*/ false, /*allowIdentifierName:*/ false); - case ListParsingState.ArgumentList_AssignmentExpressions: return tryParseArgumentListExpression(); - case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return tryParsePropertyAssignment(inErrorRecovery); - case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return tryParseAssignmentOrOmittedExpression(); - case ListParsingState.ParameterList_Parameters: return tryParseParameter(); - case ListParsingState.IndexSignature_Parameters: return tryParseParameter(); - case ListParsingState.TypeArgumentList_Types: return tryParseType(); - case ListParsingState.TypeParameterList_TypeParameters: return tryParseTypeParameter(); - case ListParsingState.TupleType_Types: return tryParseType(); + case ListParsingState.SourceUnit_ModuleElements: return tryParseModuleElement(inErrorRecovery); + case ListParsingState.ClassDeclaration_ClassElements: return tryParseClassElement(inErrorRecovery); + case ListParsingState.ModuleDeclaration_ModuleElements: return tryParseModuleElement(inErrorRecovery); + case ListParsingState.SwitchStatement_SwitchClauses: return tryParseSwitchClause(); + case ListParsingState.SwitchClause_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.Block_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.TryBlock_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.CatchBlock_Statements: return tryParseStatement(inErrorRecovery); + case ListParsingState.EnumDeclaration_EnumElements: return tryParseEnumElement(inErrorRecovery); + case ListParsingState.ObjectType_TypeMembers: return tryParseTypeMember(inErrorRecovery); + case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return tryParseHeritageClause(); + case ListParsingState.HeritageClause_TypeNameList: return tryParseHeritageClauseTypeName(); + case ListParsingState.VariableDeclaration_VariableDeclarators: return tryParseVariableDeclarator(); + case ListParsingState.ArgumentList_AssignmentExpressions: return tryParseArgumentListExpression(); + case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return tryParsePropertyAssignment(inErrorRecovery); + case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return tryParseAssignmentOrOmittedExpression(); + case ListParsingState.ParameterList_Parameters: return tryParseParameter(); + case ListParsingState.IndexSignature_Parameters: return tryParseParameter(); + case ListParsingState.TypeArgumentList_Types: return tryParseType(); + case ListParsingState.TypeParameterList_TypeParameters: return tryParseTypeParameter(); + case ListParsingState.TupleType_Types: return tryParseType(); default: throw Errors.invalidOperation(); } } function getExpectedListElementType(currentListType: ListParsingState): string { switch (currentListType) { - case ListParsingState.SourceUnit_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return '{'; - case ListParsingState.ClassDeclaration_ClassElements: return getLocalizedText(DiagnosticCode.constructor_function_accessor_or_variable, null); - case ListParsingState.ModuleDeclaration_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case ListParsingState.SwitchStatement_SwitchClauses: return getLocalizedText(DiagnosticCode.case_or_default_clause, null); - case ListParsingState.SwitchClause_Statements: return getLocalizedText(DiagnosticCode.statement, null); - case ListParsingState.Block_Statements: return getLocalizedText(DiagnosticCode.statement, null); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return getLocalizedText(DiagnosticCode.identifier, null); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return getLocalizedText(DiagnosticCode.identifier, null); - case ListParsingState.EnumDeclaration_EnumElements: return getLocalizedText(DiagnosticCode.identifier, null); - case ListParsingState.ObjectType_TypeMembers: return getLocalizedText(DiagnosticCode.call_construct_index_property_or_function_signature, null); - case ListParsingState.ArgumentList_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, null); - case ListParsingState.HeritageClause_TypeNameList: return getLocalizedText(DiagnosticCode.type_name, null); - case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return getLocalizedText(DiagnosticCode.property_or_accessor, null); - case ListParsingState.ParameterList_Parameters: return getLocalizedText(DiagnosticCode.parameter, null); - case ListParsingState.IndexSignature_Parameters: return getLocalizedText(DiagnosticCode.parameter, null); - case ListParsingState.TypeArgumentList_Types: return getLocalizedText(DiagnosticCode.type, null); - case ListParsingState.TypeParameterList_TypeParameters: return getLocalizedText(DiagnosticCode.type_parameter, null); - case ListParsingState.TupleType_Types: return getLocalizedText(DiagnosticCode.type, null); - case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, null); - default: throw Errors.invalidOperation(); + case ListParsingState.SourceUnit_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); + case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return '{'; + case ListParsingState.ClassDeclaration_ClassElements: return getLocalizedText(DiagnosticCode.constructor_function_accessor_or_variable, undefined); + case ListParsingState.ModuleDeclaration_ModuleElements: return getLocalizedText(DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); + case ListParsingState.SwitchStatement_SwitchClauses: return getLocalizedText(DiagnosticCode.case_or_default_clause, undefined); + case ListParsingState.SwitchClause_Statements: return getLocalizedText(DiagnosticCode.statement, undefined); + case ListParsingState.Block_Statements: return getLocalizedText(DiagnosticCode.statement, undefined); + case ListParsingState.VariableDeclaration_VariableDeclarators: return getLocalizedText(DiagnosticCode.identifier, undefined); + case ListParsingState.EnumDeclaration_EnumElements: return getLocalizedText(DiagnosticCode.identifier, undefined); + case ListParsingState.ObjectType_TypeMembers: return getLocalizedText(DiagnosticCode.call_construct_index_property_or_function_signature, undefined); + case ListParsingState.ArgumentList_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, undefined); + case ListParsingState.HeritageClause_TypeNameList: return getLocalizedText(DiagnosticCode.type_name, undefined); + case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return getLocalizedText(DiagnosticCode.property_or_accessor, undefined); + case ListParsingState.ParameterList_Parameters: return getLocalizedText(DiagnosticCode.parameter, undefined); + case ListParsingState.IndexSignature_Parameters: return getLocalizedText(DiagnosticCode.parameter, undefined); + case ListParsingState.TypeArgumentList_Types: return getLocalizedText(DiagnosticCode.type, undefined); + case ListParsingState.TypeParameterList_TypeParameters: return getLocalizedText(DiagnosticCode.type_parameter, undefined); + case ListParsingState.TupleType_Types: return getLocalizedText(DiagnosticCode.type, undefined); + case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return getLocalizedText(DiagnosticCode.expression, undefined); + default: throw Errors.invalidOperation(); } } @@ -4387,33 +4703,35 @@ module TypeScript.Parser { // consume the token and add it to our list of 'skipped tokens'. We will then repeat the // above algorithm until we resynchronize at some point. enum ListParsingState { - SourceUnit_ModuleElements = 0, - ClassDeclaration_ClassElements = 1, - ModuleDeclaration_ModuleElements = 2, - SwitchStatement_SwitchClauses = 3, - SwitchClause_Statements = 4, - Block_Statements = 5, - TryBlock_Statements = 6, - CatchBlock_Statements = 7, - EnumDeclaration_EnumElements = 8, - ObjectType_TypeMembers = 9, - ClassOrInterfaceDeclaration_HeritageClauses = 10, - HeritageClause_TypeNameList = 11, - VariableDeclaration_VariableDeclarators_AllowIn = 12, - VariableDeclaration_VariableDeclarators_DisallowIn = 13, - ArgumentList_AssignmentExpressions = 14, - ObjectLiteralExpression_PropertyAssignments = 15, - ArrayLiteralExpression_AssignmentExpressions = 16, - ParameterList_Parameters = 17, - IndexSignature_Parameters = 18, - TypeArgumentList_Types = 19, - TypeParameterList_TypeParameters = 20, - TupleType_Types = 21, + SourceUnit_ModuleElements, + ClassDeclaration_ClassElements, + ModuleDeclaration_ModuleElements, + SwitchStatement_SwitchClauses, + SwitchClause_Statements, + Block_Statements, + TryBlock_Statements, + CatchBlock_Statements, + EnumDeclaration_EnumElements, + ObjectType_TypeMembers, + ClassOrInterfaceDeclaration_HeritageClauses, + HeritageClause_TypeNameList, + VariableDeclaration_VariableDeclarators, + ArgumentList_AssignmentExpressions, + ObjectLiteralExpression_PropertyAssignments, + ArrayLiteralExpression_AssignmentExpressions, + ParameterList_Parameters, + IndexSignature_Parameters, + TypeArgumentList_Types, + TypeParameterList_TypeParameters, + TupleType_Types, FirstListParsingState = SourceUnit_ModuleElements, LastListParsingState = TupleType_Types, } + // We use this enum to set bits. So make sure we have enough bits available. + Debug.assert(ListParsingState.LastListParsingState <= 30); + // We keep the parser around as a singleton. This is because calling createParser is actually // expensive in V8 currently. We then clear it after a parse so that it doesn't keep state // alive unintentionally. diff --git a/src/services/syntax/prettyPrinter.ts b/src/services/syntax/prettyPrinter.ts index df22bcab559..4bd57ffb62f 100644 --- a/src/services/syntax/prettyPrinter.ts +++ b/src/services/syntax/prettyPrinter.ts @@ -16,11 +16,11 @@ module TypeScript.PrettyPrinter { } private newLineCountBetweenModuleElements(element1: IModuleElementSyntax, element2: IModuleElementSyntax): number { - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return 0; } - if (lastToken(element1).kind() === SyntaxKind.CloseBraceToken) { + if (lastToken(element1).kind === SyntaxKind.CloseBraceToken) { return 2; } @@ -28,19 +28,19 @@ module TypeScript.PrettyPrinter { } private newLineCountBetweenClassElements(element1: IClassElementSyntax, element2: IClassElementSyntax): number { - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return 0; } return 1; } - private newLineCountBetweenStatements(element1: IClassElementSyntax, element2: IClassElementSyntax): number { - if (element1 === null || element2 === null) { + private newLineCountBetweenStatements(element1: IStatementSyntax, element2: IStatementSyntax): number { + if (!element1 || !element2) { return 0; } - if (lastToken(element1).kind() === SyntaxKind.CloseBraceToken) { + if (lastToken(element1).kind === SyntaxKind.CloseBraceToken) { return 2; } @@ -48,7 +48,7 @@ module TypeScript.PrettyPrinter { } private newLineCountBetweenSwitchClauses(element1: ISwitchClauseSyntax, element2: ISwitchClauseSyntax): number { - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return 0; } @@ -120,7 +120,7 @@ module TypeScript.PrettyPrinter { } private appendToken(token: ISyntaxToken): void { - if (token !== null && token.fullWidth() > 0) { + if (token && token.fullWidth() > 0) { this.appendIndentationIfAfterNewLine(); this.appendText(token.text()); } @@ -150,7 +150,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); } - visitNodeOrToken(this, childAt(list, i)); + visitNodeOrToken(this, list[i]); } else { this.appendToken(childAt(list, i)); @@ -165,7 +165,7 @@ module TypeScript.PrettyPrinter { this.ensureNewLine(); } - visitNodeOrToken(this, childAt(list, i)); + visitNodeOrToken(this, list[i]); } else { this.appendToken(childAt(list, i)); @@ -174,7 +174,7 @@ module TypeScript.PrettyPrinter { } private appendModuleElements(list: IModuleElementSyntax[]): void { - var lastModuleElement: IModuleElementSyntax = null; + var lastModuleElement: IModuleElementSyntax = undefined; for (var i = 0, n = list.length; i < n; i++) { var moduleElement = list[i]; var newLineCount = this.newLineCountBetweenModuleElements(lastModuleElement, moduleElement); @@ -236,7 +236,7 @@ module TypeScript.PrettyPrinter { this.indentation++; - var lastClassElement: IClassElementSyntax = null; + var lastClassElement: IClassElementSyntax = undefined; for (var i = 0, n = node.classElements.length; i < n; i++) { var classElement = node.classElements[i]; var newLineCount = this.newLineCountBetweenClassElements(lastClassElement, classElement); @@ -278,7 +278,7 @@ module TypeScript.PrettyPrinter { } for (var i = 0, n = childCount(node.typeMembers); i < n; i++) { - visitNodeOrToken(this, childAt(node.typeMembers, i)); + visitNodeOrToken(this, node.typeMembers[i]); if (appendNewLines) { this.ensureNewLine(); @@ -305,9 +305,6 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendElement(node.name); this.ensureSpace(); - this.appendToken(node.stringLiteral); - this.ensureSpace(); - this.appendToken(node.openBraceToken); this.ensureNewLine(); @@ -319,13 +316,13 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBraceToken); } - private appendBlockOrSemicolon(block: BlockSyntax, semicolonToken: ISyntaxToken) { - if (block) { + private appendBlockOrSemicolon(body: BlockSyntax | ISyntaxToken) { + if (body.kind === SyntaxKind.Block) { this.ensureSpace(); - visitNodeOrToken(this, block); + visitNodeOrToken(this, body); } else { - this.appendToken(semicolonToken); + this.appendToken(body); } } @@ -336,7 +333,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.identifier); this.appendNode(node.callSignature); - this.appendBlockOrSemicolon(node.block, node.semicolonToken); + this.appendBlockOrSemicolon(node.body); } public visitVariableStatement(node: VariableStatementSyntax): void { @@ -353,7 +350,7 @@ module TypeScript.PrettyPrinter { } public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendNode(node.equalsValueClause); } @@ -390,8 +387,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.equalsGreaterThanToken); this.ensureSpace(); - this.appendNode(node.block); - this.appendElement(node.expression); + visitNodeOrToken(this, node.body); } public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): void { @@ -399,8 +395,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.equalsGreaterThanToken); this.ensureSpace(); - this.appendNode(node.block); - this.appendElement(node.expression); + visitNodeOrToken(this, node.body); } public visitQualifiedName(node: QualifiedNameSyntax): void { @@ -427,6 +422,20 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBracketToken); } + public visitParenthesizedType(node: ParenthesizedTypeSyntax): void { + this.appendToken(node.openParenToken); + this.appendElement(node.type); + this.appendToken(node.closeParenToken); + } + + public visitUnionType(node: UnionTypeSyntax): void { + this.appendElement(node.left); + this.ensureSpace(); + this.appendToken(node.barToken); + this.ensureSpace(); + this.appendElement(node.right); + } + public visitConstructorType(node: ConstructorTypeSyntax): void { this.appendToken(node.newKeyword); this.ensureSpace(); @@ -472,7 +481,7 @@ module TypeScript.PrettyPrinter { } private appendStatements(statements: IStatementSyntax[]): void { - var lastStatement: IStatementSyntax = null; + var lastStatement: IStatementSyntax = undefined; for (var i = 0, n = statements.length; i < n; i++) { var statement = statements[i]; @@ -538,7 +547,7 @@ module TypeScript.PrettyPrinter { public visitBinaryExpression(node: BinaryExpressionSyntax): void { visitNodeOrToken(this, node.left); - if (node.kind() !== SyntaxKind.CommaExpression) { + if (node.operatorToken.kind !== SyntaxKind.CommaToken) { this.ensureSpace(); } @@ -565,7 +574,7 @@ module TypeScript.PrettyPrinter { } public visitMethodSignature(node: MethodSignatureSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.questionToken); visitNodeOrToken(this, node.callSignature); } @@ -578,7 +587,7 @@ module TypeScript.PrettyPrinter { } public visitPropertySignature(node: PropertySignatureSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.questionToken); this.appendNode(node.typeAnnotation); } @@ -614,7 +623,7 @@ module TypeScript.PrettyPrinter { } private appendBlockOrStatement(node: IStatementSyntax): void { - if (node.kind() === SyntaxKind.Block) { + if (node.kind === SyntaxKind.Block) { this.ensureSpace(); visitNodeOrToken(this, node); } @@ -640,7 +649,7 @@ module TypeScript.PrettyPrinter { this.ensureNewLine(); this.appendToken(node.elseKeyword); - if (node.statement.kind() === SyntaxKind.IfStatement) { + if (node.statement.kind === SyntaxKind.IfStatement) { this.ensureSpace(); visitNodeOrToken(this, node.statement); } @@ -657,7 +666,7 @@ module TypeScript.PrettyPrinter { public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void { this.appendToken(node.constructorKeyword); visitNodeOrToken(this, node.callSignature); - this.appendBlockOrSemicolon(node.block, node.semicolonToken); + this.appendBlockOrSemicolon(node.body); } public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): void { @@ -670,9 +679,9 @@ module TypeScript.PrettyPrinter { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { this.appendSpaceList(node.modifiers); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); - this.appendBlockOrSemicolon(node.block, node.semicolonToken); + this.appendBlockOrSemicolon(node.body); } public visitGetAccessor(node: GetAccessorSyntax): void { @@ -680,7 +689,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.getKeyword); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); visitNodeOrToken(this, node.block); @@ -691,7 +700,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.setKeyword); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature) this.ensureSpace(); visitNodeOrToken(this, node.block); @@ -743,7 +752,7 @@ module TypeScript.PrettyPrinter { this.appendToken(node.openBraceToken); this.ensureNewLine(); - var lastSwitchClause: ISwitchClauseSyntax = null; + var lastSwitchClause: ISwitchClauseSyntax = undefined; for (var i = 0, n = node.switchClauses.length; i < n; i++) { var switchClause = node.switchClauses[i]; @@ -760,9 +769,9 @@ module TypeScript.PrettyPrinter { } private appendSwitchClauseStatements(node: ISwitchClauseSyntax): void { - if (childCount(node.statements) === 1 && childAt(node.statements, 0).kind() === SyntaxKind.Block) { + if (childCount(node.statements) === 1 && childAt(node.statements, 0).kind === SyntaxKind.Block) { this.ensureSpace(); - visitNodeOrToken(this, childAt(node.statements, 0)); + visitNodeOrToken(this, node.statements[0]); } else if (childCount(node.statements) > 0) { this.ensureNewLine(); @@ -811,8 +820,7 @@ module TypeScript.PrettyPrinter { this.appendToken(node.forKeyword); this.ensureSpace(); this.appendToken(node.openParenToken); - this.appendNode(node.variableDeclaration); - this.appendElement(node.initializer); + visitNodeOrToken(this, node.initializer); this.appendToken(node.firstSemicolonToken); if (node.condition) { @@ -835,12 +843,11 @@ module TypeScript.PrettyPrinter { this.appendToken(node.forKeyword); this.ensureSpace(); this.appendToken(node.openParenToken); - this.appendNode(node.variableDeclaration); this.appendElement(node.left); this.ensureSpace(); this.appendToken(node.inKeyword); this.ensureSpace(); - this.appendElement(node.expression); + this.appendElement(node.right); this.appendToken(node.closeParenToken); this.appendBlockOrStatement(node.statement); } @@ -881,7 +888,7 @@ module TypeScript.PrettyPrinter { } public visitEnumElement(node: EnumElementSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.ensureSpace(); this.appendNode(node.equalsValueClause); } @@ -912,15 +919,21 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBraceToken); } + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { + this.appendToken(node.openBracketToken); + visitNodeOrToken(this, node.expression); + this.appendToken(node.closeBracketToken); + } + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.colonToken); this.ensureSpace(); visitNodeOrToken(this, node.expression); } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); visitNodeOrToken(this, node.block); @@ -1005,9 +1018,33 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.expression); } + public visitYieldExpression(node: YieldExpressionSyntax): void { + this.appendToken(node.yieldKeyword); + this.ensureSpace(); + visitNodeOrToken(this, node.expression); + } + public visitDebuggerStatement(node: DebuggerStatementSyntax): void { this.appendToken(node.debuggerKeyword); this.appendToken(node.semicolonToken); } + + public visitTemplateExpression(node: TemplateExpressionSyntax): void { + this.appendToken(node.templateStartToken); + this.ensureSpace(); + this.appendSpaceList(node.templateClauses); + } + + public visitTemplateClause(node: TemplateClauseSyntax): void { + visitNodeOrToken(this, node.expression); + this.ensureSpace(); + this.appendToken(node.templateMiddleOrEndToken); + } + + public visitTemplateAccessExpression(node: TemplateAccessExpressionSyntax): void { + visitNodeOrToken(this, node.expression); + this.ensureSpace(); + visitNodeOrToken(this, node.templateExpression); + } } } \ No newline at end of file diff --git a/src/services/syntax/references.ts b/src/services/syntax/references.ts index a4eb9efc595..5c1a6818ccc 100644 --- a/src/services/syntax/references.ts +++ b/src/services/syntax/references.ts @@ -17,9 +17,7 @@ /// /// /// -/// /// -/// // SyntaxDedenter depends on SyntaxRewriter // /// @@ -41,6 +39,7 @@ /// // Concrete nodes depend on the parser. +/// /// // SyntaxTree depends on PositionTrackingWalker diff --git a/src/services/syntax/scanner.ts b/src/services/syntax/scanner.ts index 29ced029f1c..54f05890e3e 100644 --- a/src/services/syntax/scanner.ts +++ b/src/services/syntax/scanner.ts @@ -60,84 +60,47 @@ module TypeScript.Scanner { // This gives us 23bit for width (or 8MB of width which should be enough for any codebase). enum ScannerConstants { - LargeTokenFullStartShift = 4, - LargeTokenFullWidthShift = 7, - LargeTokenLeadingTriviaBitMask = 0x01, // 00000001 - LargeTokenLeadingCommentBitMask = 0x02, // 00000010 - LargeTokenTrailingTriviaBitMask = 0x04, // 00000100 - LargeTokenTrailingCommentBitMask = 0x08, // 00001000 - LargeTokenTriviaBitMask = 0x0F, // 00001111 + LargeTokenFullWidthShift = 3, - FixedWidthTokenFullStartShift = 7, - FixedWidthTokenMaxFullStart = 0x7FFFFF, // 23 ones. + WhitespaceTrivia = 0x01, // 00000001 + NewlineTrivia = 0x02, // 00000010 + CommentTrivia = 0x04, // 00000100 + TriviaMask = 0x07, // 00000111 - SmallTokenFullWidthShift = 7, - SmallTokenFullStartShift = 12, - SmallTokenMaxFullStart = 0x3FFFF, // 18 ones. - SmallTokenMaxFullWidth = 0x1F, // 5 ones - SmallTokenFullWidthMask = 0x1F, // 00011111 - - KindMask = 0x7F, // 01111111 - IsVariableWidthMask = 0x80, // 10000000 + KindMask = 0x7F, // 01111111 + IsVariableWidthMask = 0x80, // 10000000 } - // Make sure our math works for packing/unpacking large fullStarts. - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(1 << 26, 3)) === (1 << 26)); - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(3 << 25, 1)) === (3 << 25)); - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(10 << 23, 2)) === (10 << 23)); - - function fixedWidthTokenPackData(fullStart: number, kind: SyntaxKind) { - return (fullStart << ScannerConstants.FixedWidthTokenFullStartShift) | kind; + function largeTokenPackData(fullWidth: number, leadingTriviaInfo: number) { + return (fullWidth << ScannerConstants.LargeTokenFullWidthShift) | leadingTriviaInfo; } - function fixedWidthTokenUnpackFullStart(packedData: number) { - return packedData >> ScannerConstants.FixedWidthTokenFullStartShift; + function largeTokenUnpackFullWidth(packedFullWidthAndInfo: number): number { + return packedFullWidthAndInfo >> ScannerConstants.LargeTokenFullWidthShift; } - function smallTokenPackData(fullStart: number, fullWidth: number, kind: SyntaxKind) { - return (fullStart << ScannerConstants.SmallTokenFullStartShift) | - (fullWidth << ScannerConstants.SmallTokenFullWidthShift) | - kind; - } - - function smallTokenUnpackFullWidth(packedData: number): SyntaxKind { - return (packedData >> ScannerConstants.SmallTokenFullWidthShift) & ScannerConstants.SmallTokenFullWidthMask; - } - - function smallTokenUnpackFullStart(packedData: number): number { - return packedData >> ScannerConstants.SmallTokenFullStartShift; - } - - function largeTokenPackFullStartAndInfo(fullStart: number, triviaInfo: number): number { - return (fullStart << ScannerConstants.LargeTokenFullStartShift) | triviaInfo; - } - - function largeTokenUnpackFullWidth(packedFullWidthAndKind: number) { - return packedFullWidthAndKind >> ScannerConstants.LargeTokenFullWidthShift; - } - - function largeTokenUnpackFullStart(packedFullStartAndInfo: number): number { - return packedFullStartAndInfo >> ScannerConstants.LargeTokenFullStartShift; + function largeTokenUnpackLeadingTriviaInfo(packedFullWidthAndInfo: number): number { + return packedFullWidthAndInfo & ScannerConstants.TriviaMask; } function largeTokenUnpackHasLeadingTrivia(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenLeadingTriviaBitMask) !== 0; + return largeTokenUnpackLeadingTriviaInfo(packed) !== 0; } - function largeTokenUnpackHasTrailingTrivia(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenTrailingTriviaBitMask) !== 0; + function hasComment(info: number) { + return (info & ScannerConstants.CommentTrivia) !== 0; + } + + function hasNewLine(info: number) { + return (info & ScannerConstants.NewlineTrivia) !== 0; + } + + function largeTokenUnpackHasLeadingNewLine(packed: number): boolean { + return hasNewLine(largeTokenUnpackLeadingTriviaInfo(packed)); } function largeTokenUnpackHasLeadingComment(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenLeadingCommentBitMask) !== 0; - } - - function largeTokenUnpackHasTrailingComment(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenTrailingCommentBitMask) !== 0; - } - - function largeTokenUnpackTriviaInfo(packed: number): number { - return packed & ScannerConstants.LargeTokenTriviaBitMask; + return hasComment(largeTokenUnpackLeadingTriviaInfo(packed)); } var isKeywordStartCharacter: number[] = ArrayUtilities.createArray(CharacterCodes.maxAsciiCharacter, 0); @@ -166,7 +129,7 @@ module TypeScript.Scanner { // These tokens are contextually created based on parsing decisions. We can't reuse // them in incremental scenarios as we may be in a context where the parser would not // create them. - switch (token.kind()) { + switch (token.kind) { // Created by the parser when it sees / or /= in a location where it needs an expression. case SyntaxKind.RegularExpressionLiteral: @@ -178,12 +141,17 @@ module TypeScript.Scanner { case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: return true; + // Created by the parser when it sees } while parsing a template expression. + case SyntaxKind.TemplateMiddleToken: + case SyntaxKind.TemplateEndToken: + return true; + default: return token.isKeywordConvertedToIdentifier(); } } - var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; + var lastTokenInfo = { leadingTriviaWidth: -1 }; var lastTokenInfoTokenID: number = -1; var triviaScanner = createScannerInternal(ts.ScriptTarget.Latest, SimpleText.fromString(""), () => { }); @@ -207,15 +175,7 @@ module TypeScript.Scanner { return Syntax.emptyTriviaList; } - return triviaScanner.scanTrivia(token, text, /*isTrailing:*/ false); - } - - function trailingTrivia(token: IScannerToken, text: ISimpleText): ISyntaxTriviaList { - if (!token.hasTrailingTrivia()) { - return Syntax.emptyTriviaList; - } - - return triviaScanner.scanTrivia(token, text, /*isTrailing:*/ true); + return triviaScanner.scanTrivia(token, text); } function leadingTriviaWidth(token: IScannerToken, text: ISimpleText): number { @@ -227,15 +187,6 @@ module TypeScript.Scanner { return lastTokenInfo.leadingTriviaWidth; } - function trailingTriviaWidth(token: IScannerToken, text: ISimpleText): number { - if (!token.hasTrailingTrivia()) { - return 0; - } - - fillSizeInfo(token, text); - return token.fullWidth() - lastTokenInfo.leadingTriviaWidth - lastTokenInfo.width; - } - function tokenIsIncrementallyUnusable(token: IScannerToken): boolean { // No scanner tokens make their *containing node* incrementally unusable. // Note: several scanner tokens may themselves be unusable. i.e. if the parser asks @@ -246,50 +197,56 @@ module TypeScript.Scanner { } class FixedWidthTokenWithNoTrivia implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + public parent: ISyntaxElement; + public childCount: number; - constructor(private _packedData: number) { + constructor(private _fullStart: number, public kind: SyntaxKind) { } public setFullStart(fullStart: number): void { - this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); + this._fullStart = fullStart; } + + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public isIncrementallyUnusable(): boolean { return false; } public isKeywordConvertedToIdentifier(): boolean { return false; } - public hasSkippedToken(): boolean { return false; } - public fullText(): string { return SyntaxFacts.getText(this.kind()); } + public fullText(): string { return SyntaxFacts.getText(this.kind); } public text(): string { return this.fullText(); } public leadingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } - public trailingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } public leadingTriviaWidth(): number { return 0; } - public trailingTriviaWidth(): number { return 0; } - public kind(): SyntaxKind { return this._packedData & ScannerConstants.KindMask; } - public fullWidth(): number { return this.fullText().length; } - public fullStart(): number { return fixedWidthTokenUnpackFullStart(this._packedData); } + public fullWidth(): number { return fixedWidthTokenLength(this.kind); } + public fullStart(): number { return this._fullStart; } public hasLeadingTrivia(): boolean { return false; } - public hasTrailingTrivia(): boolean { return false; } + public hasLeadingNewLine(): boolean { return false; } + public hasLeadingSkippedToken(): boolean { return false; } public hasLeadingComment(): boolean { return false; } - public hasTrailingComment(): boolean { return false; } - public clone(): ISyntaxToken { return new FixedWidthTokenWithNoTrivia(this._packedData); } + + public clone(): ISyntaxToken { return new FixedWidthTokenWithNoTrivia(this._fullStart, this.kind); } } + FixedWidthTokenWithNoTrivia.prototype.childCount = 0; class LargeScannerToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + public parent: ISyntaxElement; + public childCount: number; private cachedText: string; - constructor(private _packedFullStartAndInfo: number, private _packedFullWidthAndKind: number, cachedText: string) { + + constructor(private _fullStart: number, public kind: SyntaxKind, private _packedFullWidthAndInfo: number, cachedText: string) { if (cachedText !== undefined) { this.cachedText = cachedText; } } public setFullStart(fullStart: number): void { - this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, - largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); + this._fullStart = fullStart; } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } + private syntaxTreeText(text: ISimpleText) { var result = text || syntaxTree(this).text; Debug.assert(result); @@ -298,7 +255,6 @@ module TypeScript.Scanner { public isIncrementallyUnusable(): boolean { return tokenIsIncrementallyUnusable(this); } public isKeywordConvertedToIdentifier(): boolean { return false; } - public hasSkippedToken(): boolean { return false; } public fullText(text?: ISimpleText): string { return fullText(this, this.syntaxTreeText(text)); @@ -306,29 +262,23 @@ module TypeScript.Scanner { public text(): string { var cachedText = this.cachedText; - return cachedText !== undefined ? cachedText : SyntaxFacts.getText(this.kind()); + return cachedText !== undefined ? cachedText : SyntaxFacts.getText(this.kind); } public leadingTrivia(text?: ISimpleText): ISyntaxTriviaList { return leadingTrivia(this, this.syntaxTreeText(text)); } - public trailingTrivia(text?: ISimpleText): ISyntaxTriviaList { return trailingTrivia(this, this.syntaxTreeText(text)); } + public leadingTriviaWidth(text?: ISimpleText): number { return leadingTriviaWidth(this, this.syntaxTreeText(text)); } - public leadingTriviaWidth(text?: ISimpleText): number { - return leadingTriviaWidth(this, this.syntaxTreeText(text)); - } + public fullWidth(): number { return largeTokenUnpackFullWidth(this._packedFullWidthAndInfo); } + public fullStart(): number { return this._fullStart; } - public trailingTriviaWidth(text?: ISimpleText): number { - return trailingTriviaWidth(this, this.syntaxTreeText(text)); - } + public hasLeadingTrivia(): boolean { return largeTokenUnpackHasLeadingTrivia(this._packedFullWidthAndInfo); } + public hasLeadingNewLine(): boolean { return largeTokenUnpackHasLeadingNewLine(this._packedFullWidthAndInfo); } + public hasLeadingComment(): boolean { return largeTokenUnpackHasLeadingComment(this._packedFullWidthAndInfo); } + public hasLeadingSkippedToken(): boolean { return false; } - public kind(): SyntaxKind { return this._packedFullWidthAndKind & ScannerConstants.KindMask; } - public fullWidth(): number { return largeTokenUnpackFullWidth(this._packedFullWidthAndKind); } - public fullStart(): number { return largeTokenUnpackFullStart(this._packedFullStartAndInfo); } - public hasLeadingTrivia(): boolean { return largeTokenUnpackHasLeadingTrivia(this._packedFullStartAndInfo); } - public hasTrailingTrivia(): boolean { return largeTokenUnpackHasTrailingTrivia(this._packedFullStartAndInfo); } - public hasLeadingComment(): boolean { return largeTokenUnpackHasLeadingComment(this._packedFullStartAndInfo); } - public hasTrailingComment(): boolean { return largeTokenUnpackHasTrailingComment(this._packedFullStartAndInfo); } - public clone(): ISyntaxToken { return new LargeScannerToken(this._packedFullStartAndInfo, this._packedFullWidthAndKind, this.cachedText); } + public clone(): ISyntaxToken { return new LargeScannerToken(this._fullStart, this.kind, this._packedFullWidthAndInfo, this.cachedText); } } + LargeScannerToken.prototype.childCount = 0; export interface DiagnosticCallback { (position: number, width: number, key: string, arguments: any[]): void; @@ -336,12 +286,11 @@ module TypeScript.Scanner { interface TokenInfo { leadingTriviaWidth: number; - width: number; } interface IScannerInternal extends IScanner { fillTokenInfo(token: IScannerToken, text: ISimpleText, tokenInfo: TokenInfo): void; - scanTrivia(token: IScannerToken, text: ISimpleText, isTrailing: boolean): ISyntaxTriviaList; + scanTrivia(token: IScannerToken, text: ISimpleText): ISyntaxTriviaList; } export interface IScanner { @@ -368,12 +317,13 @@ module TypeScript.Scanner { } function reset(_text: ISimpleText, _start: number, _end: number) { - Debug.assert(_start <= _text.length(), "Token's start was not within the bounds of text: " + _start + " - [0, " + _text.length() + ")"); - Debug.assert(_end <= _text.length(), "Token's end was not within the bounds of text: " + _end + " - [0, " + _text.length() + ")"); + var textLength = _text.length(); + Debug.assert(_start <= textLength, "Token's start was not within the bounds of text."); + Debug.assert(_end <= textLength, "Token's end was not within the bounds of text:"); if (!str || text !== _text) { text = _text; - str = _text.substr(0, _text.length()); + str = _text.substr(0, textLength); } start = _start; @@ -383,15 +333,13 @@ module TypeScript.Scanner { function scan(allowContextualToken: boolean): ISyntaxToken { var fullStart = index; - var leadingTriviaInfo = scanTriviaInfo(/*isTrailing: */ false); + var leadingTriviaInfo = scanTriviaInfo(); var start = index; var kindAndIsVariableWidth = scanSyntaxKind(allowContextualToken); - var end = index; - var trailingTriviaInfo = scanTriviaInfo(/*isTrailing: */true); - - var fullWidth = index - fullStart; + var fullEnd = index; + var fullWidth = fullEnd - fullStart; // If we have no trivia, and we are a fixed width token kind, and our size isn't too // large, and we're a real fixed width token (and not something like "\u0076ar"). @@ -399,34 +347,21 @@ module TypeScript.Scanner { var isFixedWidth = kind >= SyntaxKind.FirstFixedWidth && kind <= SyntaxKind.LastFixedWidth && ((kindAndIsVariableWidth & ScannerConstants.IsVariableWidthMask) === 0); - if (isFixedWidth && - leadingTriviaInfo === 0 && trailingTriviaInfo === 0 && - fullStart <= ScannerConstants.FixedWidthTokenMaxFullStart && - (kindAndIsVariableWidth & ScannerConstants.IsVariableWidthMask) === 0) { - - return new FixedWidthTokenWithNoTrivia((fullStart << ScannerConstants.FixedWidthTokenFullStartShift) | kind); + if (isFixedWidth && leadingTriviaInfo === 0) { + return new FixedWidthTokenWithNoTrivia(fullStart, kind); } else { - // inline the packing logic for perf. - var packedFullStartAndTriviaInfo = (fullStart << ScannerConstants.LargeTokenFullStartShift) | - leadingTriviaInfo | (trailingTriviaInfo << 2); - - var packedFullWidthAndKind = (fullWidth << ScannerConstants.LargeTokenFullWidthShift) | kind; - var cachedText = isFixedWidth ? undefined : text.substr(start, end - start); - return new LargeScannerToken(packedFullStartAndTriviaInfo, packedFullWidthAndKind, cachedText); + var packedFullWidthAndInfo = largeTokenPackData(fullWidth, leadingTriviaInfo); + var cachedText = isFixedWidth ? undefined : text.substr(start, fullEnd - start); + return new LargeScannerToken(fullStart, kind, packedFullWidthAndInfo, cachedText); } } - function scanTrivia(parent: IScannerToken, text: ISimpleText, isTrailing: boolean): ISyntaxTriviaList { + function scanTrivia(parent: IScannerToken, text: ISimpleText): ISyntaxTriviaList { var tokenFullStart = parent.fullStart(); var tokenStart = tokenFullStart + leadingTriviaWidth(parent, text) - if (isTrailing) { - reset(text, tokenStart + parent.text().length, tokenFullStart + parent.fullWidth()); - } - else { - reset(text, tokenFullStart, tokenStart); - } + reset(text, tokenFullStart, tokenStart); // Debug.assert(length > 0); // Keep this exactly in sync with scanTriviaInfo @@ -483,15 +418,7 @@ module TypeScript.Scanner { case CharacterCodes.paragraphSeparator: case CharacterCodes.lineSeparator: trivia.push(scanLineTerminatorSequenceTrivia(ch)); - - // If we're consuming leading trivia, then we will continue consuming more - // trivia (including newlines) up to the first token we see. If we're - // consuming trailing trivia, then we break after the first newline we see. - if (!isTrailing) { - continue; - } - - break; + continue; default: throw Errors.invalidOperation(); @@ -508,7 +435,7 @@ module TypeScript.Scanner { // Returns 0 if there was no trivia, or 1 if there was trivia. Returned as an int instead // of a boolean because we'll need a numerical value later on to store in our tokens. - function scanTriviaInfo(isTrailing: boolean): number { + function scanTriviaInfo(): number { // Keep this exactly in sync with scanTrivia var result = 0; var _end = end; @@ -523,7 +450,7 @@ module TypeScript.Scanner { case CharacterCodes.formFeed: index++; // we have trivia - result |= 1; + result |= ScannerConstants.WhitespaceTrivia; continue; case CharacterCodes.carriageReturn: @@ -532,18 +459,12 @@ module TypeScript.Scanner { } // fall through. case CharacterCodes.lineFeed: + case CharacterCodes.paragraphSeparator: + case CharacterCodes.lineSeparator: index++; // we have trivia - result |= 1; - - // If we're consuming leading trivia, then we will continue consuming more - // trivia (including newlines) up to the first token we see. If we're - // consuming trailing trivia, then we break after the first newline we see. - if (isTrailing) { - return result; - } - + result |= ScannerConstants.NewlineTrivia; continue; case CharacterCodes.slash: @@ -551,14 +472,14 @@ module TypeScript.Scanner { var ch2 = str.charCodeAt(index + 1); if (ch2 === CharacterCodes.slash) { // we have a comment, and we have trivia - result |= 3; + result |= ScannerConstants.CommentTrivia; skipSingleLineCommentTrivia(); continue; } if (ch2 === CharacterCodes.asterisk) { // we have a comment, and we have trivia - result |= 3; + result |= ScannerConstants.CommentTrivia; skipMultiLineCommentTrivia(); continue; } @@ -568,8 +489,8 @@ module TypeScript.Scanner { return result; default: - if (ch > CharacterCodes.maxAsciiCharacter && slowScanTriviaInfo(ch)) { - result |= 1; + if (ch > CharacterCodes.maxAsciiCharacter && slowScanWhitespaceTriviaInfo(ch)) { + result |= ScannerConstants.WhitespaceTrivia; continue; } @@ -580,7 +501,7 @@ module TypeScript.Scanner { return result; } - function slowScanTriviaInfo(ch: number): boolean { + function slowScanWhitespaceTriviaInfo(ch: number): boolean { switch (ch) { case CharacterCodes.nonBreakingSpace: case CharacterCodes.enQuad: @@ -598,8 +519,6 @@ module TypeScript.Scanner { case CharacterCodes.narrowNoBreakSpace: case CharacterCodes.ideographicSpace: case CharacterCodes.byteOrderMark: - case CharacterCodes.paragraphSeparator: - case CharacterCodes.lineSeparator: index++; return true; @@ -694,26 +613,31 @@ module TypeScript.Scanner { return createTrivia(SyntaxKind.MultiLineCommentTrivia, absoluteStartIndex); } - function skipMultiLineCommentTrivia(): number { + function skipMultiLineCommentTrivia(): void { // The '2' is for the "/*" we consumed. + var _index = index + 2; + var _end = end; + index += 2; while (true) { - if (index === end) { - reportDiagnostic(end, 0, DiagnosticCode.AsteriskSlash_expected, null); - return; + if (_index === _end) { + reportDiagnostic(end, 0, DiagnosticCode._0_expected, ["*/"]); + break; } - if ((index + 1) < end && - str.charCodeAt(index) === CharacterCodes.asterisk && - str.charCodeAt(index + 1) === CharacterCodes.slash) { + if ((_index + 1) < _end && + str.charCodeAt(_index) === CharacterCodes.asterisk && + str.charCodeAt(_index + 1) === CharacterCodes.slash) { - index += 2; - return; + _index += 2; + break; } - index++; + _index++; } + + index = _index; } function scanLineTerminatorSequenceTrivia(ch: number): ISyntaxTrivia { @@ -742,10 +666,10 @@ module TypeScript.Scanner { index++; switch (character) { - case CharacterCodes.exclamation /*33*/: return scanExclamationToken(); + case CharacterCodes.exclamation/*33*/: return scanExclamationToken(); case CharacterCodes.doubleQuote/*34*/: return scanStringLiteral(character); - case CharacterCodes.percent /*37*/: return scanPercentToken(); - case CharacterCodes.ampersand /*38*/: return scanAmpersandToken(); + case CharacterCodes.percent/*37*/: return scanPercentToken(); + case CharacterCodes.ampersand/*38*/: return scanAmpersandToken(); case CharacterCodes.singleQuote/*39*/: return scanStringLiteral(character); case CharacterCodes.openParen/*40*/: return SyntaxKind.OpenParenToken; case CharacterCodes.closeParen/*41*/: return SyntaxKind.CloseParenToken; @@ -771,10 +695,11 @@ module TypeScript.Scanner { case CharacterCodes.openBracket/*91*/: return SyntaxKind.OpenBracketToken; case CharacterCodes.closeBracket/*93*/: return SyntaxKind.CloseBracketToken; case CharacterCodes.caret/*94*/: return scanCaretToken(); + case CharacterCodes.backtick/*96*/: return scanTemplateToken(character); case CharacterCodes.openBrace/*123*/: return SyntaxKind.OpenBraceToken; case CharacterCodes.bar/*124*/: return scanBarToken(); - case CharacterCodes.closeBrace/*125*/: return SyntaxKind.CloseBraceToken; + case CharacterCodes.closeBrace/*125*/: return scanCloseBraceToken(allowContextualToken, character); case CharacterCodes.tilde/*126*/: return SyntaxKind.TildeToken; } @@ -916,7 +841,7 @@ module TypeScript.Scanner { if (languageVersion >= ts.ScriptTarget.ES5) { reportDiagnostic( - start, index - start, DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null); + start, index - start, DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, undefined); } } @@ -1073,6 +998,39 @@ module TypeScript.Scanner { } } + function scanCloseBraceToken(allowContextualToken: boolean, startChar: number): SyntaxKind { + return allowContextualToken ? scanTemplateToken(startChar) : SyntaxKind.CloseBraceToken; + } + + function scanTemplateToken(startChar: number): SyntaxKind { + var startedWithBacktick = startChar === CharacterCodes.backtick; + + while (true) { + if (index === end) { + // Hit the end of the file. + reportDiagnostic(end, 0, DiagnosticCode._0_expected, ["`"]); + break; + } + + var ch = str.charCodeAt(index); + index++; + + if (ch === CharacterCodes.backtick) { + break; + } + + if (ch === CharacterCodes.$ && + index < end && + str.charCodeAt(index) === CharacterCodes.openBrace) { + + index++; + return startedWithBacktick ? SyntaxKind.TemplateStartToken : SyntaxKind.TemplateMiddleToken; + } + } + + return startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateToken : SyntaxKind.TemplateEndToken; + } + function scanAmpersandToken(): SyntaxKind { var character = str.charCodeAt(index); if (character === CharacterCodes.equals) { @@ -1223,7 +1181,7 @@ module TypeScript.Scanner { switch (ch) { case CharacterCodes.backslash: // We're now in an escape. Consume the next character we see (unless it's - // a newline or null. + // a newline or undefined. inEscape = true; continue; @@ -1364,7 +1322,7 @@ module TypeScript.Scanner { break; } else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, DiagnosticCode.Missing_close_quote_character, null); + reportDiagnostic(Math.min(index, end), 1, DiagnosticCode.Missing_close_quote_character, undefined); break; } else { @@ -1431,7 +1389,7 @@ module TypeScript.Scanner { var ch2 = str.charCodeAt(index); if (!CharacterInfo.isHexDigit(ch2)) { if (report) { - reportDiagnostic(start, index - start, DiagnosticCode.Unrecognized_escape_sequence, null) + reportDiagnostic(start, index - start, DiagnosticCode.Unrecognized_escape_sequence, undefined) } break; @@ -1449,14 +1407,10 @@ module TypeScript.Scanner { var fullEnd = fullStart + token.fullWidth(); reset(text, fullStart, fullEnd); - scanTriviaInfo(/*isTrailing: */ false); + scanTriviaInfo(); var start = index; - scanSyntaxKind(isContextualToken(token)); - var end = index; - tokenInfo.leadingTriviaWidth = start - fullStart; - tokenInfo.width = end - start; } reset(text, 0, text.length()); @@ -1511,30 +1465,30 @@ module TypeScript.Scanner { var rewindPointPool: IScannerRewindPoint[] = []; var rewindPointPoolCount = 0; - var lastDiagnostic: Diagnostic = null; + var lastDiagnostic: Diagnostic = undefined; var reportDiagnostic = (position: number, fullWidth: number, diagnosticKey: string, args: any[]) => { lastDiagnostic = new Diagnostic(fileName, text.lineMap(), position, fullWidth, diagnosticKey, args); }; // The sliding window that we store tokens in. - var slidingWindow = new SlidingWindow(fetchNextItem, ArrayUtilities.createArray(/*defaultWindowSize:*/ 1024, null), null); + var slidingWindow = new SlidingWindow(fetchNextItem, ArrayUtilities.createArray(/*defaultWindowSize:*/ 1024, undefined), undefined); // The scanner we're pulling tokens from. var scanner = createScanner(languageVersion, text, reportDiagnostic); function release() { - slidingWindow = null; - scanner = null; + slidingWindow = undefined; + scanner = undefined; _tokenDiagnostics = []; rewindPointPool = []; - lastDiagnostic = null; - reportDiagnostic = null; + lastDiagnostic = undefined; + reportDiagnostic = undefined; } function currentNode(): ISyntaxNode { // The normal parser source never returns nodes. They're only returned by the // incremental parser source. - return null; + return undefined; } function consumeNode(node: ISyntaxNode): void { @@ -1557,7 +1511,7 @@ module TypeScript.Scanner { rewindPointPoolCount--; var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = null; + rewindPointPool[rewindPointPoolCount] = undefined; return result; } @@ -1593,7 +1547,7 @@ module TypeScript.Scanner { // Debug.assert(spaceAvailable > 0); var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === null) { + if (lastDiagnostic === undefined) { return token; } @@ -1601,7 +1555,7 @@ module TypeScript.Scanner { // it won't be reused in incremental scenarios. _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = null; + lastDiagnostic = undefined; return Syntax.realizeToken(token, text); } @@ -1610,6 +1564,8 @@ module TypeScript.Scanner { } function consumeToken(token: ISyntaxToken): void { + // Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); + // Debug.assert(currentToken() === token); _absolutePosition += token.fullWidth(); @@ -1628,22 +1584,24 @@ module TypeScript.Scanner { var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; if (diagnostic.start() >= position) { tokenDiagnosticsLength--; + _tokenDiagnostics.pop(); } else { break; } } - - _tokenDiagnostics.length = tokenDiagnosticsLength; } function resetToPosition(absolutePosition: number): void { Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); + var resetBackward = absolutePosition <= _absolutePosition; _absolutePosition = absolutePosition; - // First, remove any diagnostics that came after this position. - removeDiagnosticsOnOrAfterPosition(absolutePosition); + if (resetBackward) { + // First, remove any diagnostics that came after this position. + removeDiagnosticsOnOrAfterPosition(absolutePosition); + } // Now, tell our sliding window to throw away all tokens after this position as well. slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); @@ -1655,7 +1613,7 @@ module TypeScript.Scanner { function currentContextualToken(): ISyntaxToken { // We better be on a / or > token right now. - // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken().kind())); + // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken().kind)); // First, we're going to rewind all our data to the point where this / or /= token started. // That's because if it does turn out to be a regular expression, then any tokens or token @@ -1675,7 +1633,7 @@ module TypeScript.Scanner { // We have better gotten some sort of regex token. Otherwise, something *very* wrong has // occurred. - // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(token.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(token.kind)); return token; } @@ -1699,4 +1657,9 @@ module TypeScript.Scanner { resetToPosition: resetToPosition, }; } + + var fixedWidthArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 8, 8, 7, 6, 2, 4, 5, 7, 3, 8, 2, 2, 10, 3, 4, 6, 6, 4, 5, 4, 3, 6, 3, 4, 5, 4, 5, 5, 4, 6, 7, 6, 5, 10, 9, 3, 7, 7, 9, 6, 6, 5, 3, 7, 11, 7, 3, 6, 7, 6, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 1, 2]; + function fixedWidthTokenLength(kind: SyntaxKind) { + return fixedWidthArray[kind]; + } } \ No newline at end of file diff --git a/src/services/syntax/scannerUtilities.generated.ts b/src/services/syntax/scannerUtilities.generated.ts index fbf1b1cb952..97f0093a672 100644 --- a/src/services/syntax/scannerUtilities.generated.ts +++ b/src/services/syntax/scannerUtilities.generated.ts @@ -1,8 +1,8 @@ /// module TypeScript { - export class ScannerUtilities { - public static identifierKind(str: string, start: number, length: number): SyntaxKind { + export module ScannerUtilities { + export function identifierKind(str: string, start: number, length: number): SyntaxKind { switch (length) { case 2: // do, if, in switch(str.charCodeAt(start)) { diff --git a/src/services/syntax/slidingWindow.ts b/src/services/syntax/slidingWindow.ts index d90fa4892c9..4bb79023f2f 100644 --- a/src/services/syntax/slidingWindow.ts +++ b/src/services/syntax/slidingWindow.ts @@ -167,7 +167,7 @@ module TypeScript { // Assert disabled because it is actually expensive enugh to affect perf. // Debug.assert(n >= 0); while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(/*argument:*/ null)) { + if (!this.addMoreItemsToWindow(/*argument:*/ undefined)) { return this.defaultValue; } } diff --git a/src/services/syntax/syntax.ts b/src/services/syntax/syntax.ts index 2cc55ba0620..e67865ae6aa 100644 --- a/src/services/syntax/syntax.ts +++ b/src/services/syntax/syntax.ts @@ -3,24 +3,13 @@ module TypeScript.Syntax { export var _nextSyntaxID: number = 1; - export function childIndex(parent: ISyntaxElement, child: ISyntaxElement) { - for (var i = 0, n = childCount(parent); i < n; i++) { - var current = childAt(parent, i); - if (current === child) { - return i; - } - } - - throw Errors.invalidOperation(); - } - export function nodeHasSkippedOrMissingTokens(node: ISyntaxNode): boolean { for (var i = 0; i < childCount(node); i++) { var child = childAt(node, i); if (isToken(child)) { var token = child; // If a token is skipped, return true. Or if it is a missing token. The only empty token that is not missing is EOF - if (token.hasSkippedToken() || (width(token) === 0 && token.kind() !== SyntaxKind.EndOfFileToken)) { + if (token.hasLeadingSkippedToken() || (fullWidth(token) === 0 && token.kind !== SyntaxKind.EndOfFileToken)) { return true; } } @@ -30,7 +19,7 @@ module TypeScript.Syntax { } export function isUnterminatedStringLiteral(token: ISyntaxToken): boolean { - if (token && token.kind() === SyntaxKind.StringLiteral) { + if (token && token.kind === SyntaxKind.StringLiteral) { var text = token.text(); return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); } @@ -39,7 +28,7 @@ module TypeScript.Syntax { } export function isUnterminatedMultilineCommentTrivia(trivia: ISyntaxTrivia): boolean { - if (trivia && trivia.kind() === SyntaxKind.MultiLineCommentTrivia) { + if (trivia && trivia.kind === SyntaxKind.MultiLineCommentTrivia) { var text = trivia.fullText(); return text.length < 4 || text.substring(text.length - 2) !== "*/"; } @@ -53,145 +42,43 @@ module TypeScript.Syntax { return true; } else if (position === end) { - return trivia.kind() === SyntaxKind.SingleLineCommentTrivia || isUnterminatedMultilineCommentTrivia(trivia); + return trivia.kind === SyntaxKind.SingleLineCommentTrivia || isUnterminatedMultilineCommentTrivia(trivia); } } return false; } - export function isEntirelyInsideComment(sourceUnit: SourceUnitSyntax, position: number): boolean { - var positionedToken = findToken(sourceUnit, position); - var fullStart = positionedToken.fullStart(); - var triviaList: ISyntaxTriviaList = null; - var lastTriviaBeforeToken: ISyntaxTrivia = null; - - if (positionedToken.kind() === SyntaxKind.EndOfFileToken) { - // Check if the trivia is leading on the EndOfFile token - if (positionedToken.hasLeadingTrivia()) { - triviaList = positionedToken.leadingTrivia(); - } - // Or trailing on the previous token - else { - positionedToken = previousToken(positionedToken); - if (positionedToken) { - if (positionedToken && positionedToken.hasTrailingTrivia()) { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - } - } - } - else { - if (position <= (fullStart + positionedToken.leadingTriviaWidth())) { - triviaList = positionedToken.leadingTrivia(); - } - else if (position >= (fullStart + width(positionedToken))) { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - } - - if (triviaList) { - // Try to find the trivia matching the position - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - // Moved passed the trivia we need - break; - } - else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - // Found the comment trivia we were looking for - lastTriviaBeforeToken = trivia; - break; - } - - fullStart += trivia.fullWidth(); - } - } - - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - - export function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit: SourceUnitSyntax, position: number): boolean { - var positionedToken = findToken(sourceUnit, position); - - if (positionedToken) { - if (positionedToken.kind() === SyntaxKind.EndOfFileToken) { - // EndOfFile token, enusre it did not follow an unterminated string literal - positionedToken = previousToken(positionedToken); - return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); - } - else if (position > start(positionedToken)) { - // Ensure position falls enterily within the literal if it is terminated, or the line if it is not - return (position < end(positionedToken) && (positionedToken.kind() === TypeScript.SyntaxKind.StringLiteral || positionedToken.kind() === TypeScript.SyntaxKind.RegularExpressionLiteral)) || - (position <= end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); - } - } - - return false; - } - - function findSkippedTokenOnLeftInTriviaList(positionedToken: ISyntaxToken, position: number, lookInLeadingTriviaList: boolean): ISyntaxToken { - var triviaList: TypeScript.ISyntaxTriviaList = null; - var fullEnd: number; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullEnd = TypeScript.fullEnd(positionedToken); - } - - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullEnd) { - return trivia.skippedToken(); - } - - fullEnd -= triviaWidth; - } - } - - return null; - } - - export function findSkippedTokenOnLeft(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ positionInLeadingTriviaList); - } - export function getAncestorOfKind(positionedToken: ISyntaxElement, kind: SyntaxKind): ISyntaxElement { while (positionedToken && positionedToken.parent) { - if (positionedToken.parent.kind() === kind) { + if (positionedToken.parent.kind === kind) { return positionedToken.parent; } positionedToken = positionedToken.parent; } - return null; + return undefined; } export function hasAncestorOfKind(positionedToken: ISyntaxElement, kind: SyntaxKind): boolean { - return getAncestorOfKind(positionedToken, kind) !== null; + return !!getAncestorOfKind(positionedToken, kind); } export function isIntegerLiteral(expression: IExpressionSyntax): boolean { if (expression) { - switch (expression.kind()) { - case SyntaxKind.PlusExpression: - case SyntaxKind.NegateExpression: - // Note: if there is a + or - sign, we can only allow a normal integer following - // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a - // *literal*. - expression = (expression).operand; - return isToken(expression) && IntegerUtilities.isInteger((expression).text()); + switch (expression.kind) { + case SyntaxKind.PrefixUnaryExpression: + var prefixExpr = expression; + if (prefixExpr.operatorToken.kind == SyntaxKind.PlusToken || prefixExpr.operatorToken.kind === SyntaxKind.MinusToken) { + // Note: if there is a + or - sign, we can only allow a normal integer following + // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a + // *literal*. + expression = prefixExpr.operand; + return isToken(expression) && IntegerUtilities.isInteger((expression).text()); + } + + return false; case SyntaxKind.NumericLiteral: // If it doesn't have a + or -, then either an integer literal or a hex literal @@ -207,25 +94,21 @@ module TypeScript.Syntax { export function containingNode(element: ISyntaxElement): ISyntaxNode { var current = element.parent; - while (current !== null && !isNode(current)) { + while (current && !isNode(current)) { current = current.parent; } return current; } - export function findTokenOnLeft(element: ISyntaxElement, position: number, includeSkippedTokens: boolean = false): ISyntaxToken { - var positionedToken = findToken(element, position, /*includeSkippedTokens*/ false); + export function findTokenOnLeft(sourceUnit: SourceUnitSyntax, position: number): ISyntaxToken { + var positionedToken = findToken(sourceUnit, position); var _start = start(positionedToken); // Position better fall within this token. // Debug.assert(position >= positionedToken.fullStart()); // Debug.assert(position < positionedToken.fullEnd() || positionedToken.token().tokenKind === SyntaxKind.EndOfFileToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - // if position is after the start of the token, then this token is the token on the left. if (position > _start) { return positionedToken; @@ -234,50 +117,24 @@ module TypeScript.Syntax { // we're in the trivia before the start of the token. Need to return the previous token. if (positionedToken.fullStart() === 0) { // Already on the first token. Nothing before us. - return null; + return undefined; } - return previousToken(positionedToken, includeSkippedTokens); + return previousToken(positionedToken); } - export function findCompleteTokenOnLeft(element: ISyntaxElement, position: number, includeSkippedTokens: boolean = false): ISyntaxToken { - var positionedToken = findToken(element, position, /*includeSkippedTokens*/ false); + export function findCompleteTokenOnLeft(sourceUnit: SourceUnitSyntax, position: number): ISyntaxToken { + var positionedToken = findToken(sourceUnit, position); // Position better fall within this token. // Debug.assert(position >= positionedToken.fullStart()); // Debug.assert(position < positionedToken.fullEnd() || positionedToken.token().tokenKind === SyntaxKind.EndOfFileToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - // if position is after the end of the token, then this token is the token on the left. - if (width(positionedToken) > 0 && position >= end(positionedToken)) { + if (width(positionedToken) > 0 && position >= fullEnd(positionedToken)) { return positionedToken; } - return previousToken(positionedToken, includeSkippedTokens); - } - - export function firstTokenInLineContainingPosition(syntaxTree: SyntaxTree, position: number): ISyntaxToken { - var current = findToken(syntaxTree.sourceUnit(), position); - while (true) { - if (isFirstTokenInLine(current, syntaxTree.lineMap())) { - break; - } - - current = previousToken(current); - } - - return current; - } - - function isFirstTokenInLine(token: ISyntaxToken, lineMap: LineMap): boolean { - var _previousToken = previousToken(token); - if (_previousToken === null) { - return true; - } - - return lineMap.getLineNumberFromPosition(end(_previousToken)) !== lineMap.getLineNumberFromPosition(start(token)); + return previousToken(positionedToken); } } \ No newline at end of file diff --git a/src/services/syntax/syntaxElement.ts b/src/services/syntax/syntaxElement.ts index 211e8b1dd86..fe582db6b57 100644 --- a/src/services/syntax/syntaxElement.ts +++ b/src/services/syntax/syntaxElement.ts @@ -1,52 +1,12 @@ /// module TypeScript { - // True if there is only a single instance of this element (and thus can be reused in many - // places in a syntax tree). Examples of this include our empty lists. Because empty - // lists can be found all over the tree, we want to save on memory by using this single - // instance instead of creating new objects for each case. Note: because of this, shared - // nodes don't have positions or parents. - export function isShared(element: ISyntaxElement): boolean { - var kind = element.kind(); - return (kind === SyntaxKind.List || kind === SyntaxKind.SeparatedList) && (element).length === 0; - } - - export function childCount(element: ISyntaxElement): number { - var kind = element.kind(); - if (kind === SyntaxKind.List) { - return (element).length; - } - else if (kind === SyntaxKind.SeparatedList) { - return (element).length + (element).separators.length; - } - else if (kind >= SyntaxKind.FirstToken && kind <= SyntaxKind.LastToken) { - return 0; - } - else { - return nodeMetadata[kind].length; - } - } - - export function childAt(element: ISyntaxElement, index: number): ISyntaxElement { - var kind = element.kind(); - if (kind === SyntaxKind.List) { - return (element)[index]; - } - else if (kind === SyntaxKind.SeparatedList) { - return (index % 2 === 0) ? (element)[index / 2] : (element).separators[(index - 1) / 2]; - } - else { - // Debug.assert(isNode(element)); - return (element)[nodeMetadata[element.kind()][index]]; - } - } - export function syntaxTree(element: ISyntaxElement): SyntaxTree { if (element) { - Debug.assert(!isShared(element)); + // Debug.assert(!isShared(element)); while (element) { - if (element.kind() === SyntaxKind.SourceUnit) { + if (element.kind === SyntaxKind.SourceUnit) { return (element).syntaxTree; } @@ -54,40 +14,52 @@ module TypeScript { } } - return null; + return undefined; } - export function parsedInStrictMode(node: ISyntaxNode): boolean { - var info = node.data; + export function parsedInStrictModeContext(node: ISyntaxNode): boolean { + var info = node.__data; if (info === undefined) { return false; } - return (info & SyntaxConstants.NodeParsedInStrictModeMask) !== 0; + return (info & SyntaxNodeConstants.ParsedInStrictModeContext) !== 0; } - export function previousToken(token: ISyntaxToken, includeSkippedTokens: boolean = false): ISyntaxToken { - if (includeSkippedTokens) { - var triviaList = token.leadingTrivia(); - if (triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = TypeScript.start(token); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - - currentTriviaEndPosition -= trivia.fullWidth(); - } - } + export function parsedInDisallowInContext(node: ISyntaxNode): boolean { + var info = node.__data; + if (info === undefined) { + return false; } + return (info & SyntaxNodeConstants.ParsedInDisallowInContext) !== 0; + } + + export function parsedInYieldContext(node: ISyntaxNode): boolean { + var info = node.__data; + if (info === undefined) { + return false; + } + + return (info & SyntaxNodeConstants.ParsedInYieldContext) !== 0; + } + + export function parsedInGeneratorParameterContext(node: ISyntaxNode): boolean { + var info = node.__data; + if (info === undefined) { + return false; + } + + return (info & SyntaxNodeConstants.ParsedInGeneratorParameterContext) !== 0; + } + + export function previousToken(token: ISyntaxToken): ISyntaxToken { var start = token.fullStart(); if (start === 0) { - return null; + return undefined; } - return findToken(syntaxTree(token).sourceUnit(), start - 1, includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), start - 1); } /** @@ -103,136 +75,98 @@ module TypeScript { * Note: findToken will always return a non-missing token with width greater than or equal to * 1 (except for EOF). Empty tokens synthesized by the parser are never returned. */ - export function findToken(element: ISyntaxElement, position: number, includeSkippedTokens: boolean = false): ISyntaxToken { - var endOfFileToken = tryGetEndOfFileAt(element, position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - - if (position < 0 || position >= fullWidth(element)) { + export function findToken(sourceUnit: SourceUnitSyntax, position: number): ISyntaxToken { + if (position < 0) { throw Errors.argumentOutOfRange("position"); } - var positionedToken = findTokenWorker(element, position); - - if (includeSkippedTokens) { - return findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; + var token = findTokenInNodeOrToken(sourceUnit, 0, position); + if (token) { + Debug.assert(token.fullWidth() > 0); + return token; } - // Could not find a better match - return positionedToken; - } - - export function findSkippedTokenInPositionedToken(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ positionInLeadingTriviaList); - } - - export function findSkippedTokenInLeadingTriviaList(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - return findSkippedTokenInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ true); - } - - export function findSkippedTokenInTrailingTriviaList(positionedToken: ISyntaxToken, position: number): ISyntaxToken { - return findSkippedTokenInTriviaList(positionedToken, position, /*lookInLeadingTriviaList*/ false); - } - - function findSkippedTokenInTriviaList(positionedToken: ISyntaxToken, position: number, lookInLeadingTriviaList: boolean): ISyntaxToken { - var triviaList: TypeScript.ISyntaxTriviaList = null; - var fullStart: number; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullStart = positionedToken.fullStart(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); + if (position === fullWidth(sourceUnit)) { + return sourceUnit.endOfFileToken; } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return trivia.skippedToken(); - } - - fullStart += triviaWidth; - } - } - - return null; - } - - function findTokenWorker(element: ISyntaxElement, position: number): ISyntaxToken { - // Debug.assert(position >= 0 && position < this.fullWidth()); - if (isToken(element)) { - Debug.assert(fullWidth(element) > 0); - return element; - } - - if (isShared(element)) { - // This should never have been called on this element. It has a 0 width, so the client - // should have skipped over this. - throw Errors.invalidOperation(); - } - - // Consider: we could use a binary search here to find the child more quickly. - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); - - if (child !== null) { - var childFullWidth = fullWidth(child); - if (childFullWidth > 0) { - var childFullStart = fullStart(child); - - if (position >= childFullStart) { - var childFullEnd = childFullStart + childFullWidth; - - if (position < childFullEnd) { - return findTokenWorker(child, position); - } - } - } - } + if (position > fullWidth(sourceUnit)) { + throw Errors.argumentOutOfRange("position"); } throw Errors.invalidOperation(); } + function findTokenWorker(element: ISyntaxElement, elementPosition: number, position: number): ISyntaxToken { + if (isList(element)) { + return findTokenInList(element, elementPosition, position); + } + else { + return findTokenInNodeOrToken(element, elementPosition, position); + } + } + + function findTokenInList(list: ISyntaxNodeOrToken[], elementPosition: number, position: number): ISyntaxToken { + for (var i = 0, n = list.length; i < n; i++) { + var child = list[i]; + + var childFullWidth = fullWidth(child); + var elementEndPosition = elementPosition + childFullWidth; + + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); + } + + elementPosition = elementEndPosition; + } + + return undefined; + } + + + function findTokenInNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, elementPosition: number, position: number): ISyntaxToken { + if (isToken(nodeOrToken)) { + return nodeOrToken; + } + + for (var i = 0, n = childCount(nodeOrToken); i < n; i++) { + var child = nodeOrToken.childAt(i); + + if (child) { + var childFullWidth = fullWidth(child); + var elementEndPosition = elementPosition + childFullWidth; + + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); + } + + elementPosition = elementEndPosition; + } + } + + return undefined; + } + function tryGetEndOfFileAt(element: ISyntaxElement, position: number): ISyntaxToken { - if (element.kind() === SyntaxKind.SourceUnit && position === fullWidth(element)) { + if (element.kind === SyntaxKind.SourceUnit && position === fullWidth(element)) { var sourceUnit = element; return sourceUnit.endOfFileToken; } - return null; + return undefined; } - export function nextToken(token: ISyntaxToken, text?: ISimpleText, includeSkippedTokens: boolean = false): ISyntaxToken { - if (token.kind() === SyntaxKind.EndOfFileToken) { - return null; + export function nextToken(token: ISyntaxToken, text?: ISimpleText): ISyntaxToken { + if (token.kind === SyntaxKind.EndOfFileToken) { + return undefined; } - if (includeSkippedTokens) { - var triviaList = token.trailingTrivia(text); - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - } - } - } - - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token), includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), fullEnd(token)); } export function isNode(element: ISyntaxElement): boolean { - if (element !== null) { - var kind = element.kind(); + if (element) { + var kind = element.kind; return kind >= SyntaxKind.FirstNode && kind <= SyntaxKind.LastNode; } @@ -244,25 +178,21 @@ module TypeScript { } export function isToken(element: ISyntaxElement): boolean { - if (element !== null) { - return isTokenKind(element.kind()); + if (element) { + return isTokenKind(element.kind); } return false; } export function isList(element: ISyntaxElement): boolean { - return element !== null && element.kind() === SyntaxKind.List; - } - - export function isSeparatedList(element: ISyntaxElement): boolean { - return element !== null && element.kind() === SyntaxKind.SeparatedList; + return element instanceof Array; } export function syntaxID(element: ISyntaxElement): number { - if (isShared(element)) { - throw Errors.invalidOperation("Should not use shared syntax element as a key."); - } + //if (isShared(element)) { + // throw Errors.invalidOperation("Should not use shared syntax element as a key."); + //} var obj = element; if (obj._syntaxID === undefined) { @@ -301,69 +231,37 @@ module TypeScript { return token ? token.leadingTriviaWidth(text) : 0; } - export function trailingTriviaWidth(element: ISyntaxElement, text?: ISimpleText): number { - var token = lastToken(element); - return token ? token.trailingTriviaWidth(text) : 0; - } - export function firstToken(element: ISyntaxElement): ISyntaxToken { if (element) { - var kind = element.kind(); + var kind = element.kind; if (isTokenKind(kind)) { - return fullWidth(element) > 0 || element.kind() === SyntaxKind.EndOfFileToken ? element : null; + return (element).fullWidth() > 0 || kind === SyntaxKind.EndOfFileToken ? element : undefined; } - if (kind === SyntaxKind.List) { - var array = element; - for (var i = 0, n = array.length; i < n; i++) { - var token = firstToken(array[i]); - if (token) { - return token; - } - } - } - else if (kind === SyntaxKind.SeparatedList) { - var array = element; - var separators = array.separators; - for (var i = 0, n = array.length + separators.length; i < n; i++) { - var token = firstToken(i % 2 === 0 ? array[i / 2] : separators[(i - 1) / 2]); - if (token) { - return token; - } - } - } - else { - var metadata = nodeMetadata[kind]; - for (var i = 0, n = metadata.length; i < n; i++) { - var child = (element)[metadata[i]]; - var token = firstToken(child); - if (token) { - return token; - } - } - - if (element.kind() === SyntaxKind.SourceUnit) { - return (element).endOfFileToken; + for (var i = 0, n = childCount(element); i < n; i++) { + var token = firstToken(childAt(element, i)); + if (token) { + return token; } } } - return null; + return undefined; } export function lastToken(element: ISyntaxElement): ISyntaxToken { if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === SyntaxKind.EndOfFileToken ? element : null; + return fullWidth(element) > 0 || element.kind === SyntaxKind.EndOfFileToken ? element : undefined; } - if (element.kind() === SyntaxKind.SourceUnit) { + if (element.kind === SyntaxKind.SourceUnit) { return (element).endOfFileToken; } for (var i = childCount(element) - 1; i >= 0; i--) { var child = childAt(element, i); - if (child !== null) { + if (child) { var token = lastToken(child); if (token) { return token; @@ -371,11 +269,11 @@ module TypeScript { } } - return null; + return undefined; } export function fullStart(element: ISyntaxElement): number { - Debug.assert(!isShared(element)); + // Debug.assert(!isShared(element)); var token = isToken(element) ? element : firstToken(element); return token ? token.fullStart() : -1; } @@ -385,12 +283,8 @@ module TypeScript { return (element).fullWidth(); } - if (isShared(element)) { - return 0; - } - var info = data(element); - return info >>> SyntaxConstants.NodeFullWidthShift; + return (info / SyntaxNodeConstants.FullWidthShift) | 0; } export function isIncrementallyUnusable(element: ISyntaxElement): boolean { @@ -398,54 +292,74 @@ module TypeScript { return (element).isIncrementallyUnusable(); } - if (isShared(element)) { - // All shared lists are reusable. - return false; - } - - return (data(element) & SyntaxConstants.NodeIncrementallyUnusableMask) !== 0; + return (data(element) & SyntaxNodeConstants.IncrementallyUnusableMask) !== 0; } function data(element: ISyntaxElement): number { - Debug.assert(isNode(element) || isList(element) || isSeparatedList(element)); + // Debug.assert(isNode(element) || isList(element)); // Lists and nodes all have a 'data' element. - var dataElement = <{ data: number }>element; + var dataElement = element; - var info = dataElement.data; + var info = dataElement.__data; if (info === undefined) { info = 0; } - if ((info & SyntaxConstants.NodeDataComputed) === 0) { + if ((info & SyntaxNodeConstants.DataComputed) === 0) { info |= computeData(element); - dataElement.data = info; + dataElement.__data = info; } return info; } - function computeData(element: ISyntaxElement): number { - var slotCount = childCount(element); + function combineData(fullWidth: number, isIncrementallyUnusable: boolean) { + return (fullWidth * SyntaxNodeConstants.FullWidthShift) + + (isIncrementallyUnusable ? SyntaxNodeConstants.IncrementallyUnusableMask : 0) + + SyntaxNodeConstants.DataComputed; + } + function listComputeData(list: ISyntaxNodeOrToken[]): number { var fullWidth = 0; + var isIncrementallyUnusable = false; + + for (var i = 0, n = list.length; i < n; i++) { + var child: ISyntaxElement = list[i]; + + fullWidth += TypeScript.fullWidth(child); + isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); + } + + return combineData(fullWidth, isIncrementallyUnusable); + } + + function computeData(element: ISyntaxElement): number { + if (isList(element)) { + return listComputeData(element); + } + else { + return nodeOrTokenComputeData(element); + } + } + + function nodeOrTokenComputeData(nodeOrToken: ISyntaxNodeOrToken) { + var fullWidth = 0; + var slotCount = nodeOrToken.childCount; // If we have no children (like an OmmittedExpressionSyntax), we're automatically not reusable. var isIncrementallyUnusable = slotCount === 0; for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); + var child = nodeOrToken.childAt(i); if (child) { fullWidth += TypeScript.fullWidth(child); - isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); } } - return (fullWidth << SyntaxConstants.NodeFullWidthShift) - | (isIncrementallyUnusable ? SyntaxConstants.NodeIncrementallyUnusableMask : 0) - | SyntaxConstants.NodeDataComputed; + return combineData(fullWidth, isIncrementallyUnusable); } export function start(element: ISyntaxElement, text?: ISimpleText): number { @@ -453,16 +367,11 @@ module TypeScript { return token ? token.fullStart() + token.leadingTriviaWidth(text) : -1; } - export function end(element: ISyntaxElement, text?: ISimpleText): number { - var token = isToken(element) ? element : lastToken(element); - return token ? fullEnd(token) - token.trailingTriviaWidth(text) : -1; - } - export function width(element: ISyntaxElement, text?: ISimpleText): number { if (isToken(element)) { return (element).text().length; } - return fullWidth(element) - leadingTriviaWidth(element, text) - trailingTriviaWidth(element, text); + return fullWidth(element) - leadingTriviaWidth(element, text); } export function fullEnd(element: ISyntaxElement): number { @@ -474,21 +383,22 @@ module TypeScript { return false; } - if (token1 === null || token2 === null) { + if (!token1 || !token2) { return true; } var lineMap = text.lineMap(); - return lineMap.getLineNumberFromPosition(end(token1, text)) !== lineMap.getLineNumberFromPosition(start(token2, text)); + return lineMap.getLineNumberFromPosition(fullEnd(token1)) !== lineMap.getLineNumberFromPosition(start(token2, text)); } export interface ISyntaxElement { - kind(): SyntaxKind; - parent?: ISyntaxElement; + kind: SyntaxKind; + parent: ISyntaxElement; } export interface ISyntaxNode extends ISyntaxNodeOrToken { - data: number; + __data: number; + __cachedTokens: ISyntaxToken[]; } export interface IModuleReferenceSyntax extends ISyntaxNode { @@ -496,6 +406,7 @@ module TypeScript { } export interface IModuleElementSyntax extends ISyntaxNode { + _moduleElementBrand: any; } export interface IStatementSyntax extends IModuleElementSyntax { @@ -503,15 +414,28 @@ module TypeScript { } export interface ITypeMemberSyntax extends ISyntaxNode { + _typeMemberBrand: any; } export interface IClassElementSyntax extends ISyntaxNode { + _classElementBrand: any; } export interface IMemberDeclarationSyntax extends IClassElementSyntax { + _memberDeclarationBrand: any; } - export interface IPropertyAssignmentSyntax extends IClassElementSyntax { + export interface IPropertyAssignmentSyntax extends ISyntaxNodeOrToken { + _propertyAssignmentBrand: any; + } + + export interface IAccessorSyntax extends IPropertyAssignmentSyntax, IMemberDeclarationSyntax { + _accessorBrand: any; + + modifiers: ISyntaxToken[]; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + block: BlockSyntax; } export interface ISwitchClauseSyntax extends ISyntaxNode { @@ -553,5 +477,10 @@ module TypeScript { } export interface INameSyntax extends ITypeSyntax { + _nameBrand: any; + } + + export interface IPropertyNameSyntax extends ISyntaxNodeOrToken { + _propertyNameBrand: any; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxFacts.ts b/src/services/syntax/syntaxFacts.ts index 3b8d877429c..6f8b0edccae 100644 --- a/src/services/syntax/syntaxFacts.ts +++ b/src/services/syntax/syntaxFacts.ts @@ -134,7 +134,7 @@ module TypeScript.SyntaxFacts { export function getText(kind: SyntaxKind): string { var result = kindToText[kind]; - return result !== undefined ? result : null; + return result;// !== undefined ? result : undefined; } export function isAnyKeyword(kind: SyntaxKind): boolean { @@ -146,114 +146,60 @@ module TypeScript.SyntaxFacts { } export function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== SyntaxKind.None; + switch (tokenKind) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + return true; + default: + return false; + } } export function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - return getBinaryExpressionFromOperatorToken(tokenKind) !== SyntaxKind.None; - } - - export function getPrefixUnaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind { switch (tokenKind) { - case SyntaxKind.PlusToken: return SyntaxKind.PlusExpression; - case SyntaxKind.MinusToken: return SyntaxKind.NegateExpression; - case SyntaxKind.TildeToken: return SyntaxKind.BitwiseNotExpression; - case SyntaxKind.ExclamationToken: return SyntaxKind.LogicalNotExpression; - case SyntaxKind.PlusPlusToken: return SyntaxKind.PreIncrementExpression; - case SyntaxKind.MinusMinusToken: return SyntaxKind.PreDecrementExpression; - default: return SyntaxKind.None; - } - } - - export function getPostfixUnaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind { - switch (tokenKind) { - case SyntaxKind.PlusPlusToken: return SyntaxKind.PostIncrementExpression; - case SyntaxKind.MinusMinusToken: return SyntaxKind.PostDecrementExpression; - default: return SyntaxKind.None; - } - } - - export function getBinaryExpressionFromOperatorToken(tokenKind: SyntaxKind): SyntaxKind { - switch (tokenKind) { - case SyntaxKind.AsteriskToken: return SyntaxKind.MultiplyExpression; - case SyntaxKind.SlashToken: return SyntaxKind.DivideExpression; - case SyntaxKind.PercentToken: return SyntaxKind.ModuloExpression; - case SyntaxKind.PlusToken: return SyntaxKind.AddExpression; - case SyntaxKind.MinusToken: return SyntaxKind.SubtractExpression; - case SyntaxKind.LessThanLessThanToken: return SyntaxKind.LeftShiftExpression; - case SyntaxKind.GreaterThanGreaterThanToken: return SyntaxKind.SignedRightShiftExpression; - case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return SyntaxKind.UnsignedRightShiftExpression; - case SyntaxKind.LessThanToken: return SyntaxKind.LessThanExpression; - case SyntaxKind.GreaterThanToken: return SyntaxKind.GreaterThanExpression; - case SyntaxKind.LessThanEqualsToken: return SyntaxKind.LessThanOrEqualExpression; - case SyntaxKind.GreaterThanEqualsToken: return SyntaxKind.GreaterThanOrEqualExpression; - case SyntaxKind.InstanceOfKeyword: return SyntaxKind.InstanceOfExpression; - case SyntaxKind.InKeyword: return SyntaxKind.InExpression; - case SyntaxKind.EqualsEqualsToken: return SyntaxKind.EqualsWithTypeConversionExpression; - case SyntaxKind.ExclamationEqualsToken: return SyntaxKind.NotEqualsWithTypeConversionExpression; - case SyntaxKind.EqualsEqualsEqualsToken: return SyntaxKind.EqualsExpression; - case SyntaxKind.ExclamationEqualsEqualsToken: return SyntaxKind.NotEqualsExpression; - case SyntaxKind.AmpersandToken: return SyntaxKind.BitwiseAndExpression; - case SyntaxKind.CaretToken: return SyntaxKind.BitwiseExclusiveOrExpression; - case SyntaxKind.BarToken: return SyntaxKind.BitwiseOrExpression; - case SyntaxKind.AmpersandAmpersandToken: return SyntaxKind.LogicalAndExpression; - case SyntaxKind.BarBarToken: return SyntaxKind.LogicalOrExpression; - case SyntaxKind.BarEqualsToken: return SyntaxKind.OrAssignmentExpression; - case SyntaxKind.AmpersandEqualsToken: return SyntaxKind.AndAssignmentExpression; - case SyntaxKind.CaretEqualsToken: return SyntaxKind.ExclusiveOrAssignmentExpression; - case SyntaxKind.LessThanLessThanEqualsToken: return SyntaxKind.LeftShiftAssignmentExpression; - case SyntaxKind.GreaterThanGreaterThanEqualsToken: return SyntaxKind.SignedRightShiftAssignmentExpression; - case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: return SyntaxKind.UnsignedRightShiftAssignmentExpression; - case SyntaxKind.PlusEqualsToken: return SyntaxKind.AddAssignmentExpression; - case SyntaxKind.MinusEqualsToken: return SyntaxKind.SubtractAssignmentExpression; - case SyntaxKind.AsteriskEqualsToken: return SyntaxKind.MultiplyAssignmentExpression; - case SyntaxKind.SlashEqualsToken: return SyntaxKind.DivideAssignmentExpression; - case SyntaxKind.PercentEqualsToken: return SyntaxKind.ModuloAssignmentExpression; - case SyntaxKind.EqualsToken: return SyntaxKind.AssignmentExpression; - case SyntaxKind.CommaToken: return SyntaxKind.CommaExpression; - default: return SyntaxKind.None; - } - } - - export function getOperatorTokenFromBinaryExpression(tokenKind: SyntaxKind): SyntaxKind { - switch (tokenKind) { - case SyntaxKind.MultiplyExpression: return SyntaxKind.AsteriskToken; - case SyntaxKind.DivideExpression: return SyntaxKind.SlashToken; - case SyntaxKind.ModuloExpression: return SyntaxKind.PercentToken; - case SyntaxKind.AddExpression: return SyntaxKind.PlusToken; - case SyntaxKind.SubtractExpression: return SyntaxKind.MinusToken; - case SyntaxKind.LeftShiftExpression: return SyntaxKind.LessThanLessThanToken; - case SyntaxKind.SignedRightShiftExpression: return SyntaxKind.GreaterThanGreaterThanToken; - case SyntaxKind.UnsignedRightShiftExpression: return SyntaxKind.GreaterThanGreaterThanGreaterThanToken; - case SyntaxKind.LessThanExpression: return SyntaxKind.LessThanToken; - case SyntaxKind.GreaterThanExpression: return SyntaxKind.GreaterThanToken; - case SyntaxKind.LessThanOrEqualExpression: return SyntaxKind.LessThanEqualsToken; - case SyntaxKind.GreaterThanOrEqualExpression: return SyntaxKind.GreaterThanEqualsToken; - case SyntaxKind.InstanceOfExpression: return SyntaxKind.InstanceOfKeyword; - case SyntaxKind.InExpression: return SyntaxKind.InKeyword; - case SyntaxKind.EqualsWithTypeConversionExpression: return SyntaxKind.EqualsEqualsToken; - case SyntaxKind.NotEqualsWithTypeConversionExpression: return SyntaxKind.ExclamationEqualsToken; - case SyntaxKind.EqualsExpression: return SyntaxKind.EqualsEqualsEqualsToken; - case SyntaxKind.NotEqualsExpression: return SyntaxKind.ExclamationEqualsEqualsToken; - case SyntaxKind.BitwiseAndExpression: return SyntaxKind.AmpersandToken; - case SyntaxKind.BitwiseExclusiveOrExpression: return SyntaxKind.CaretToken; - case SyntaxKind.BitwiseOrExpression: return SyntaxKind.BarToken; - case SyntaxKind.LogicalAndExpression: return SyntaxKind.AmpersandAmpersandToken; - case SyntaxKind.LogicalOrExpression: return SyntaxKind.BarBarToken; - case SyntaxKind.OrAssignmentExpression: return SyntaxKind.BarEqualsToken; - case SyntaxKind.AndAssignmentExpression: return SyntaxKind.AmpersandEqualsToken; - case SyntaxKind.ExclusiveOrAssignmentExpression: return SyntaxKind.CaretEqualsToken; - case SyntaxKind.LeftShiftAssignmentExpression: return SyntaxKind.LessThanLessThanEqualsToken; - case SyntaxKind.SignedRightShiftAssignmentExpression: return SyntaxKind.GreaterThanGreaterThanEqualsToken; - case SyntaxKind.UnsignedRightShiftAssignmentExpression: return SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken; - case SyntaxKind.AddAssignmentExpression: return SyntaxKind.PlusEqualsToken; - case SyntaxKind.SubtractAssignmentExpression: return SyntaxKind.MinusEqualsToken; - case SyntaxKind.MultiplyAssignmentExpression: return SyntaxKind.AsteriskEqualsToken; - case SyntaxKind.DivideAssignmentExpression: return SyntaxKind.SlashEqualsToken; - case SyntaxKind.ModuloAssignmentExpression: return SyntaxKind.PercentEqualsToken; - case SyntaxKind.AssignmentExpression: return SyntaxKind.EqualsToken; - case SyntaxKind.CommaExpression: return SyntaxKind.CommaToken; - default: return SyntaxKind.None; + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.InstanceOfKeyword: + case SyntaxKind.InKeyword: + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.AmpersandToken: + case SyntaxKind.CaretToken: + case SyntaxKind.BarToken: + case SyntaxKind.AmpersandAmpersandToken: + case SyntaxKind.BarBarToken: + case SyntaxKind.BarEqualsToken: + case SyntaxKind.AmpersandEqualsToken: + case SyntaxKind.CaretEqualsToken: + case SyntaxKind.LessThanLessThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.PlusEqualsToken: + case SyntaxKind.MinusEqualsToken: + case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PercentEqualsToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.CommaToken: + return true; + default: + return false; } } diff --git a/src/services/syntax/syntaxFacts2.ts b/src/services/syntax/syntaxFacts2.ts index 99a144176a4..7c73eb31513 100644 --- a/src/services/syntax/syntaxFacts2.ts +++ b/src/services/syntax/syntaxFacts2.ts @@ -2,16 +2,8 @@ module TypeScript.SyntaxFacts { export function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean { - if (node.kind() === SyntaxKind.ExpressionStatement) { - var expressionStatement = node; - var expression = expressionStatement.expression; - - if (expression.kind() === SyntaxKind.StringLiteral) { - return true; - } - } - - return false; + return node.kind === SyntaxKind.ExpressionStatement && + (node).expression.kind === SyntaxKind.StringLiteral; } export function isUseStrictDirective(node: ISyntaxNodeOrToken): boolean { @@ -23,7 +15,7 @@ module TypeScript.SyntaxFacts { } export function isIdentifierNameOrAnyKeyword(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; return tokenKind === SyntaxKind.IdentifierName || SyntaxFacts.isAnyKeyword(tokenKind); } diff --git a/src/services/syntax/syntaxGenerator.ts b/src/services/syntax/syntaxGenerator.ts index ebc2673b98c..99218a04920 100644 --- a/src/services/syntax/syntaxGenerator.ts +++ b/src/services/syntax/syntaxGenerator.ts @@ -1,11 +1,10 @@ -/// -/// +/// +/// +/// /// /// +// /// -// Adds argument checking to the generated nodes. Argument checking appears to slow things down -// parsing about 7%. If we want to get that perf back, we can always remove this. -var argumentChecks = false; var forPrettyPrinter = false; interface ITypeDefinition { @@ -13,7 +12,6 @@ interface ITypeDefinition { baseType: string; interfaces?: string[]; children: IMemberDefinition[]; - syntaxKinds?: string[]; isTypeScriptSpecific: boolean; } @@ -25,13 +23,11 @@ interface IMemberDefinition { isSeparatedList?: boolean; requiresAtLeastOneItem?: boolean; isOptional?: boolean; - tokenKinds?: string[]; isTypeScriptSpecific: boolean; elementType?: string; - excludeFromAST?: boolean; } -var interfaces: TypeScript.IIndexable = { +var interfaces: any = { IMemberDeclarationSyntax: 'IClassElementSyntax', IStatementSyntax: 'IModuleElementSyntax', INameSyntax: 'ITypeSyntax', @@ -59,9 +55,9 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IModuleReferenceSyntax'], children: [ - { name: 'requireKeyword', isToken: true, tokenKinds: ['RequireKeyword'], excludeFromAST: true }, + { name: 'requireKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'stringLiteral', isToken: true, tokenKinds: ['StringLiteral'] }, + { name: 'stringLiteral', isToken: true }, { name: 'closeParenToken', isToken: true, excludeFromAST: true } ], isTypeScriptSpecific: true @@ -82,7 +78,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'importKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'equalsToken', isToken: true, excludeFromAST: true }, { name: 'moduleReference', type: 'IModuleReferenceSyntax' }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } @@ -96,7 +92,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'exportKeyword', isToken: true, excludeFromAST: true }, { name: 'equalsToken', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ], isTypeScriptSpecific: true @@ -108,7 +104,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'classKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, { name: 'openBraceToken', isToken: true, excludeFromAST: true }, @@ -124,7 +120,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'interfaceKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'typeParameterList', type: 'TypeParameterListSyntax', isOptional: true }, { name: 'heritageClauses', isList: true, elementType: 'HeritageClauseSyntax' }, { name: 'body', type: 'ObjectTypeSyntax' } @@ -135,10 +131,9 @@ var definitions:ITypeDefinition[] = [ name: 'HeritageClauseSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'extendsOrImplementsKeyword', isToken: true, tokenKinds: ['ExtendsKeyword', 'ImplementsKeyword'] }, + { name: 'extendsOrImplementsKeyword', isToken: true }, { name: 'typeNames', isSeparatedList: true, requiresAtLeastOneItem: true, elementType: 'INameSyntax' } ], - syntaxKinds: ["ExtendsHeritageClause", "ImplementsHeritageClause"], isTypeScriptSpecific: true }, { @@ -148,8 +143,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'moduleKeyword', isToken: true, excludeFromAST: true }, - { name: 'name', type: 'INameSyntax', isOptional: true }, - { name: 'stringLiteral', isToken: true, isOptional: true, tokenKinds: ['StringLiteral'] }, + { name: 'name', type: 'INameSyntax' }, { name: 'openBraceToken', isToken: true, excludeFromAST: true }, { name: 'moduleElements', isList: true, elementType: 'IModuleElementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } @@ -163,10 +157,10 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'functionKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } ] }, { @@ -191,7 +185,7 @@ var definitions:ITypeDefinition[] = [ name: 'VariableDeclaratorSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] @@ -209,10 +203,9 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IUnaryExpressionSyntax'], children: [ - { name: 'operatorToken', isToken: true, tokenKinds: ['PlusPlusToken', 'MinusMinusToken', 'PlusToken', 'MinusToken', 'TildeToken', 'ExclamationToken'] }, + { name: 'operatorToken', isToken: true }, { name: 'operand', type: 'IUnaryExpressionSyntax' } ], - syntaxKinds: ["PreIncrementExpression", "PreDecrementExpression", "PlusExpression", "NegateExpression", "BitwiseNotExpression", "LogicalNotExpression"], }, { name: 'ArrayLiteralExpressionSyntax', @@ -247,8 +240,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'parameter', type: 'ParameterSyntax' }, { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'expression', type: 'IExpressionSyntax', isOptional: true } + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } ], isTypeScriptSpecific: true }, @@ -259,8 +251,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'equalsGreaterThanToken', isToken: true, excludeFromAST: true }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'expression', type: 'IExpressionSyntax', isOptional: true } + { name: 'body', type: 'BlockSyntax | IExpressionSyntax' } ], isTypeScriptSpecific: true }, @@ -271,7 +262,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'left', type: 'INameSyntax' }, { name: 'dotToken', isToken: true, excludeFromAST: true }, - { name: 'right', isToken: true, tokenKinds:['IdentifierName'] } + { name: 'right', isToken: true } ], // Qualified names only show up in Types, which are TypeScript specific. Note that a dotted // expression (like A.B.Foo()) is a MemberAccessExpression, not a QualifiedName. @@ -365,6 +356,28 @@ var definitions:ITypeDefinition[] = [ ], isTypeScriptSpecific: true }, + { + name: 'UnionTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'left', type: 'ITypeSyntax' }, + { name: 'barToken', isToken: true, excludeFromAST: true }, + { name: 'right', type: 'ITypeSyntax' } + ], + isTypeScriptSpecific: true + }, + { + name: 'ParenthesizedTypeSyntax', + baseType: 'ISyntaxNode', + interfaces: ['ITypeSyntax'], + children: [ + { name: 'openParenToken', isToken: true, excludeFromAST: true }, + { name: 'type', type: 'ITypeSyntax' }, + { name: 'closeParenToken', isToken: true, excludeFromAST: true } + ], + isTypeScriptSpecific: true + }, { name: 'TypeAnnotationSyntax', baseType: 'ISyntaxNode', @@ -390,7 +403,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'dotDotDotToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'questionToken', isToken: true, isOptional: true, isTypeScriptSpecific: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true, isTypeScriptSpecific: true } @@ -403,7 +416,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, { name: 'dotToken', isToken: true, excludeFromAST: true }, - { name: 'name', isToken: true, tokenKinds: ['IdentifierName'] } + { name: 'name', isToken: true } ] }, { @@ -412,9 +425,8 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IPostfixExpressionSyntax'], children: [ { name: 'operand', type: 'ILeftHandSideExpressionSyntax' }, - { name: 'operatorToken', isToken: true, tokenKinds:['PlusPlusToken', 'MinusMinusToken'] } + { name: 'operatorToken', isToken: true } ], - syntaxKinds: ["PostIncrementExpression", "PostDecrementExpression"], }, { name: 'ElementAccessExpressionSyntax', @@ -427,6 +439,32 @@ var definitions:ITypeDefinition[] = [ { name: 'closeBracketToken', isToken: true, excludeFromAST: true } ] }, + { + name: 'TemplateAccessExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], + children: [ + { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, + { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' } + ] + }, + { + name: 'TemplateExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPrimaryExpressionSyntax'], + children: [ + { name: 'templateStartToken', isToken: true, excludeFromAST: true }, + { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' } + ] + }, + { + name: 'TemplateClauseSyntax', + baseType: 'ISyntaxNode', + children: [ + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' } + ] + }, { name: 'InvocationExpressionSyntax', baseType: 'ISyntaxNode', @@ -452,27 +490,9 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IExpressionSyntax'], children: [ { name: 'left', type: 'IExpressionSyntax' }, - { name: 'operatorToken', isToken: true, - tokenKinds:['AsteriskToken', 'SlashToken', 'PercentToken', 'PlusToken', 'MinusToken', 'LessThanLessThanToken', - 'GreaterThanGreaterThanToken', 'GreaterThanGreaterThanGreaterThanToken', 'LessThanToken', - 'GreaterThanToken', 'LessThanEqualsToken', 'GreaterThanEqualsToken', 'InstanceOfKeyword', - 'InKeyword', 'EqualsEqualsToken', 'ExclamationEqualsToken', 'EqualsEqualsEqualsToken', - 'ExclamationEqualsEqualsToken', 'AmpersandToken', 'CaretToken', 'BarToken', 'AmpersandAmpersandToken', - 'BarBarToken', 'BarEqualsToken', 'AmpersandEqualsToken', 'CaretEqualsToken', 'LessThanLessThanEqualsToken', - 'GreaterThanGreaterThanEqualsToken', 'GreaterThanGreaterThanGreaterThanEqualsToken', 'PlusEqualsToken', - 'MinusEqualsToken', 'AsteriskEqualsToken', 'SlashEqualsToken', 'PercentEqualsToken', 'EqualsToken', - 'CommaToken'] }, + { name: 'operatorToken', isToken: true }, { name: 'right', type: 'IExpressionSyntax' } ], - syntaxKinds: ["MultiplyExpression", "DivideExpression", "ModuloExpression", "AddExpression", "SubtractExpression", "LeftShiftExpression", - "SignedRightShiftExpression", "UnsignedRightShiftExpression", "LessThanExpression", - "GreaterThanExpression", "LessThanOrEqualExpression", "GreaterThanOrEqualExpression", "InstanceOfExpression", - "InExpression", "EqualsWithTypeConversionExpression", "NotEqualsWithTypeConversionExpression", "EqualsExpression", - "NotEqualsExpression", "BitwiseAndExpression", "BitwiseExclusiveOrExpression", "BitwiseOrExpression", "LogicalAndExpression", - "LogicalOrExpression", "OrAssignmentExpression", "AndAssignmentExpression", "ExclusiveOrAssignmentExpression", "LeftShiftAssignmentExpression", - "SignedRightShiftAssignmentExpression", "UnsignedRightShiftAssignmentExpression", "AddAssignmentExpression", - "SubtractAssignmentExpression", "MultiplyAssignmentExpression", "DivideAssignmentExpression", "ModuloAssignmentExpression", "AssignmentExpression", - "CommaExpression"] }, { name: 'ConditionalExpressionSyntax', @@ -501,7 +521,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true, itTypeScriptSpecific: true }, { name: 'callSignature', type: 'CallSignatureSyntax' } ] @@ -523,7 +543,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } ], @@ -562,7 +582,7 @@ var definitions:ITypeDefinition[] = [ name: 'TypeParameterSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'constraint', type: 'ConstraintSyntax', isOptional: true } ], isTypeScriptSpecific: true @@ -615,8 +635,7 @@ var definitions:ITypeDefinition[] = [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'constructorKeyword', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -626,21 +645,21 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IMemberDeclarationSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax', isOptional: true }, - { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } + { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, { name: 'GetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax' ], + interfaces: ['IAccessorSyntax' ], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'getKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ] @@ -648,11 +667,11 @@ var definitions:ITypeDefinition[] = [ { name: 'SetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'], + interfaces: ['IAccessorSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'setKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ], @@ -751,7 +770,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IStatementSyntax'], children: [ { name: 'breakKeyword', isToken: true }, - { name: 'identifier', isToken: true, isOptional: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true, isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -761,7 +780,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IStatementSyntax'], children: [ { name: 'continueKeyword', isToken: true }, - { name: 'identifier', isToken: true, isOptional: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true, isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -772,11 +791,10 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'forKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'variableDeclaration', type: 'VariableDeclarationSyntax', isOptional: true }, - { name: 'initializer', type: 'IExpressionSyntax', isOptional: true }, - { name: 'firstSemicolonToken', isToken: true, tokenKinds: ['SemicolonToken'], excludeFromAST: true }, + { name: 'initializer', type: 'VariableDeclarationSyntax | IExpressionSyntax', isOptional: true }, + { name: 'firstSemicolonToken', isToken: true, excludeFromAST: true }, { name: 'condition', type: 'IExpressionSyntax', isOptional: true }, - { name: 'secondSemicolonToken', isToken: true, tokenKinds: ['SemicolonToken'], excludeFromAST: true }, + { name: 'secondSemicolonToken', isToken: true, excludeFromAST: true }, { name: 'incrementor', type: 'IExpressionSyntax', isOptional: true }, { name: 'closeParenToken', isToken: true, excludeFromAST: true }, { name: 'statement', type: 'IStatementSyntax' } @@ -789,10 +807,9 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'forKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'variableDeclaration', type: 'VariableDeclarationSyntax', isOptional: true }, - { name: 'left', type: 'IExpressionSyntax', isOptional: true }, + { name: 'left', type: 'VariableDeclarationSyntax | IExpressionSyntax' }, { name: 'inKeyword', isToken: true, excludeFromAST: true }, - { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'right', type: 'IExpressionSyntax' }, { name: 'closeParenToken', isToken: true, excludeFromAST: true }, { name: 'statement', type: 'IStatementSyntax' } ] @@ -828,7 +845,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'enumKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'openBraceToken', isToken: true, excludeFromAST: true }, { name: 'enumElements', isSeparatedList: true, elementType: 'EnumElementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } @@ -839,7 +856,7 @@ var definitions:ITypeDefinition[] = [ name: 'EnumElementSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] }, @@ -865,12 +882,22 @@ var definitions:ITypeDefinition[] = [ { name: 'closeBraceToken', isToken: true, excludeFromAST: true } ] }, + { + name: 'ComputedPropertyNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyNameSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true } + ] + }, { name: 'SimplePropertyAssignmentSyntax', baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'colonToken', isToken: true, excludeFromAST: true }, { name: 'expression', type: 'IExpressionSyntax' } ] @@ -880,7 +907,8 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ] @@ -891,7 +919,8 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IPrimaryExpressionSyntax'], children: [ { name: 'functionKeyword', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, isOptional: true, tokenKinds: ['IdentifierName'] }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'identifier', isToken: true, isOptional: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' }] }, @@ -918,7 +947,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'catchKeyword', isToken: true, excludeFromAST: true }, { name: 'openParenToken', isToken: true, excludeFromAST: true }, - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecified: true }, { name: 'closeParenToken', isToken: true, excludeFromAST: true }, { name: 'block', type: 'BlockSyntax' }] @@ -935,7 +964,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IStatementSyntax'], children: [ - { name: 'identifier', isToken: true, tokenKinds: ['IdentifierName'] }, + { name: 'identifier', isToken: true }, { name: 'colonToken', isToken: true, excludeFromAST: true }, { name: 'statement', type: 'IStatementSyntax' }] }, @@ -976,6 +1005,15 @@ var definitions:ITypeDefinition[] = [ { name: 'voidKeyword', isToken: true, excludeFromAST: true }, { name: 'expression', type: 'IUnaryExpressionSyntax' }] }, + { + name: 'YieldExpressionSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IExpressionSyntax'], + children: [ + { name: 'yieldKeyword', isToken: true }, + { name: 'asterixToken', isToken: true, isOptional: true }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }] + }, { name: 'DebuggerStatementSyntax', baseType: 'ISyntaxNode', @@ -986,19 +1024,11 @@ var definitions:ITypeDefinition[] = [ }]; function firstKind(definition: ITypeDefinition): TypeScript.SyntaxKind { - var kindName = definition.syntaxKinds ? definition.syntaxKinds[0] : getNameWithoutSuffix(definition); - //TypeScript.Environment.standardOut.WriteLine(kindName); - var kind = (TypeScript.SyntaxKind)[kindName]; - //TypeScript.Environment.standardOut.WriteLine(kind); - - return kind; + var kindName = getNameWithoutSuffix(definition); + return (TypeScript.SyntaxKind)[kindName]; } -var sortedDefinitions = definitions.sort((d1, d2) => firstKind(d1) - firstKind(d2)); - -//function endsWith(string: string, value: string): boolean { -// return string.substring(string.length - value.length, string.length) === value; -//} +definitions.sort((d1, d2) => firstKind(d1) - firstKind(d2)); function getStringWithoutSuffix(definition: string) { if (TypeScript.StringUtilities.endsWith(definition, "Syntax")) { @@ -1008,14 +1038,6 @@ function getStringWithoutSuffix(definition: string) { return definition; } -function getStringWithoutPrefix(definition: string) { - if (definition.charAt(0) == "I" && definition.charAt(1).toUpperCase() == definition.charAt(1)) { - return definition.substring(1); - } - - return definition; -} - function getNameWithoutSuffix(definition: ITypeDefinition) { return getStringWithoutSuffix(definition.name); } @@ -1025,7 +1047,7 @@ function getType(child: IMemberDefinition): string { return "ISyntaxToken"; } else if (child.isSeparatedList) { - return child.elementType + "[]"; + return "ISeparatedSyntaxList<" + child.elementType + ">"; } else if (child.isList) { return child.elementType + "[]"; @@ -1035,12 +1057,6 @@ function getType(child: IMemberDefinition): string { } } -var hasKind = false; - -function pascalCase(value: string): string { - return value.substr(0, 1).toUpperCase() + value.substr(1); -} - function camelCase(value: string): string { return value.substr(0, 1).toLowerCase() + value.substr(1); } @@ -1053,968 +1069,76 @@ function getSafeName(child: IMemberDefinition) { return child.name; } -function getPropertyAccess(child: IMemberDefinition, instance = "this"): string { - if (child.type === "SyntaxKind") { - return instance + "._kind"; - } - - return instance + "." + child.name; -} - -function generateProperties(definition: ITypeDefinition): string { - var result = ""; - - if (definition.name === "SourceUnitSyntax") { - result += " public syntaxTree: SyntaxTree = null;\r\n"; - } - - var newLine = false; - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (getType(child) === "SyntaxKind") { - result += " private _" + child.name + ": " + getType(child) + ";\r\n"; - newLine = true; - } - else if (child.name === "arguments") { - result += " public " + child.name + ": " + getType(child) + ";\r\n"; - } - - hasKind = hasKind || (getType(child) === "SyntaxKind"); - } - - if (newLine) { - result += "\r\n"; - } - - return result; -} - -function generateNullChecks(definition: ITypeDefinition): string { - var result = ""; +function generateConstructorFunction(definition: ITypeDefinition) { + var result = " export var " + definition.name + ": " + getNameWithoutSuffix(definition) + "Constructor = function(data: number"; for (var i = 0; i < definition.children.length; i++) { var child = definition.children[i]; - - if (!child.isOptional && !child.isToken) { - result += " if (" + child.name + " === null) { throw Errors.argumentNull('" + child.name + "'); }\r\n"; - } - } - - return result; -} - -function generateIfKindCheck(child: IMemberDefinition, tokenKinds: string[], indent: string): string { - var result = ""; - - result += indent + " if ("; - - for (var j = 0; j < tokenKinds.length; j++) { - if (j > 0) { - result += " && "; - } - - var tokenKind = tokenKinds[j]; - if (tokenKind === "IdentifierName") { - result += "!SyntaxFacts.isIdentifierName(" + child.name + ".tokenKind)"; - } - else { - result += child.name + ".tokenKind !== SyntaxKind." + tokenKind; - } - } - - result += ") { throw Errors.argument('" + child.name + "'); }\r\n"; - return result; -} - -function generateSwitchCase(tokenKind: string, indent: string): string { - return indent + " case SyntaxKind." + tokenKind + ":\r\n"; -} - -function generateBreakStatement(indent: string): string { - return indent + " break;\r\n"; -} - -function generateSwitchCases(tokenKinds: string[], indent: string): string { - var result = ""; - for (var j = 0; j < tokenKinds.length; j++) { - var tokenKind = tokenKinds[j]; - - result += generateSwitchCase(tokenKind, indent); - } - - if (tokenKinds.length > 0) { - result += generateBreakStatement(indent); - } - - return result; -} - -function generateDefaultCase(child: IMemberDefinition, indent: string): string { - var result = ""; - - result += indent + " default:\r\n"; - result += indent + " throw Errors.argument('" + child.name + "');\r\n"; - - return result; -} - -function generateSwitchKindCheck(child: IMemberDefinition, tokenKinds: string[], indent: string): string { - if (tokenKinds.length === 0) { - return ""; - } - - var result = ""; - - var identifierName = TypeScript.ArrayUtilities.where(tokenKinds, v => v.indexOf("IdentifierName") >= 0); - var notIdentifierName = TypeScript.ArrayUtilities.where(tokenKinds, v => v.indexOf("IdentifierName") < 0); - - if (identifierName.length > 0) { - result += indent + " if (!SyntaxFacts.isIdentifierName(" + child.name + ".tokenKind)) {\r\n"; - if (notIdentifierName.length === 0) { - result += indent + " throw Errors.argument('" + child.name + "');\r\n"; - result += indent + " }\r\n"; - return result; - } - - indent += " "; - } - - if (notIdentifierName.length <= 2) { - result += generateIfKindCheck(child, notIdentifierName, indent); - } - else if (notIdentifierName.length > 2) { - result += indent + " switch (" + child.name + ".tokenKind) {\r\n"; - result += generateSwitchCases(notIdentifierName, indent); - result += generateDefaultCase(child, indent); - result += indent + " }\r\n"; - } - - if (identifierName.length > 0) { - result += indent + " }\r\n"; - } - - // result += indent + " }\r\n"; - return result; -} - -function tokenKinds(child: IMemberDefinition): string[] { - return child.tokenKinds - ? child.tokenKinds - : [pascalCase(child.name)]; -} - -function generateKindCheck(child: IMemberDefinition): string { - var indent = ""; - var result = ""; - - if (child.isOptional) { - indent = " "; - - result += " if (" + child.name + " !== null) {\r\n"; - } - - var kinds = tokenKinds(child); - - if (kinds.length <= 2) { - result += generateIfKindCheck(child, kinds, indent); - } - else { - result += generateSwitchKindCheck(child, kinds, indent); - } - - if (child.isOptional) { - result += " }\r\n"; - } - - return result; -} - -function generateKindChecks(definition: ITypeDefinition): string { - var result = ""; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (child.isToken) { - result += generateKindCheck(child); - } - } - - return result; -} - -function generateArgumentChecks(definition: ITypeDefinition): string { - var result = ""; - - if (argumentChecks) { - result += generateNullChecks(definition); - result += generateKindChecks(definition); - - if (definition.children.length > 0) { - result += "\r\n"; - } - } - - return result; -} - -function generateConstructor(definition: ITypeDefinition): string { - var i: number; - var child: IMemberDefinition; - var base = baseType(definition); - - var result = ""; - result += " constructor(" - - var children = definition.children; - var kindChild: IMemberDefinition = null; - for (i = 0; i < children.length; i++) { - child = children[i]; - - if (getType(child) === "SyntaxKind") { - kindChild = child; - } - - if (getType(child) !== "SyntaxKind" && child.name !== "arguments") { - result += "public "; - } - - result += getSafeName(child) + ": " + getType(child); - result += ",\r\n "; - } - - result += "data: number) {\r\n"; - - if (kindChild) { - result += " super(kind, data); \r\n"; - } - else { - result += " super(SyntaxKind." + getNameWithoutSuffix(definition) + ", data); \r\n"; - } - - if (definition.children.length > 0) { - result += "\r\n"; - } - - result += generateArgumentChecks(definition); - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (child.type === "SyntaxKind" || child.name === "arguments") { - result += " " + getPropertyAccess(child) + " = " + getSafeName(child) + ";\r\n"; - } - } - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (child.type !== "SyntaxKind") { - if (child.isOptional) { - result += " " + getSafeName(child) + " && (" + getSafeName(child) + ".parent = this);\r\n"; - } - else if (child.isList || child.isSeparatedList) { - result += " !isShared(" + getSafeName(child) + ") && (" + getSafeName(child) + ".parent = this);\r\n"; - } - else { - result += " " + getSafeName(child) + ".parent = this;\r\n"; - } - } - } - - //result += " Syntax.setParentForChildren(this);\r\n"; - result += " }\r\n"; - - return result; -} - -function isOptional(child: IMemberDefinition) { - if (child.isOptional) { - return true; - } - - if (child.isList && !child.requiresAtLeastOneItem) { - return true; - } - - if (child.isSeparatedList && !child.requiresAtLeastOneItem) { - return true; - } - - return false; -} - -function generateFactory1Method(definition: ITypeDefinition): string { - return ""; - - var mandatoryChildren = TypeScript.ArrayUtilities.where( - definition.children, c => !isOptional(c)); - if (mandatoryChildren.length === definition.children.length) { - return ""; - } - - var result = "\r\n public static create(" - var i: number; - var child: IMemberDefinition; - - for (i = 0; i < mandatoryChildren.length; i++) { - child = mandatoryChildren[i]; - - result += child.name + ": " + getType(child); - - if (i < mandatoryChildren.length - 1) { - result += ",\r\n "; - } - } - - result += "): " + definition.name + " {\r\n"; - - result += " return new " + definition.name + "("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (!isOptional(child)) { - result += child.name; - } - else if (child.isList) { - result += "Syntax.emptyList<" + child.elementType + ">()"; - } - else if (child.isSeparatedList) { - result += "Syntax.emptySeparatedList<" + child.elementType + ">()"; - } - else { - result += "null"; - } - result += ", "; - } - - result += "/*data:*/ 0);\r\n"; - result += " }\r\n"; - - return result; -} - -function isKeywordOrPunctuation(kind: string): boolean { - if (TypeScript.StringUtilities.endsWith(kind, "Keyword")) { - return true; - } - - if (TypeScript.StringUtilities.endsWith(kind, "Token") && - kind !== "IdentifierName" && - kind !== "EndOfFileToken") { - return true; - } - - return false; -} - -function isDefaultConstructable(definition: ITypeDefinition): boolean { - if (definition === null) { - return false; - } - - for (var i = 0; i < definition.children.length; i++) { - if (isMandatory(definition.children[i])) { - // If any child is mandatory, then the type is not default constructable. - return false; - } - } - - // We can default construct this. - return true; -} - -function isMandatory(child: IMemberDefinition): boolean { - // If it's optional then it's not mandatory. - if (isOptional(child)) { - return false; - } - - // Kinds are always mandatory. As are non-optional lists. - if (child.type === "SyntaxKind" || child.isList || child.isSeparatedList) { - return true; - } - - // We have a non optional node or token. Tokens are mandatory if they're not keywords or - // punctuation. - if (child.isToken) { - var kinds = tokenKinds(child); - var isFixed = kinds.length === 1 && isKeywordOrPunctuation(kinds[0]); - - return !isFixed; - } - - // It's a node. It's mandatory if we can't default construct it. - return !isDefaultConstructable(memberDefinitionType(child)); -} - -function generateFactory2Method(definition: ITypeDefinition): string { - return ""; - - var mandatoryChildren: IMemberDefinition[] = TypeScript.ArrayUtilities.where(definition.children, isMandatory); - if (mandatoryChildren.length === definition.children.length) { - return ""; - } - - var i: number; - var child: IMemberDefinition; - var result = "\r\n public static create1(" - - for (i = 0; i < mandatoryChildren.length; i++) { - child = mandatoryChildren[i]; - - result += child.name + ": " + getType(child); - - if (i < mandatoryChildren.length - 1) { - result += ",\r\n "; - } - } - - result += "): " + definition.name + " {\r\n"; - result += " return new " + definition.name + "("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (isMandatory(child)) { - result += child.name; - } - else if (child.isList) { - result += "Syntax.emptyList<" + child.elementType + ">()"; - } - else if (child.isSeparatedList) { - result += "Syntax.emptySeparatedList<" + child.elementType + ">()"; - } - else if (isOptional(child)) { - result += "null"; - } - else if (child.isToken) { - result += "Syntax.token(SyntaxKind." + tokenKinds(child)[0] + ")"; - } - else { - result += child.type + ".create1()"; - } - - result += ", "; - } - - result += "/*data:*/ 0);\r\n"; - result += " }\r\n"; - - return result; -} - -function generateFactoryMethod(definition: ITypeDefinition): string { - return generateFactory1Method(definition) + generateFactory2Method(definition); -} - -function generateBrands(definition: ITypeDefinition, accessibility: boolean): string { - var properties = ""; - - var types: string[] = []; - if (definition.interfaces) { - var ifaces = definition.interfaces.slice(0); - var i: number; - for (i = 0; i < ifaces.length; i++) { - var current = ifaces[i]; - - while (current !== undefined) { - if (!TypeScript.ArrayUtilities.contains(ifaces, current)) { - ifaces.push(current); - } - - current = interfaces[current]; - } - } - - for (i = 0; i < ifaces.length; i++) { - var type = ifaces[i]; - type = getStringWithoutSuffix(type); - if (isInterface(type)) { - type = "_" + type.substr(1, 1).toLowerCase() + type.substr(2) + "Brand"; - } - - types.push(type); - } - } - - if (types.length > 0) { - properties += " "; - - for (var i = 0; i < types.length; i++) { - if (accessibility) { - properties += " public "; - } - - properties += types[i] + ": any;"; - } - - properties += "\r\n"; - } - - return properties; -} - -function generateKindMethod(definition: ITypeDefinition): string { - var result = ""; - - //if (!hasKind) { - // result += "\r\n"; - // result += " public get kind(): SyntaxKind {\r\n"; - // result += " return SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; - // result += " }\r\n"; - //} - - return result; -} - -function generateSlotMethods(definition: ITypeDefinition): string { - var result = ""; - return result; - - result += "\r\n"; - result += " public childCount(): number {\r\n"; - var slotCount = hasKind ? (definition.children.length - 1) : definition.children.length; - - result += " return " + slotCount + ";\r\n"; - result += " }\r\n\r\n"; - - result += " public childAt(slot: number): ISyntaxElement {\r\n"; - - if (slotCount === 0) { - result += " throw Errors.invalidOperation();\r\n"; - } - else { - result += " switch (slot) {\r\n"; - - var index = 0; - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - if (child.type === "SyntaxKind") { - continue; - } - - result += " case " + index + ": return this." + child.name + ";\r\n"; - index++; - } - - result += " default: throw Errors.invalidOperation();\r\n"; - result += " }\r\n"; - } - - result += " }\r\n"; - - return result; -} - -function generateFirstTokenMethod(definition: ITypeDefinition): string { - var result = ""; - - result += "\r\n"; - result += " public firstToken(): ISyntaxToken {\r\n"; - result += " var token = null;\r\n"; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (getType(child) === "SyntaxKind") { - continue; - } - - if (child.name === "endOfFileToken") { - continue; - } - - result += " if ("; - - if (child.isOptional) { - result += getPropertyAccess(child) + " !== null && "; - } - - if (child.isToken) { - result += getPropertyAccess(child) + ".width() > 0"; - result += ") { return " + getPropertyAccess(child) + "; }\r\n"; - } - else { - result += "(token = " + getPropertyAccess(child) + ".firstToken()) !== null"; - result += ") { return token; }\r\n"; - } - } - - if (definition.name === "SourceUnitSyntax") { - result += " return this._endOfFileToken;\r\n"; - } - else { - result += " return null;\r\n"; - } - - result += " }\r\n"; - - result += " }\r\n"; - - return result; -} - -function generateLastTokenMethod(definition: ITypeDefinition): string { - var result = ""; - - result += "\r\n"; - result += " public lastToken(): ISyntaxToken {\r\n"; - - if (definition.name === "SourceUnitSyntax") { - result += " return this._endOfFileToken;\r\n"; - } - else { - result += " var token = null;\r\n"; - - for (var i = definition.children.length - 1; i >= 0; i--) { - var child = definition.children[i]; - - if (getType(child) === "SyntaxKind") { - continue; - } - - if (child.name === "endOfFileToken") { - continue; - } - - result += " if ("; - - if (child.isOptional) { - result += getPropertyAccess(child) + " !== null && "; - } - - if (child.isToken) { - result += getPropertyAccess(child) + ".width() > 0"; - result += ") { return " + getPropertyAccess(child) + "; }\r\n"; - } - else { - result += "(token = " + getPropertyAccess(child) + ".lastToken()) !== null"; - result += ") { return token; }\r\n"; - } - } - - result += " return null;\r\n"; - } - - result += " }\r\n"; - - return result; -} - -function baseType(definition: ITypeDefinition): ITypeDefinition { - return TypeScript.ArrayUtilities.firstOrDefault(definitions, d => d.name === definition.baseType); -} - -function memberDefinitionType(child: IMemberDefinition): ITypeDefinition { - // Debug.assert(child.type !== undefined); - return TypeScript.ArrayUtilities.firstOrDefault(definitions, d => d.name === child.type); -} - -function derivesFrom(def1: ITypeDefinition, def2: ITypeDefinition): boolean { - var current = def1; - while (current !== null) { - var base = baseType(current); - if (base === def2) { - return true; - } - - current = base; - } - - return false; -} - -function contains(definition: ITypeDefinition, child: IMemberDefinition) { - return TypeScript.ArrayUtilities.any(definition.children, - c => c.name === child.name && - c.isList === child.isList && - c.isSeparatedList === child.isSeparatedList && - c.isToken === child.isToken && - c.type === child.type); -} - -function generateAccessors(definition: ITypeDefinition): string { - var result = ""; - - //if (definition.name === "SourceUnitSyntax") { - // result += "\r\n"; - // result += " public syntaxTree(): SyntaxTree {\r\n"; - // result += " return this._syntaxTree;\r\n"; - // result += " }\r\n"; - //} - - //for (var i = 0; i < definition.children.length; i++) { - // var child = definition.children[i]; - - // if (child.type === "SyntaxKind") { - // result += "\r\n"; - // result += " public get " + child.name + "(): " + getType(child) + " {\r\n"; - // result += " return " + getPropertyAccess(child) + ";\r\n"; - // result += " }\r\n"; - // } - //} - - return result; -} - -function generateWithMethod(definition: ITypeDefinition, child: IMemberDefinition): string { - return ""; - - var result = ""; - result += "\r\n"; - result += " public with" + pascalCase(child.name) + "(" + getSafeName(child) + ": " + getType(child) + "): " + definition.name + " {\r\n"; - result += " return this.update(" - - for (var i = 0; i < definition.children.length; i++) { - if (i > 0) { - result += ", "; - } - - if (definition.children[i] === child) { - result += getSafeName(child); - } - else { - result += getPropertyAccess(definition.children[i]); - } - } - - result += ");\r\n"; - result += " }\r\n"; - - if (child.isList || child.isSeparatedList) { - if (TypeScript.StringUtilities.endsWith(child.name, "s")) { - var pascalName = pascalCase(child.name); - pascalName = pascalName.substring(0, pascalName.length - 1); - - var argName = getSafeName(child); - argName = argName.substring(0, argName.length - 1) - - result += "\r\n"; - result += " public with" + pascalName + "(" + argName + ": " + child.elementType + "): " + definition.name + " {\r\n"; - result += " return this.with" + pascalCase(child.name) + "(" - - if (child.isList) { - result += "Syntax.list<" + child.elementType + ">([" + argName + "])"; - } - else { - result += "Syntax.separatedList<" + child.elementType + ">([" + argName + "])"; - } - - result += ");\r\n"; - result += " }\r\n"; - } - } - - return result; -} - -function generateWithMethods(definition: ITypeDefinition): string { - var result = ""; - return ""; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - result += generateWithMethod(definition, child); - } - - return result; -} - -function generateTriviaMethods(definition: ITypeDefinition): string { - return ""; - - var result = "\r\n"; - result += " public withLeadingTrivia(trivia: ISyntaxTriviaList): " + definition.name + " {\r\n"; - result += " return <" + definition.name + ">super.withLeadingTrivia(trivia);\r\n"; - result += " }\r\n\r\n"; - result += " public withTrailingTrivia(trivia: ISyntaxTriviaList): " + definition.name + " {\r\n"; - result += " return <" + definition.name + ">super.withTrailingTrivia(trivia);\r\n"; - result += " }\r\n"; - - return result; -} - -function generateUpdateMethod(definition: ITypeDefinition): string { - // return ""; - - var result = ""; - - result += "\r\n"; - result += " public update("; - - var i: number; - var child: IMemberDefinition; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - result += getSafeName(child) + ": " + getType(child); - - if (i < definition.children.length - 1) { - result += ",\r\n "; - } - } - - result += "): " + definition.name + " {\r\n"; - - if (definition.children.length === 0) { - result += " return this;\r\n"; - } - else { - result += " if ("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - if (i !== 0) { - result += " && "; - } - - result += getPropertyAccess(child) + " === " + getSafeName(child); - } - - result += ") {\r\n"; - result += " return this;\r\n"; - result += " }\r\n\r\n"; - - result += " return new " + definition.name + "("; - - for (i = 0; i < definition.children.length; i++) { - child = definition.children[i]; - - result += getSafeName(child); - result += ", "; - } - - result += "this.parsedInStrictMode() ? SyntaxConstants.NodeParsedInStrictModeMask : 0);\r\n"; - } - - result += " }\r\n"; - - return result; -} - -function generateNode(definition: ITypeDefinition, abstract: boolean): string { - var result = " export class " + definition.name + " extends SyntaxNode" - - if (definition.interfaces) { - result += " implements "; - result += definition.interfaces.join(", "); - } - - result += " {\r\n"; - - if (definition.name === "SourceUnitSyntax") { - result += " public syntaxTree: SyntaxTree = null;\r\n"; - } - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - result += " public " + child.name + ": " + getType(child) + ";\r\n"; - } - - result += generateBrands(definition, /*accessibility:*/ true); - - result += " constructor(data: number"; - - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - result += ", " + getSafeName(child) + ": " + getType(child); + result += getSafeName(child); + result += ": " + getType(child); } result += ") {\r\n"; - result += " super(data);\r\n"; - if (definition.name === "SourceUnitSyntax") { - result += " this.parent = null,\r\n"; - } + result += " if (data) { this.__data = data; }\r\n"; + + if (definition.children.length) { + result += " "; - if (definition.children) { for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - if (child.excludeFromAST && abstract) { - continue; + if (i) { + result += ", "; } - result += " this." + child.name + " = " + getSafeName(child) + ",\r\n"; + var child = definition.children[i]; + result += "this." + child.name + " = " + getSafeName(child); } + + result += ";\r\n"; } if (definition.children.length > 0) { - var first = true; + result += " "; + for (var i = 0; i < definition.children.length; i++) { + if (i) { + result += ", "; + } + var child = definition.children[i]; - if (child.excludeFromAST && abstract) { - continue; - } - if (!first) { - result += ",\r\n"; - } - first = false; - - if (child.isList || child.isSeparatedList) { - result += " !isShared(" + getSafeName(child) + ") && (" + getSafeName(child) + ".parent = this)"; - } - else if (child.isOptional) { - result += " " + getSafeName(child) + " && (" + getSafeName(child) + ".parent = this)"; + if (child.isOptional) { + result += getSafeName(child) + " && (" + getSafeName(child) + ".parent = this)"; } else { - result += " " + getSafeName(child) + ".parent = this"; + result += getSafeName(child) + ".parent = this"; } } result += ";\r\n"; } - result += " }\r\n"; + result += " };\r\n"; + result += " " + definition.name + ".prototype.kind = SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; + result += " " + definition.name + ".prototype.childCount = " + definition.children.length + ";\r\n"; + result += " " + definition.name + ".prototype.childAt = function(index: number): ISyntaxElement {\r\n"; + if (definition.children.length) { + result += " switch (index) {\r\n"; - if (definition.name === "BinaryExpressionSyntax") { - result += " public kind(): SyntaxKind { return SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); }\r\n"; - } - else if (definition.name === "PrefixUnaryExpressionSyntax") { - result += " public kind(): SyntaxKind { return SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); }\r\n"; - } - else if (definition.name === "PostfixUnaryExpressionSyntax") { - result += " public kind(): SyntaxKind { return SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); }\r\n"; - } - else if (definition.name === "HeritageClauseSyntax") { - result += " public kind(): SyntaxKind { return this.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword ? SyntaxKind.ExtendsHeritageClause : SyntaxKind.ImplementsHeritageClause; }\r\n"; - } + for (var j = 0; j < definition.children.length; j++) { + result += " case " + j + ": return this." + definition.children[j].name + ";\r\n"; + } + + result += " }\r\n"; + } + else { + result += " throw Errors.invalidOperation();\r\n"; + } + result += " }\r\n"; - result += " }"; return result; } -function syntaxKindName(kind: TypeScript.SyntaxKind): string { - for (var name in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind[name] === kind) { - return name; - } - } - - throw new Error(); -} - -function getDefinitionForKind(kind: TypeScript.SyntaxKind): ITypeDefinition { - var kindName = syntaxKindName(kind); - - return TypeScript.ArrayUtilities.firstOrDefault(definitions, d => { - if (getNameWithoutSuffix(d) === kindName) { - return true; - } - - if (d.syntaxKinds) { - return TypeScript.ArrayUtilities.contains(d.syntaxKinds, kindName); - } - - return false; - }); -} - function generateSyntaxInterfaces(): string { var result = "///\r\n\r\n"; @@ -2030,48 +1154,6 @@ function generateSyntaxInterfaces(): string { result += generateSyntaxInterface(definition); } - result += "\r\n\r\n"; - - result += " export var nodeMetadata: string[][] = ["; - for (var i = 0; i <= TypeScript.SyntaxKind.LastNode; i++) { - if (i < TypeScript.SyntaxKind.FirstNode) { - result += "[],"; - continue; - } - - var kindName = syntaxKindName(i); - - var definition = getDefinitionForKind(i); - - var metadata = "["; - var children = definition.children.filter(m => m.type !== "SyntaxKind").map(m => '"' + m.name + '"'); - metadata += children.join(","); - metadata += "],"; - - result += metadata; - } - result += "];\r\n\r\n"; - - result += " export module Syntax {\r\n" - - result += " export interface ISyntaxFactory {\r\n"; - result += " isConcrete: boolean;\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " " + definition.name + ": { new(data: number"; - - for (var j = 0; j < definition.children.length; j++) { - var child = definition.children[j]; - result += ", " + child.name + ": " + getType(child); - } - - result += "): " + definition.name + " };\r\n"; - } - - result += " }\r\n"; - result += " }\r\n"; - result += "}"; return result; } @@ -2095,53 +1177,40 @@ function generateSyntaxInterface(definition: ITypeDefinition): string { result += " " + child.name + ": " + getType(child) + ";\r\n"; } - result += " }"; + result += " }\r\n"; + result += " export interface " + getNameWithoutSuffix(definition) + "Constructor {"; + result += " new (data: number"; + + for (var i = 0; i < definition.children.length; i++) { + var child = definition.children[i]; + result += ", "; + result += getSafeName(child); + result += ": " + getType(child); + } + + result += "): " + definition.name; + result += " }\r\n"; return result; } - -function generateNodes(abstract: boolean): string { +function generateNodes(): string { var result = "///\r\n\r\n"; - result += "module TypeScript.Syntax."; - - var moduleName = abstract ? "Abstract" : "Concrete"; - result += moduleName; + result += "module TypeScript"; result += " {\r\n"; - result += " // Inject this module as the factory for producing syntax nodes in the parser.\r\n"; - result += " Parser.syntaxFactory = " + moduleName + ";\r\n"; - result += " export var isConcrete: boolean = " + !abstract + ";\r\n\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; - if (i > 0) { + if (i) { result += "\r\n"; } - result += generateNode(definition, abstract); + result += generateConstructorFunction(definition); } - result += "\r\n\r\n "; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - - if (definition.syntaxKinds) { - continue; - } - - if (i) { - result += ", " - } - - result += "(" + definition.name + ").prototype.__kind = SyntaxKind." + getNameWithoutSuffix(definition) - } - - result += ";\r\n"; - result += "}"; return result; } @@ -2150,194 +1219,30 @@ function isInterface(name: string) { return name.substr(0, 1) === "I" && name.substr(1, 1).toUpperCase() === name.substr(1, 1) } -function isNodeOrToken(child: IMemberDefinition) { - // IWhatever. - return child.type && isInterface(child.type); -} - -function generateRewriter(): string { - var result = "///\r\n\r\n"; - - result += "module TypeScript {\r\n" + -" export class SyntaxRewriter implements ISyntaxVisitor {\r\n" + -" public visitToken(token: ISyntaxToken): ISyntaxToken {\r\n" + -" return token;\r\n" + -" }\r\n" + -"\r\n" + -" public visitNode(node: ISyntaxNode): ISyntaxNode {\r\n" + -" return visitNodeOrToken(this, node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitNodeOrToken(node: ISyntaxNodeOrToken): ISyntaxNodeOrToken {\r\n" + -" return isToken(node) ? this.visitToken(node) : this.visitNode(node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitList(list: T[]): T[] {\r\n" + -" var newItems: T[] = null;\r\n" + -"\r\n" + -" for (var i = 0, n = list.length; i < n; i++) {\r\n" + -" var item = list[i];\r\n" + -" var newItem = this.visitNodeOrToken(item);\r\n" + -"\r\n" + -" if (item !== newItem && newItems === null) {\r\n" + -" newItems = [];\r\n" + -" for (var j = 0; j < i; j++) {\r\n" + -" newItems.push(list[j]);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" if (newItems) {\r\n" + -" newItems.push(newItem);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" // Debug.assert(newItems === null || newItems.length === childCount(list));\r\n" + -" return newItems === null ? list : Syntax.list(newItems);\r\n" + -" }\r\n" + -"\r\n" + -" public visitSeparatedList(list: T[]): T[] {\r\n" + -" var newItems: ISyntaxNodeOrToken[] = null;\r\n" + -"\r\n" + -" for (var i = 0, n = childCount(list); i < n; i++) {\r\n" + -" var item = childAt(list, i);\r\n" + -" var newItem = isToken(item) ? this.visitToken(item) : this.visitNode(item);\r\n" + -"\r\n" + -" if (item !== newItem && newItems === null) {\r\n" + -" newItems = [];\r\n" + -" for (var j = 0; j < i; j++) {\r\n" + -" newItems.push(childAt(list, j));\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" if (newItems) {\r\n" + -" newItems.push(newItem);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" // Debug.assert(newItems === null || newItems.length === childCount(list));\r\n" + -" return newItems === null ? list : Syntax.separatedList(newItems);\r\n" + -" }\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - - result += "\r\n"; - result += " public visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any {\r\n"; - - if (definition.children.length === 0) { - result += " return node;\r\n" - result += " }\r\n"; - continue; - } - - //if (definition.children.length === 1) { - // result += " return node.with" + pascalCase(definition.children[0].name) + "(\r\n"; - //} - //else { - result += " return node.update(\r\n"; - //} - - for (var j = 0; j < definition.children.length; j++) { - var child = definition.children[j]; - - result += " "; - if (child.isOptional) { - result += "node." + child.name + " === null ? null : "; - } - - if (child.isToken) { - result += "this.visitToken(node." + child.name + ")"; - } - else if (child.isList) { - result += "this.visitList(node." + child.name + ")"; - } - else if (child.isSeparatedList) { - result += "this.visitSeparatedList(node." + child.name + ")"; - } - else if (child.type === "SyntaxKind") { - result += "node.kind"; - } - else if (isNodeOrToken(child)) { - result += "<" + child.type + ">this.visitNodeOrToken(node." + child.name + ")"; - } - else { - result += "<" + child.type + ">this.visitNode(node." + child.name + ")"; - } - - if (j < definition.children.length - 1) { - result += ",\r\n"; - } - } - - result += ");\r\n"; - result += " }\r\n"; - } - - result += " }"; - result += "\r\n}"; - return result; -} - function generateWalker(): string { var result = ""; result += -"///\r\n"+ -"\r\n" + -"module TypeScript {\r\n" + -" export class SyntaxWalker implements ISyntaxVisitor {\r\n" + -" public visitToken(token: ISyntaxToken): void {\r\n" + -" }\r\n" + -"\r\n" + -" public visitNode(node: ISyntaxNode): void {\r\n" + -" visitNodeOrToken(this, node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void {\r\n" + -" if (isToken(nodeOrToken)) { \r\n" + -" this.visitToken(nodeOrToken);\r\n" + -" }\r\n" + -" else {\r\n" + -" this.visitNode(nodeOrToken);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" private visitOptionalToken(token: ISyntaxToken): void {\r\n" + -" if (token === null) {\r\n" + -" return;\r\n" + -" }\r\n" + -"\r\n" + -" this.visitToken(token);\r\n" + -" }\r\n" + -"\r\n" + -" public visitOptionalNode(node: ISyntaxNode): void {\r\n" + -" if (node === null) {\r\n" + -" return;\r\n" + -" }\r\n" + -"\r\n" + -" this.visitNode(node);\r\n" + -" }\r\n" + -"\r\n" + -" public visitOptionalNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void {\r\n" + -" if (nodeOrToken === null) {\r\n" + -" return;\r\n" + -" }\r\n" + -"\r\n" + -" this.visitNodeOrToken(nodeOrToken);\r\n" + -" }\r\n" + -"\r\n" + -" public visitList(list: ISyntaxNodeOrToken[]): void {\r\n" + -" for (var i = 0, n = list.length; i < n; i++) {\r\n" + -" this.visitNodeOrToken(list[i]);\r\n" + -" }\r\n" + -" }\r\n" + -"\r\n" + -" public visitSeparatedList(list: ISyntaxNodeOrToken[]): void {\r\n" + -" for (var i = 0, n = childCount(list); i < n; i++) {\r\n" + -" var item = childAt(list, i);\r\n" + -" this.visitNodeOrToken(item);\r\n" + -" }\r\n" + -" }\r\n"; + "///\r\n" + + "\r\n" + + "module TypeScript {\r\n" + + " export class SyntaxWalker implements ISyntaxVisitor {\r\n" + + " public visitToken(token: ISyntaxToken): void {\r\n" + + " }\r\n" + + "\r\n" + + " private visitOptionalToken(token: ISyntaxToken): void {\r\n" + + " if (token === undefined) {\r\n" + + " return;\r\n" + + " }\r\n" + + "\r\n" + + " this.visitToken(token);\r\n" + + " }\r\n" + + "\r\n" + + " public visitList(list: ISyntaxNodeOrToken[]): void {\r\n" + + " for (var i = 0, n = list.length; i < n; i++) {\r\n" + + " visitNodeOrToken(this, list[i]);\r\n" + + " }\r\n" + + " }\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; @@ -2356,27 +1261,19 @@ function generateWalker(): string { result += " this.visitToken(node." + child.name + ");\r\n"; } } - else if (child.isList) { + else if (child.isList || child.isSeparatedList) { result += " this.visitList(node." + child.name + ");\r\n"; } - else if (child.isSeparatedList) { - result += " this.visitSeparatedList(node." + child.name + ");\r\n"; - } - else if (isNodeOrToken(child)) { + else if (child.isToken) { if (child.isOptional) { - result += " this.visitOptionalNodeOrToken(node." + child.name + ");\r\n"; + result += " this.visitOptionalToken(node." + child.name + ");\r\n"; } else { - result += " this.visitNodeOrToken(node." + child.name + ");\r\n"; + result += " this.visitToken(node." + child.name + ");\r\n"; } } - else if (child.type !== "SyntaxKind") { - if (child.isOptional) { - result += " this.visitOptionalNode(node." + child.name + ");\r\n"; - } - else { - result += " this.visitNode(node." + child.name + ");\r\n"; - } + else { + result += " visitNodeOrToken(this, node." + child.name + ");\r\n"; } } @@ -2397,7 +1294,7 @@ function firstEnumName(e: any, value: number) { } function groupBy(array: T[], func: (v: T) => string): any { - var result: TypeScript.IIndexable = {}; + var result: any = {}; for (var i = 0, n = array.length; i < n; i++) { var v: any = array[i]; @@ -2440,7 +1337,6 @@ function generateKeywordCondition(keywords: { text: string; kind: TypeScript.Syn } else { result += " // " + TypeScript.ArrayUtilities.select(keywords, k => k.text).join(", ") + "\r\n" - // result += "\r\n"; index = currentCharacter === 0 ? "start" : ("start + " + currentCharacter); result += indent + "switch(str.charCodeAt(" + index + ")) {\r\n" @@ -2461,7 +1357,6 @@ function generateKeywordCondition(keywords: { text: string; kind: TypeScript.Syn } function min(array: T[], func: (v: T) => number): number { - // Debug.assert(array.length > 0); var min = func(array[0]); for (var i = 1; i < array.length; i++) { @@ -2475,7 +1370,6 @@ function min(array: T[], func: (v: T) => number): number { } function max(array: T[], func: (v: T) => number): number { - // Debug.assert(array.length > 0); var max = func(array[0]); for (var i = 1; i < array.length; i++) { @@ -2488,11 +1382,43 @@ function max(array: T[], func: (v: T) => number): number { return max; } +function generateUtilities(): string { + var result = ""; + result += " var fixedWidthArray = ["; + for (var i = 0; i <= TypeScript.SyntaxKind.LastFixedWidth; i++) { + if (i) { + result += ", "; + } + + if (i < TypeScript.SyntaxKind.FirstFixedWidth) { + result += "0"; + } + else { + result += TypeScript.SyntaxFacts.getText(i).length; + } + } + result += "];\r\n"; + + result += " function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; + result += " return fixedWidthArray[kind];\r\n"; + + //result += " switch (kind) {\r\n"; + + //for (var k = TypeScript.SyntaxKind.FirstFixedWidth; k <= TypeScript.SyntaxKind.LastFixedWidth; k++) { + // result += " case SyntaxKind." + syntaxKindName(k) + ": return " + TypeScript.SyntaxFacts.getText(k).length + ";\r\n"; + //} + //result += " default: throw new Error();\r\n"; + //result += " }\r\n"; + result += " }\r\n"; + + return result; +} + function generateScannerUtilities(): string { var result = "///\r\n" + "\r\n" + "module TypeScript {\r\n" + - " export class ScannerUtilities {\r\n"; + " export module ScannerUtilities {\r\n"; var i: number; var keywords: { text: string; kind: TypeScript.SyntaxKind; }[] = []; @@ -2503,7 +1429,7 @@ function generateScannerUtilities(): string { keywords.sort((a, b) => a.text.localeCompare(b.text)); - result += " public static identifierKind(str: string, start: number, length: number): SyntaxKind {\r\n"; + result += " export function identifierKind(str: string, start: number, length: number): SyntaxKind {\r\n"; var minTokenLength = min(keywords, k => k.text.length); var maxTokenLength = max(keywords, k => k.text.length); @@ -2528,6 +1454,16 @@ function generateScannerUtilities(): string { return result; } +function syntaxKindName(kind: TypeScript.SyntaxKind): string { + for (var name in TypeScript.SyntaxKind) { + if (TypeScript.SyntaxKind[name] === kind) { + return name; + } + } + + throw new Error(); +} + function generateVisitor(): string { var result = ""; @@ -2535,36 +1471,26 @@ function generateVisitor(): string { result += "module TypeScript {\r\n"; result += " export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any {\r\n"; - result += " if (element === null) { return null; }\r\n"; - result += " if (isToken(element)) { return visitor.visitToken(element); }\r\n"; - result += " switch (element.kind()) {\r\n"; + result += " if (element === undefined) { return undefined; }\r\n"; + + result += " switch (element.kind) {\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; - if (definition.syntaxKinds) { - result += " "; - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":" - } - result += "\r\n "; - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; - } - + result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; result += "return visitor.visit" + getNameWithoutSuffix(definition) + "(<" + definition.name + ">element);\r\n"; } - result += " }\r\n\r\n"; - result += " throw Errors.invalidOperation();\r\n"; + result += " default: return visitor.visitToken(element);\r\n"; + result += " }\r\n"; result += " }\r\n\r\n"; result += " export interface ISyntaxVisitor {\r\n"; result += " visitToken(token: ISyntaxToken): any;\r\n"; - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; + for (var i = 0; i < definitions.length; i++) { + var definition = definitions[i]; result += " visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any;\r\n"; } @@ -2575,320 +1501,16 @@ function generateVisitor(): string { return result; } -function generateDefaultVisitor(): string { - var result = ""; - - result += "///\r\n\r\n"; - - result += "module TypeScript {\r\n"; - if (!forPrettyPrinter) { - result += " export class SyntaxVisitor implements ISyntaxVisitor {\r\n"; - result += " public defaultVisit(node: ISyntaxNodeOrToken): any {\r\n"; - result += " return null;\r\n"; - result += " }\r\n"; - result += "\r\n"; - result += " public visitToken(token: ISyntaxToken): any {\r\n"; - result += " return this.defaultVisit(token);\r\n"; - result += " }\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - - result += "\r\n public visit" + getNameWithoutSuffix(definition) + "(node: " + definition.name + "): any {\r\n"; - result += " return this.defaultVisit(node);\r\n"; - result += " }\r\n"; - } - - result += " }"; - } - - result += "\r\n}"; - - return result; -} - -function generateFactory(): string { - var result = "///\r\n"; - - result += "\r\nmodule TypeScript.Syntax {\r\n"; - result += " export interface IFactory {\r\n"; - - var i: number; - var j: number; - var definition: ITypeDefinition; - var child: IMemberDefinition; - - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; - result += " " + camelCase(getNameWithoutSuffix(definition)) + "("; - - for (j = 0; j < definition.children.length; j++) { - if (j > 0) { - result += ", "; - } - - child = definition.children[j]; - result += child.name + ": " + getType(child); - } - - result += "): " + definition.name + ";\r\n"; - } - - result += " }\r\n\r\n"; - - // TODO: stop exporting these once compiler bugs are fixed. - result += " export class NormalModeFactory implements IFactory {\r\n"; - - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; - result += " " + camelCase(getNameWithoutSuffix(definition)) + "("; - - for (j = 0; j < definition.children.length; j++) { - if (j > 0) { - result += ", "; - } - - child = definition.children[j]; - result += getSafeName(child) + ": " + getType(child); - } - - result += "): " + definition.name + " {\r\n"; - result += " return new " + definition.name + "("; - - for (j = 0; j < definition.children.length; j++) { - child = definition.children[j]; - result += getSafeName(child); - result += ", "; - } - - result += "/*data:*/ 0);\r\n"; - result += " }\r\n" - } - - result += " }\r\n\r\n"; - - // TODO: stop exporting these once compiler bugs are fixed. - result += " export class StrictModeFactory implements IFactory {\r\n"; - - for (i = 0; i < definitions.length; i++) { - definition = definitions[i]; - result += " " + camelCase(getNameWithoutSuffix(definition)) + "("; - - for (j = 0; j < definition.children.length; j++) { - if (j > 0) { - result += ", "; - } - - child = definition.children[j]; - result += getSafeName(child) + ": " + getType(child); - } - - result += "): " + definition.name + " {\r\n"; - result += " return new " + definition.name + "("; - - for (j = 0; j < definition.children.length; j++) { - child = definition.children[j]; - result += getSafeName(child); - result += ", "; - } - - result += "/*data:*/ SyntaxConstants.NodeParsedInStrictModeMask);\r\n"; - - result += " }\r\n" - } - - result += " }\r\n\r\n"; - - result += " export var normalModeFactory: IFactory = new NormalModeFactory();\r\n"; - result += " export var strictModeFactory: IFactory = new StrictModeFactory();\r\n"; - result += "}"; - - return result; -} - -function generateServicesUtilities(): string { - var result = ""; // "/// \r\n\r\n"; - - result += generateIsTypeScriptSpecific(); - - return result; -} - -function generateIsTypeScriptSpecific(): string { - var result = ""; - - result += "module TypeScript {\r\n"; - - result += " function isSeparatedListTypeScriptSpecific(list: ISyntaxNodeOrToken[]): boolean {\r\n" - result += " for (var i = 0, n = childCount(list); i < n; i++) {\r\n"; - result += " if (isTypeScriptSpecific(childAt(list, i))) {\r\n"; - result += " return true;\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; - result += " return false;\r\n"; - result += " }\r\n\r\n"; - - result += " function isListTypeScriptSpecific(list: ISyntaxNodeOrToken[]): boolean {\r\n" - result += " for (var i = 0, n = list.length; i < n; i++) {\r\n"; - result += " if (isTypeScriptSpecific(list[i])) {\r\n"; - result += " return true;\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; - result += " return false;\r\n"; - result += " }\r\n\r\n"; - - result += " export function isTypeScriptSpecific(element: ISyntaxElement): boolean {\r\n" - result += " if (element === null) { return false; }\r\n"; - result += " if (isToken(element)) { return false; }\r\n"; - result += " if (isList(element)) { return isListTypeScriptSpecific(element); }\r\n"; - result += " if (isSeparatedList(element)) { return isSeparatedListTypeScriptSpecific(element); }\r\n\r\n"; - result += " switch (element.kind()) {\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - if (!definition.isTypeScriptSpecific) { - continue; - } - - if (definition.syntaxKinds) { - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":\r\n"; - } - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ":\r\n"; - } - } - - result += " return true;\r\n"; - - var triviallyFalseDefinitions = definitions.filter(d => d.children.filter(c => c.type !== "SyntaxKind" && !c.isToken).length === 0); - for (var i = 0; i < triviallyFalseDefinitions.length; i++) { - var definition = triviallyFalseDefinitions[i]; - if (definition.isTypeScriptSpecific) { - continue; - } - - if (definition.syntaxKinds) { - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":\r\n"; - } - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ":\r\n"; - } - } - - result += " return false;\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - if (definition.isTypeScriptSpecific) { - continue; - } - - if (definition.children.filter(c => c.type !== "SyntaxKind" && !c.isToken).length === 0) { - continue; - } - - if (definition.syntaxKinds) { - result += " "; - for (var j = 0; j < definition.syntaxKinds.length; j++) { - result += " case SyntaxKind." + definition.syntaxKinds[j] + ":"; - } - } - else { - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ":"; - } - result += "\r\n"; - result += " return is" + getNameWithoutSuffix(definition) + "TypeScriptSpecific(<" + definition.name + ">element);\r\n"; - } - - result += " }\r\n"; - result += " }\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - if (definition.isTypeScriptSpecific) { - continue; - } - - var importantChildren = definition.children.filter(d => d.type !== "SyntaxKind" && !d.isToken); - if (importantChildren.length > 0) { - result += generateIsTypeScriptSpecificMethod(definition); - } - } - - result += "}"; - - return result; -} - -function generateIsTypeScriptSpecificMethod(definition: ITypeDefinition): string { - var result = "\r\n function is" + getNameWithoutSuffix(definition) + "TypeScriptSpecific(node: " + definition.name + "): boolean {\r\n"; - - result += " return "; - - var addedCheck = false; - for (var i = 0; i < definition.children.length; i++) { - var child = definition.children[i]; - - if (child.type === "SyntaxKind") { - continue; - } - - if (child.isToken) { - continue; - } - - if (addedCheck) { - result += " ||\r\n "; - } - - addedCheck = true; - - if (child.isTypeScriptSpecific) { - if (child.isList) { - result += getPropertyAccess(child, "node") + ".length > 0"; - } - else if (child.isSeparatedList) { - result += getPropertyAccess(child, "node") + ".childCount() > 0"; - } - else { - result += getPropertyAccess(child, "node") + " !== null"; - } - } - else { - result += "isTypeScriptSpecific(" + getPropertyAccess(child, "node") + ")"; - } - } - - if (!addedCheck) { - result += "false"; - } - - result += ";\r\n"; - result += " }\r\n"; - - return result; -} - -var syntaxNodesConcrete = generateNodes(/*abstract:*/ false); -var syntaxNodesAbstract = generateNodes(/*abstract:*/ true); +var syntaxNodesConcrete = generateNodes(); var syntaxInterfaces = generateSyntaxInterfaces(); -var rewriter = generateRewriter(); var walker = generateWalker(); var scannerUtilities = generateScannerUtilities(); var visitor = generateVisitor(); -var defaultVisitor = generateDefaultVisitor(); -var servicesUtilities = generateServicesUtilities(); +var utilities = generateUtilities(); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxNodes.abstract.generated.ts", syntaxNodesAbstract, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxNodes.interfaces.generated.ts", syntaxInterfaces, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\services\\syntaxRewriter.generated.ts", rewriter, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxWalker.generated.ts", walker, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\syntaxVisitor.generated.ts", visitor, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\compiler\\syntax\\defaultSyntaxVisitor.generated.ts", defaultVisitor, false); -TypeScript.Environment.writeFile(TypeScript.Environment.currentDirectory() + "\\src\\services\\syntaxUtilities.generated.ts", servicesUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxInterfaces.generated.ts", syntaxInterfaces, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxWalker.generated.ts", walker, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxVisitor.generated.ts", visitor, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\utilities.generated.ts", utilities, false); diff --git a/src/services/syntax/syntaxInterfaces.generated.ts b/src/services/syntax/syntaxInterfaces.generated.ts index b7f99f68b28..acb2f283902 100644 --- a/src/services/syntax/syntaxInterfaces.generated.ts +++ b/src/services/syntax/syntaxInterfaces.generated.ts @@ -1,499 +1,698 @@ /// module TypeScript { - export enum NodeFlags { - Export = 0x00000001, // Declarations - Ambient = 0x00000002, // Declarations - Optional = 0x00000004, // Parameter/Property/Method - Rest = 0x00000008, // Parameter - Public = 0x00000010, // Property/Method - Private = 0x00000020, // Property/Method - Static = 0x00000040, // Property/Method + export interface SourceUnitSyntax extends ISyntaxNode { + syntaxTree: SyntaxTree; + moduleElements: IModuleElementSyntax[]; + endOfFileToken: ISyntaxToken; } + export interface SourceUnitConstructor { new (data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken): SourceUnitSyntax } - interface SyntaxElement { - kind: SyntaxKind; + export interface QualifiedNameSyntax extends ISyntaxNode, INameSyntax { + left: INameSyntax; + dotToken: ISyntaxToken; + right: ISyntaxToken; } + export interface QualifiedNameConstructor { new (data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax } - interface SyntaxNode extends SyntaxElement { - flags: NodeFlags; + export interface ObjectTypeSyntax extends ISyntaxNode, ITypeSyntax { + openBraceToken: ISyntaxToken; + typeMembers: ISeparatedSyntaxList; + closeBraceToken: ISyntaxToken; } + export interface ObjectTypeConstructor { new (data: number, openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectTypeSyntax } - function nodeStart(node: Node): number { + export interface FunctionTypeSyntax extends ISyntaxNode, ITypeSyntax { + typeParameterList: TypeParameterListSyntax; + parameterList: ParameterListSyntax; + equalsGreaterThanToken: ISyntaxToken; + type: ITypeSyntax; + } + export interface FunctionTypeConstructor { new (data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax } + + export interface ArrayTypeSyntax extends ISyntaxNode, ITypeSyntax { + type: ITypeSyntax; + openBracketToken: ISyntaxToken; + closeBracketToken: ISyntaxToken; + } + export interface ArrayTypeConstructor { new (data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax } + + export interface ConstructorTypeSyntax extends ISyntaxNode, ITypeSyntax { + newKeyword: ISyntaxToken; + typeParameterList: TypeParameterListSyntax; + parameterList: ParameterListSyntax; + equalsGreaterThanToken: ISyntaxToken; + type: ITypeSyntax; + } + export interface ConstructorTypeConstructor { new (data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax } + + export interface GenericTypeSyntax extends ISyntaxNode, ITypeSyntax { + name: INameSyntax; + typeArgumentList: TypeArgumentListSyntax; + } + export interface GenericTypeConstructor { new (data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax } + + export interface TypeQuerySyntax extends ISyntaxNode, ITypeSyntax { + typeOfKeyword: ISyntaxToken; + name: INameSyntax; + } + export interface TypeQueryConstructor { new (data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax } + + export interface TupleTypeSyntax extends ISyntaxNode, ITypeSyntax { + openBracketToken: ISyntaxToken; + types: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; + } + export interface TupleTypeConstructor { new (data: number, openBracketToken: ISyntaxToken, types: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): TupleTypeSyntax } + + export interface UnionTypeSyntax extends ISyntaxNode, ITypeSyntax { + left: ITypeSyntax; + barToken: ISyntaxToken; + right: ITypeSyntax; + } + export interface UnionTypeConstructor { new (data: number, left: ITypeSyntax, barToken: ISyntaxToken, right: ITypeSyntax): UnionTypeSyntax } + + export interface ParenthesizedTypeSyntax extends ISyntaxNode, ITypeSyntax { + openParenToken: ISyntaxToken; + type: ITypeSyntax; + closeParenToken: ISyntaxToken; + } + export interface ParenthesizedTypeConstructor { new (data: number, openParenToken: ISyntaxToken, type: ITypeSyntax, closeParenToken: ISyntaxToken): ParenthesizedTypeSyntax } + + export interface InterfaceDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + interfaceKeyword: ISyntaxToken; + identifier: ISyntaxToken; + typeParameterList: TypeParameterListSyntax; + heritageClauses: HeritageClauseSyntax[]; + body: ObjectTypeSyntax; + } + export interface InterfaceDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax): InterfaceDeclarationSyntax } + + export interface FunctionDeclarationSyntax extends ISyntaxNode, IStatementSyntax { + modifiers: ISyntaxToken[]; + functionKeyword: ISyntaxToken; + asterixToken: ISyntaxToken; + identifier: ISyntaxToken; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ISyntaxToken; + } + export interface FunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken): FunctionDeclarationSyntax } + + export interface ModuleDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + moduleKeyword: ISyntaxToken; + name: INameSyntax; + openBraceToken: ISyntaxToken; + moduleElements: IModuleElementSyntax[]; + closeBraceToken: ISyntaxToken; + } + export interface ModuleDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax } + + export interface ClassDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + classKeyword: ISyntaxToken; + identifier: ISyntaxToken; + typeParameterList: TypeParameterListSyntax; + heritageClauses: HeritageClauseSyntax[]; + openBraceToken: ISyntaxToken; + classElements: IClassElementSyntax[]; + closeBraceToken: ISyntaxToken; } + export interface ClassDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken): ClassDeclarationSyntax } + + export interface EnumDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + enumKeyword: ISyntaxToken; + identifier: ISyntaxToken; + openBraceToken: ISyntaxToken; + enumElements: ISeparatedSyntaxList; + closeBraceToken: ISyntaxToken; + } + export interface EnumDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): EnumDeclarationSyntax } + + export interface ImportDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { + modifiers: ISyntaxToken[]; + importKeyword: ISyntaxToken; + identifier: ISyntaxToken; + equalsToken: ISyntaxToken; + moduleReference: IModuleReferenceSyntax; + semicolonToken: ISyntaxToken; + } + export interface ImportDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax } - function nodeWidth(node: Node): number { + export interface ExportAssignmentSyntax extends ISyntaxNode, IModuleElementSyntax { + exportKeyword: ISyntaxToken; + equalsToken: ISyntaxToken; + identifier: ISyntaxToken; + semicolonToken: ISyntaxToken; + } + export interface ExportAssignmentConstructor { new (data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax } + + export interface MemberFunctionDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { + modifiers: ISyntaxToken[]; + asterixToken: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ISyntaxToken; + } + export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken): MemberFunctionDeclarationSyntax } + + export interface MemberVariableDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { + modifiers: ISyntaxToken[]; + variableDeclarator: VariableDeclaratorSyntax; + semicolonToken: ISyntaxToken; } - - interface SyntaxToken extends Name, PrimaryExpression { - } - - // The raw text of the token, as written in the original source. - function tokenText(token: SyntaxToken): string { - } - - // The token's javascript value. i.e. 0.0 in the text would have the javascript number value: 0. - function tokenValue(token: SyntaxToken): any { - } - - // The token's value in string form. i.e. \u0041 in the source text would result in a string with the text: A. - function tokenValueText(token: SyntaxToken): string { - } - - interface SyntaxList extends SyntaxElement { - length: number; - item(index: number): T; - } - - interface SourceUnit extends Node { - moduleElements: SyntaxList; - } - - interface QualifiedName extends Name { - left: Name; - right: SyntaxToken; - } - - interface ObjectType extends Type { - typeMembers: SyntaxList; - } - - interface FunctionType extends Type { - typeParameterList?: TypeParameterList; - parameterList: ParameterList; - type: Type; - } - - interface ArrayType extends Type { - type: Type; - } - - interface ConstructorType extends Type { - typeParameterList?: TypeParameterList; - parameterList: ParameterList; - type: Type; - } - - interface GenericType extends Type { - name: Name; - typeArgumentList: TypeArgumentList; - } - - interface TypeQuery extends Type { - name: Name; - } - - interface InterfaceDeclaration extends ModuleElement { - identifier: SyntaxToken; - typeParameterList?: TypeParameterList; - heritageClauses: SyntaxList; - body: ObjectType; - } - - interface FunctionDeclaration extends Statement { - identifier: SyntaxToken; - callSignature: CallSignature; - block?: Block; - } - - interface ModuleDeclaration extends ModuleElement { - name?: Name; - stringLiteral?: SyntaxToken; - moduleElements: SyntaxList; - } - - interface ClassDeclaration extends ModuleElement { - identifier: SyntaxToken; - typeParameterList?: TypeParameterList; - heritageClauses: SyntaxList; - classElements: SyntaxList; - } - - interface EnumDeclaration extends ModuleElement { - identifier: SyntaxToken; - enumElements: SyntaxList; - } - - interface ImportDeclaration extends ModuleElement { - identifier: SyntaxToken; - moduleReference: ModuleReference; - } - - interface ExportAssignment extends ModuleElement { - identifier: SyntaxToken; - } - - interface MemberFunctionDeclaration extends MemberDeclaration { - propertyName: SyntaxToken; - callSignature: CallSignature; - block?: Block; - } - - interface MemberVariableDeclaration extends MemberDeclaration { - variableDeclarator: VariableDeclarator; - } - - interface ConstructorDeclaration extends ClassElement { - callSignature: CallSignature; - block?: Block; - } - - interface IndexMemberDeclaration extends ClassElement { - indexSignature: IndexSignature; - } - - interface GetAccessor extends MemberDeclaration, PropertyAssignment { - propertyName: SyntaxToken; - callSignature: CallSignature; - block: Block; - } - - interface SetAccessor extends MemberDeclaration, PropertyAssignment { - propertyName: SyntaxToken; - callSignature: CallSignature; - block: Block; - } - - interface PropertySignature extends TypeMember { - propertyName: SyntaxToken; - typeAnnotation?: TypeAnnotation; - } - - interface CallSignature extends TypeMember { - typeParameterList?: TypeParameterList; - parameterList: ParameterList; - typeAnnotation?: TypeAnnotation; - } - - interface ConstructSignature extends TypeMember { - callSignature: CallSignature; + export interface MemberVariableDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax } + + export interface ConstructorDeclarationSyntax extends ISyntaxNode, IClassElementSyntax { + modifiers: ISyntaxToken[]; + constructorKeyword: ISyntaxToken; + callSignature: CallSignatureSyntax; + body: BlockSyntax | ISyntaxToken; + } + export interface ConstructorDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken): ConstructorDeclarationSyntax } + + export interface IndexMemberDeclarationSyntax extends ISyntaxNode, IClassElementSyntax { + modifiers: ISyntaxToken[]; + indexSignature: IndexSignatureSyntax; + semicolonToken: ISyntaxToken; + } + export interface IndexMemberDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax } + + export interface GetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { + modifiers: ISyntaxToken[]; + getKeyword: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + block: BlockSyntax; + } + export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): GetAccessorSyntax } + + export interface SetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { + modifiers: ISyntaxToken[]; + setKeyword: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + block: BlockSyntax; } - - interface IndexSignature extends TypeMember { - parameters: SyntaxList; - typeAnnotation?: TypeAnnotation; - } - - interface MethodSignature extends TypeMember { - propertyName: SyntaxToken; - callSignature: CallSignature; - } - - interface Block extends Statement { - statements: SyntaxList; - } - - interface IfStatement extends Statement { - condition: Expression; - statement: Statement; - elseClause?: ElseClause; - } - - interface VariableStatement extends Statement { - variableDeclaration: VariableDeclaration; - } - - interface ExpressionStatement extends Statement { - expression: Expression; - } - - interface ReturnStatement extends Statement { - expression?: Expression; - } - - interface SwitchStatement extends Statement { - expression: Expression; - switchClauses: SyntaxList; - } - - interface BreakStatement extends Statement { - identifier?: SyntaxToken; - } - - interface ContinueStatement extends Statement { - identifier?: SyntaxToken; + export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): SetAccessorSyntax } + + export interface PropertySignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + propertyName: IPropertyNameSyntax; + questionToken: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + } + export interface PropertySignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax } + + export interface CallSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + typeParameterList: TypeParameterListSyntax; + parameterList: ParameterListSyntax; + typeAnnotation: TypeAnnotationSyntax; + } + export interface CallSignatureConstructor { new (data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax } + + export interface ConstructSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + newKeyword: ISyntaxToken; + callSignature: CallSignatureSyntax; + } + export interface ConstructSignatureConstructor { new (data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax } + + export interface IndexSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + openBracketToken: ISyntaxToken; + parameters: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; } + export interface IndexSignatureConstructor { new (data: number, openBracketToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax } - interface ForStatement extends Statement { - variableDeclaration?: VariableDeclaration; - initializer?: Expression; - condition?: Expression; - incrementor?: Expression; - statement: Statement; + export interface MethodSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { + propertyName: IPropertyNameSyntax; + questionToken: ISyntaxToken; + callSignature: CallSignatureSyntax; } + export interface MethodSignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax } - interface ForInStatement extends Statement { - variableDeclaration?: VariableDeclaration; - left?: Expression; - expression: Expression; - statement: Statement; + export interface BlockSyntax extends ISyntaxNode, IStatementSyntax { + openBraceToken: ISyntaxToken; + statements: IStatementSyntax[]; + closeBraceToken: ISyntaxToken; } + export interface BlockConstructor { new (data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken): BlockSyntax } - interface ThrowStatement extends Statement { - expression: Expression; + export interface IfStatementSyntax extends ISyntaxNode, IStatementSyntax { + ifKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; + elseClause: ElseClauseSyntax; } + export interface IfStatementConstructor { new (data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax } - interface WhileStatement extends Statement { - condition: Expression; - statement: Statement; + export interface VariableStatementSyntax extends ISyntaxNode, IStatementSyntax { + modifiers: ISyntaxToken[]; + variableDeclaration: VariableDeclarationSyntax; + semicolonToken: ISyntaxToken; } + export interface VariableStatementConstructor { new (data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax } - interface TryStatement extends Statement { - block: Block; - catchClause?: CatchClause; - finallyClause?: FinallyClause; + export interface ExpressionStatementSyntax extends ISyntaxNode, IStatementSyntax { + expression: IExpressionSyntax; + semicolonToken: ISyntaxToken; } + export interface ExpressionStatementConstructor { new (data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax } - interface LabeledStatement extends Statement { - identifier: SyntaxToken; - statement: Statement; + export interface ReturnStatementSyntax extends ISyntaxNode, IStatementSyntax { + returnKeyword: ISyntaxToken; + expression: IExpressionSyntax; + semicolonToken: ISyntaxToken; } + export interface ReturnStatementConstructor { new (data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax } - interface DoStatement extends Statement { - statement: Statement; - condition: Expression; + export interface SwitchStatementSyntax extends ISyntaxNode, IStatementSyntax { + switchKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + expression: IExpressionSyntax; + closeParenToken: ISyntaxToken; + openBraceToken: ISyntaxToken; + switchClauses: ISwitchClauseSyntax[]; + closeBraceToken: ISyntaxToken; } + export interface SwitchStatementConstructor { new (data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken): SwitchStatementSyntax } - interface WithStatement extends Statement { - condition: Expression; - statement: Statement; + export interface BreakStatementSyntax extends ISyntaxNode, IStatementSyntax { + breakKeyword: ISyntaxToken; + identifier: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface BreakStatementConstructor { new (data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax } - interface PrefixUnaryExpression extends UnaryExpression { - operand: UnaryExpression; + export interface ContinueStatementSyntax extends ISyntaxNode, IStatementSyntax { + continueKeyword: ISyntaxToken; + identifier: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface ContinueStatementConstructor { new (data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; + export interface ForStatementSyntax extends ISyntaxNode, IStatementSyntax { + forKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + initializer: VariableDeclarationSyntax | IExpressionSyntax; + firstSemicolonToken: ISyntaxToken; + condition: IExpressionSyntax; + secondSemicolonToken: ISyntaxToken; + incrementor: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface ForStatementConstructor { new (data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, initializer: VariableDeclarationSyntax | IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; + export interface ForInStatementSyntax extends ISyntaxNode, IStatementSyntax { + forKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + left: VariableDeclarationSyntax | IExpressionSyntax; + inKeyword: ISyntaxToken; + right: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface ForInStatementConstructor { new (data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, left: VariableDeclarationSyntax | IExpressionSyntax, inKeyword: ISyntaxToken, right: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; + export interface EmptyStatementSyntax extends ISyntaxNode, IStatementSyntax { + semicolonToken: ISyntaxToken; } + export interface EmptyStatementConstructor { new (data: number, semicolonToken: ISyntaxToken): EmptyStatementSyntax } - interface ConditionalExpression extends Expression { - condition: Expression; - whenTrue: Expression; - whenFalse: Expression; + export interface ThrowStatementSyntax extends ISyntaxNode, IStatementSyntax { + throwKeyword: ISyntaxToken; + expression: IExpressionSyntax; + semicolonToken: ISyntaxToken; } + export interface ThrowStatementConstructor { new (data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax } - interface BinaryExpression extends Expression { - left: Expression; - right: Expression; + export interface WhileStatementSyntax extends ISyntaxNode, IStatementSyntax { + whileKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface WhileStatementConstructor { new (data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; + export interface TryStatementSyntax extends ISyntaxNode, IStatementSyntax { + tryKeyword: ISyntaxToken; + block: BlockSyntax; + catchClause: CatchClauseSyntax; + finallyClause: FinallyClauseSyntax; } + export interface TryStatementConstructor { new (data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax } - interface MemberAccessExpression extends MemberExpression, CallExpression { - expression: LeftHandSideExpression; - name: SyntaxToken; + export interface LabeledStatementSyntax extends ISyntaxNode, IStatementSyntax { + identifier: ISyntaxToken; + colonToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface LabeledStatementConstructor { new (data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax } - interface InvocationExpression extends CallExpression { - expression: LeftHandSideExpression; - argumentList: ArgumentList; + export interface DoStatementSyntax extends ISyntaxNode, IStatementSyntax { + doKeyword: ISyntaxToken; + statement: IStatementSyntax; + whileKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface DoStatementConstructor { new (data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax } - interface ArrayLiteralExpression extends PrimaryExpression { - expressions: SyntaxList; + export interface DebuggerStatementSyntax extends ISyntaxNode, IStatementSyntax { + debuggerKeyword: ISyntaxToken; + semicolonToken: ISyntaxToken; } + export interface DebuggerStatementConstructor { new (data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax } - interface ObjectLiteralExpression extends PrimaryExpression { - propertyAssignments: SyntaxList; + export interface WithStatementSyntax extends ISyntaxNode, IStatementSyntax { + withKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + condition: IExpressionSyntax; + closeParenToken: ISyntaxToken; + statement: IStatementSyntax; } + export interface WithStatementConstructor { new (data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax } - interface ObjectCreationExpression extends MemberExpression { - expression: MemberExpression; - argumentList?: ArgumentList; + export interface PrefixUnaryExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + operatorToken: ISyntaxToken; + operand: IUnaryExpressionSyntax; } + export interface PrefixUnaryExpressionConstructor { new (data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; + export interface DeleteExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + deleteKeyword: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface DeleteExpressionConstructor { new (data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax } - interface ParenthesizedArrowFunctionExpression extends UnaryExpression { - callSignature: CallSignature; - block?: Block; - expression?: Expression; + export interface TypeOfExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + typeOfKeyword: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface TypeOfExpressionConstructor { new (data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax } - interface SimpleArrowFunctionExpression extends UnaryExpression { - parameter: Parameter; - block?: Block; - expression?: Expression; + export interface VoidExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + voidKeyword: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface VoidExpressionConstructor { new (data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax } - interface CastExpression extends UnaryExpression { - type: Type; - expression: UnaryExpression; + export interface ConditionalExpressionSyntax extends ISyntaxNode, IExpressionSyntax { + condition: IExpressionSyntax; + questionToken: ISyntaxToken; + whenTrue: IExpressionSyntax; + colonToken: ISyntaxToken; + whenFalse: IExpressionSyntax; } + export interface ConditionalExpressionConstructor { new (data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax } - interface ElementAccessExpression extends MemberExpression, CallExpression { - expression: LeftHandSideExpression; - argumentExpression: Expression; + export interface BinaryExpressionSyntax extends ISyntaxNode, IExpressionSyntax { + left: IExpressionSyntax; + operatorToken: ISyntaxToken; + right: IExpressionSyntax; } + export interface BinaryExpressionConstructor { new (data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax } - interface FunctionExpression extends PrimaryExpression { - identifier?: SyntaxToken; - callSignature: CallSignature; - block: Block; + export interface PostfixUnaryExpressionSyntax extends ISyntaxNode, IPostfixExpressionSyntax { + operand: ILeftHandSideExpressionSyntax; + operatorToken: ISyntaxToken; } + export interface PostfixUnaryExpressionConstructor { new (data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax } - interface VariableDeclaration extends Node { - variableDeclarators: SyntaxList; + export interface MemberAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + dotToken: ISyntaxToken; + name: ISyntaxToken; } + export interface MemberAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax } - interface VariableDeclarator extends Node { - propertyName: SyntaxToken; - typeAnnotation?: TypeAnnotation; - equalsValueClause?: EqualsValueClause; + export interface InvocationExpressionSyntax extends ISyntaxNode, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + argumentList: ArgumentListSyntax; } + export interface InvocationExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax } - interface ArgumentList extends Node { - typeArgumentList?: TypeArgumentList; - arguments: SyntaxList; + export interface ArrayLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + openBracketToken: ISyntaxToken; + expressions: ISeparatedSyntaxList; + closeBracketToken: ISyntaxToken; } + export interface ArrayLiteralExpressionConstructor { new (data: number, openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax } - interface ParameterList extends Node { - parameters: SyntaxList; + export interface ObjectLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + openBraceToken: ISyntaxToken; + propertyAssignments: ISeparatedSyntaxList; + closeBraceToken: ISyntaxToken; } + export interface ObjectLiteralExpressionConstructor { new (data: number, openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax } - interface TypeArgumentList extends Node { - typeArguments: SyntaxList; + export interface ObjectCreationExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + newKeyword: ISyntaxToken; + expression: IMemberExpressionSyntax; + argumentList: ArgumentListSyntax; } + export interface ObjectCreationExpressionConstructor { new (data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax } - interface TypeParameterList extends Node { - typeParameters: SyntaxList; + export interface ParenthesizedExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + openParenToken: ISyntaxToken; + expression: IExpressionSyntax; + closeParenToken: ISyntaxToken; } + export interface ParenthesizedExpressionConstructor { new (data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax } - interface HeritageClause extends Node { - typeNames: SyntaxList; + export interface ParenthesizedArrowFunctionExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + callSignature: CallSignatureSyntax; + equalsGreaterThanToken: ISyntaxToken; + body: BlockSyntax | IExpressionSyntax; } + export interface ParenthesizedArrowFunctionExpressionConstructor { new (data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax } - interface EqualsValueClause extends Node { - value: Expression; + export interface SimpleArrowFunctionExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + parameter: ParameterSyntax; + equalsGreaterThanToken: ISyntaxToken; + body: BlockSyntax | IExpressionSyntax; } + export interface SimpleArrowFunctionExpressionConstructor { new (data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax): SimpleArrowFunctionExpressionSyntax } - interface CaseSwitchClause extends SwitchClause { - expression: Expression; - statements: SyntaxList; + export interface CastExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax { + lessThanToken: ISyntaxToken; + type: ITypeSyntax; + greaterThanToken: ISyntaxToken; + expression: IUnaryExpressionSyntax; } + export interface CastExpressionConstructor { new (data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax } - interface DefaultSwitchClause extends SwitchClause { - statements: SyntaxList; + export interface ElementAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + openBracketToken: ISyntaxToken; + argumentExpression: IExpressionSyntax; + closeBracketToken: ISyntaxToken; } + export interface ElementAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax } - interface ElseClause extends Node { - statement: Statement; + export interface FunctionExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + functionKeyword: ISyntaxToken; + asterixToken: ISyntaxToken; + identifier: ISyntaxToken; + callSignature: CallSignatureSyntax; + block: BlockSyntax; } + export interface FunctionExpressionConstructor { new (data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax } - interface CatchClause extends Node { - identifier: SyntaxToken; - typeAnnotation?: TypeAnnotation; - block: Block; + export interface OmittedExpressionSyntax extends ISyntaxNode, IExpressionSyntax { } + export interface OmittedExpressionConstructor { new (data: number): OmittedExpressionSyntax } - interface FinallyClause extends Node { - block: Block; + export interface TemplateExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { + templateStartToken: ISyntaxToken; + templateClauses: TemplateClauseSyntax[]; } + export interface TemplateExpressionConstructor { new (data: number, templateStartToken: ISyntaxToken, templateClauses: TemplateClauseSyntax[]): TemplateExpressionSyntax } - interface TypeParameter extends Node { - identifier: SyntaxToken; - constraint?: Constraint; + export interface TemplateAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax { + expression: ILeftHandSideExpressionSyntax; + templateExpression: IPrimaryExpressionSyntax; } + export interface TemplateAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, templateExpression: IPrimaryExpressionSyntax): TemplateAccessExpressionSyntax } - interface Constraint extends Node { - type: Type; + export interface YieldExpressionSyntax extends ISyntaxNode, IExpressionSyntax { + yieldKeyword: ISyntaxToken; + asterixToken: ISyntaxToken; + expression: IExpressionSyntax; } + export interface YieldExpressionConstructor { new (data: number, yieldKeyword: ISyntaxToken, asterixToken: ISyntaxToken, expression: IExpressionSyntax): YieldExpressionSyntax } - interface SimplePropertyAssignment extends PropertyAssignment { - propertyName: SyntaxToken; - expression: Expression; + export interface VariableDeclarationSyntax extends ISyntaxNode { + varKeyword: ISyntaxToken; + variableDeclarators: ISeparatedSyntaxList; } + export interface VariableDeclarationConstructor { new (data: number, varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax } - interface FunctionPropertyAssignment extends PropertyAssignment { - propertyName: SyntaxToken; - callSignature: CallSignature; - block: Block; + export interface VariableDeclaratorSyntax extends ISyntaxNode { + propertyName: IPropertyNameSyntax; + typeAnnotation: TypeAnnotationSyntax; + equalsValueClause: EqualsValueClauseSyntax; } + export interface VariableDeclaratorConstructor { new (data: number, propertyName: IPropertyNameSyntax, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax } - interface Parameter extends Node { - identifier: SyntaxToken; - typeAnnotation?: TypeAnnotation; - equalsValueClause?: EqualsValueClause; + export interface ArgumentListSyntax extends ISyntaxNode { + typeArgumentList: TypeArgumentListSyntax; + openParenToken: ISyntaxToken; + arguments: ISeparatedSyntaxList; + closeParenToken: ISyntaxToken; } + export interface ArgumentListConstructor { new (data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ArgumentListSyntax } - interface EnumElement extends Node { - propertyName: SyntaxToken; - equalsValueClause?: EqualsValueClause; + export interface ParameterListSyntax extends ISyntaxNode { + openParenToken: ISyntaxToken; + parameters: ISeparatedSyntaxList; + closeParenToken: ISyntaxToken; } + export interface ParameterListConstructor { new (data: number, openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken): ParameterListSyntax } - interface TypeAnnotation extends Node { - type: Type; + export interface TypeArgumentListSyntax extends ISyntaxNode { + lessThanToken: ISyntaxToken; + typeArguments: ISeparatedSyntaxList; + greaterThanToken: ISyntaxToken; } + export interface TypeArgumentListConstructor { new (data: number, lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeArgumentListSyntax } - interface ExternalModuleReference extends ModuleReference { - stringLiteral: SyntaxToken; + export interface TypeParameterListSyntax extends ISyntaxNode { + lessThanToken: ISyntaxToken; + typeParameters: ISeparatedSyntaxList; + greaterThanToken: ISyntaxToken; } + export interface TypeParameterListConstructor { new (data: number, lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken): TypeParameterListSyntax } - interface ModuleNameModuleReference extends ModuleReference { - moduleName: Name; + export interface HeritageClauseSyntax extends ISyntaxNode { + extendsOrImplementsKeyword: ISyntaxToken; + typeNames: ISeparatedSyntaxList; } + export interface HeritageClauseConstructor { new (data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList): HeritageClauseSyntax } - interface MemberDeclaration extends ClassElement { + export interface EqualsValueClauseSyntax extends ISyntaxNode { + equalsToken: ISyntaxToken; + value: IExpressionSyntax; } + export interface EqualsValueClauseConstructor { new (data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax } - interface Statement extends ModuleElement { + export interface CaseSwitchClauseSyntax extends ISyntaxNode, ISwitchClauseSyntax { + caseKeyword: ISyntaxToken; + expression: IExpressionSyntax; + colonToken: ISyntaxToken; + statements: IStatementSyntax[]; } + export interface CaseSwitchClauseConstructor { new (data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]): CaseSwitchClauseSyntax } - interface Name extends Type { + export interface DefaultSwitchClauseSyntax extends ISyntaxNode, ISwitchClauseSyntax { + defaultKeyword: ISyntaxToken; + colonToken: ISyntaxToken; + statements: IStatementSyntax[]; } + export interface DefaultSwitchClauseConstructor { new (data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]): DefaultSwitchClauseSyntax } - interface UnaryExpression extends Expression { + export interface ElseClauseSyntax extends ISyntaxNode { + elseKeyword: ISyntaxToken; + statement: IStatementSyntax; } + export interface ElseClauseConstructor { new (data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax } - interface PostfixExpression extends UnaryExpression { + export interface CatchClauseSyntax extends ISyntaxNode { + catchKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + identifier: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + closeParenToken: ISyntaxToken; + block: BlockSyntax; } + export interface CatchClauseConstructor { new (data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax } - interface LeftHandSideExpression extends PostfixExpression { + export interface FinallyClauseSyntax extends ISyntaxNode { + finallyKeyword: ISyntaxToken; + block: BlockSyntax; } + export interface FinallyClauseConstructor { new (data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax } - interface MemberExpression extends LeftHandSideExpression { + export interface TemplateClauseSyntax extends ISyntaxNode { + expression: IExpressionSyntax; + templateMiddleOrEndToken: ISyntaxToken; } + export interface TemplateClauseConstructor { new (data: number, expression: IExpressionSyntax, templateMiddleOrEndToken: ISyntaxToken): TemplateClauseSyntax } - interface CallExpression extends LeftHandSideExpression { + export interface TypeParameterSyntax extends ISyntaxNode { + identifier: ISyntaxToken; + constraint: ConstraintSyntax; } + export interface TypeParameterConstructor { new (data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax } - interface PrimaryExpression extends MemberExpression { + export interface ConstraintSyntax extends ISyntaxNode { + extendsKeyword: ISyntaxToken; + typeOrExpression: ISyntaxNodeOrToken; } + export interface ConstraintConstructor { new (data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken): ConstraintSyntax } - interface ModuleElement extends SyntaxElement { + export interface SimplePropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax { + propertyName: IPropertyNameSyntax; + colonToken: ISyntaxToken; + expression: IExpressionSyntax; } + export interface SimplePropertyAssignmentConstructor { new (data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax } - interface ModuleReference extends Node { + export interface FunctionPropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax { + asterixToken: ISyntaxToken; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + block: BlockSyntax; } + export interface FunctionPropertyAssignmentConstructor { new (data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax } - interface ClassElement extends Node { + export interface ParameterSyntax extends ISyntaxNode { + dotDotDotToken: ISyntaxToken; + modifiers: ISyntaxToken[]; + identifier: ISyntaxToken; + questionToken: ISyntaxToken; + typeAnnotation: TypeAnnotationSyntax; + equalsValueClause: EqualsValueClauseSyntax; } + export interface ParameterConstructor { new (data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax } - interface TypeMember extends Node { + export interface EnumElementSyntax extends ISyntaxNode { + propertyName: IPropertyNameSyntax; + equalsValueClause: EqualsValueClauseSyntax; } + export interface EnumElementConstructor { new (data: number, propertyName: IPropertyNameSyntax, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax } - interface PropertyAssignment extends Node { + export interface TypeAnnotationSyntax extends ISyntaxNode { + colonToken: ISyntaxToken; + type: ITypeSyntax; } + export interface TypeAnnotationConstructor { new (data: number, colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax } - interface SwitchClause extends Node { + export interface ComputedPropertyNameSyntax extends ISyntaxNode, IPropertyNameSyntax { + openBracketToken: ISyntaxToken; + expression: IExpressionSyntax; + closeBracketToken: ISyntaxToken; } + export interface ComputedPropertyNameConstructor { new (data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ComputedPropertyNameSyntax } - interface Expression extends SyntaxElement { + export interface ExternalModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { + requireKeyword: ISyntaxToken; + openParenToken: ISyntaxToken; + stringLiteral: ISyntaxToken; + closeParenToken: ISyntaxToken; } + export interface ExternalModuleReferenceConstructor { new (data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax } - interface Type extends SyntaxElement { + export interface ModuleNameModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { + moduleName: INameSyntax; } + export interface ModuleNameModuleReferenceConstructor { new (data: number, moduleName: INameSyntax): ModuleNameModuleReferenceSyntax } } \ No newline at end of file diff --git a/src/services/syntax/syntaxKind.ts b/src/services/syntax/syntaxKind.ts index 1021c2fcfd7..947f23b137f 100644 --- a/src/services/syntax/syntaxKind.ts +++ b/src/services/syntax/syntaxKind.ts @@ -5,8 +5,6 @@ module TypeScript { // Variable width tokens, trivia and lists. None, List, - SeparatedList, - TriviaList, // Trivia WhitespaceTrivia, @@ -28,6 +26,12 @@ module TypeScript { NumericLiteral, StringLiteral, + // Template tokens + NoSubstitutionTemplateToken, + TemplateStartToken, + TemplateMiddleToken, + TemplateEndToken, + // All fixed width tokens follow. // Keywords @@ -159,6 +163,8 @@ module TypeScript { GenericType, TypeQuery, TupleType, + UnionType, + ParenthesizedType, // Module elements. InterfaceDeclaration, @@ -207,54 +213,13 @@ module TypeScript { WithStatement, // Expressions - PlusExpression, - NegateExpression, - BitwiseNotExpression, - LogicalNotExpression, - PreIncrementExpression, - PreDecrementExpression, + PrefixUnaryExpression, DeleteExpression, TypeOfExpression, VoidExpression, - CommaExpression, - AssignmentExpression, - AddAssignmentExpression, - SubtractAssignmentExpression, - MultiplyAssignmentExpression, - DivideAssignmentExpression, - ModuloAssignmentExpression, - AndAssignmentExpression, - ExclusiveOrAssignmentExpression, - OrAssignmentExpression, - LeftShiftAssignmentExpression, - SignedRightShiftAssignmentExpression, - UnsignedRightShiftAssignmentExpression, ConditionalExpression, - LogicalOrExpression, - LogicalAndExpression, - BitwiseOrExpression, - BitwiseExclusiveOrExpression, - BitwiseAndExpression, - EqualsWithTypeConversionExpression, - NotEqualsWithTypeConversionExpression, - EqualsExpression, - NotEqualsExpression, - LessThanExpression, - GreaterThanExpression, - LessThanOrEqualExpression, - GreaterThanOrEqualExpression, - InstanceOfExpression, - InExpression, - LeftShiftExpression, - SignedRightShiftExpression, - UnsignedRightShiftExpression, - MultiplyExpression, - DivideExpression, - ModuloExpression, - AddExpression, - SubtractExpression, - PostIncrementExpression, - PostDecrementExpression, + BinaryExpression, + PostfixUnaryExpression, MemberAccessExpression, InvocationExpression, ArrayLiteralExpression, @@ -267,6 +232,9 @@ module TypeScript { ElementAccessExpression, FunctionExpression, OmittedExpression, + TemplateExpression, + TemplateAccessExpression, + YieldExpression, // Variable declarations VariableDeclaration, @@ -279,14 +247,14 @@ module TypeScript { TypeParameterList, // Clauses - ExtendsHeritageClause, - ImplementsHeritageClause, + HeritageClause, EqualsValueClause, CaseSwitchClause, DefaultSwitchClause, ElseClause, CatchClause, FinallyClause, + TemplateClause, // Generics TypeParameter, @@ -294,14 +262,13 @@ module TypeScript { // Property Assignment SimplePropertyAssignment, - // GetAccessorPropertyAssignment, - // SetAccessorPropertyAssignment, FunctionPropertyAssignment, // Misc. Parameter, EnumElement, TypeAnnotation, + ComputedPropertyName, ExternalModuleReference, ModuleNameModuleReference, diff --git a/src/services/syntax/syntaxList.ts b/src/services/syntax/syntaxList.ts index 52bc02ecdca..4b11518c239 100644 --- a/src/services/syntax/syntaxList.ts +++ b/src/services/syntax/syntaxList.ts @@ -1,95 +1,69 @@ /// interface Array { - data: number; - separators?: TypeScript.ISyntaxToken[]; + __data: number; - kind(): TypeScript.SyntaxKind; + kind: TypeScript.SyntaxKind; parent: TypeScript.ISyntaxElement; +} - separatorCount(): number; - separatorAt(index: number): TypeScript.ISyntaxToken; +module TypeScript { + export interface ISeparatedSyntaxList extends Array { + //separatorCount(): number; + //separatorAt(index: number): TypeScript.ISyntaxToken; + + //nonSeparatorCount(): number; + //nonSeparatorAt(index: number): T; + } +} + +module TypeScript { + export function separatorCount(list: ISeparatedSyntaxList) { + return list === undefined ? 0 : list.length >> 1; + } + + export function nonSeparatorCount(list: ISeparatedSyntaxList) { + return list === undefined ? 0 : (list.length + 1) >> 1; + } + + export function separatorAt(list: ISeparatedSyntaxList, index: number): ISyntaxToken { + return list[(index << 1) + 1]; + } + + export function nonSeparatorAt(list: ISeparatedSyntaxList, index: number): T { + return list[index << 1]; + } } module TypeScript.Syntax { - var _emptyList: ISyntaxNodeOrToken[] = []; - - var _emptySeparatedList: ISyntaxNodeOrToken[] = []; - var _emptySeparators: ISyntaxToken[] = []; - - _emptySeparatedList.separators = _emptySeparators; - - function assertEmptyLists() { - // Debug.assert(_emptyList.length === 0); - // var separators = _emptySeparatedList.separators; - // Debug.assert(!separators || separators.length === 0); + function addArrayPrototypeValue(name: string, val: any) { + if (Object.defineProperty && (Array.prototype)[name] === undefined) { + Object.defineProperty(Array.prototype, name, { value: val, writable: false }); + } + else { + (Array.prototype)[name] = val; + } } - Array.prototype.kind = function () { - return this.separators === undefined ? SyntaxKind.List : SyntaxKind.SeparatedList; - } - - Array.prototype.separatorCount = function (): number { - assertEmptyLists(); - // Debug.assert(this.kind === SyntaxKind.SeparatedList); - return this.separators.length; - } - - Array.prototype.separatorAt = function (index: number): ISyntaxToken { - assertEmptyLists(); - // Debug.assert(this.kind === SyntaxKind.SeparatedList); - // Debug.assert(index >= 0 && index < this.separators.length); - return this.separators[index]; - } - - export function emptyList(): T[] { - return _emptyList; - } - - export function emptySeparatedList(): T[] { - return _emptySeparatedList; - } + addArrayPrototypeValue("kind", SyntaxKind.List); export function list(nodes: T[]): T[] { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptyList(); - } - - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - - return nodes; - } - - export function separatedList(nodes: T[], separators: ISyntaxToken[]): T[] { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptySeparatedList(); - } - - // Debug.assert(separators.length === nodes.length || separators.length == (nodes.length - 1)); - - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - - for (var i = 0, n = separators.length; i < n; i++) { - separators[i].parent = nodes; - } - - - nodes.separators = separators.length === 0 ? _emptySeparators : separators; - - return nodes; - } - - export function nonSeparatorIndexOf(list: T[], ast: ISyntaxNodeOrToken): number { - for (var i = 0, n = list.length; i < n; i++) { - if (list[i] === ast) { - return i; + if (nodes !== undefined) { + for (var i = 0, n = nodes.length; i < n; i++) { + nodes[i].parent = nodes; } } - return -1; + return nodes; + } + + export function separatedList(nodesAndTokens: ISyntaxNodeOrToken[]): ISeparatedSyntaxList { + if (nodesAndTokens !== undefined) { + for (var i = 0, n = nodesAndTokens.length; i < n; i++) { + nodesAndTokens[i].parent = nodesAndTokens; + } + } + + return >nodesAndTokens; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNode.ts b/src/services/syntax/syntaxNode.ts deleted file mode 100644 index 464c59793aa..00000000000 --- a/src/services/syntax/syntaxNode.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -module TypeScript { - export class SyntaxNode implements ISyntaxNodeOrToken { - private __kind: SyntaxKind; - public data: number; - public parent: ISyntaxElement; - - constructor(data: number) { - if (data) { - this.data = data; - } - } - - public kind(): SyntaxKind { - return this.__kind; - } - } -} \ No newline at end of file diff --git a/src/services/syntax/syntaxNodeOrToken.ts b/src/services/syntax/syntaxNodeOrToken.ts index 695268d843f..932970169f6 100644 --- a/src/services/syntax/syntaxNodeOrToken.ts +++ b/src/services/syntax/syntaxNodeOrToken.ts @@ -2,5 +2,7 @@ module TypeScript { export interface ISyntaxNodeOrToken extends ISyntaxElement { + childCount: number; + childAt(index: number): ISyntaxElement; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.abstract.generated.ts b/src/services/syntax/syntaxNodes.abstract.generated.ts deleted file mode 100644 index 9cba7f66d00..00000000000 --- a/src/services/syntax/syntaxNodes.abstract.generated.ts +++ /dev/null @@ -1,1205 +0,0 @@ -/// - -module TypeScript.Syntax.Abstract { - // Inject this module as the factory for producing syntax nodes in the parser. - Parser.syntaxFactory = Abstract; - export var isConcrete: boolean = false; - - export class SourceUnitSyntax extends SyntaxNode { - public syntaxTree: SyntaxTree = null; - public moduleElements: IModuleElementSyntax[]; - public endOfFileToken: ISyntaxToken; - constructor(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { - super(data); - this.parent = null, - this.moduleElements = moduleElements, - this.endOfFileToken = endOfFileToken, - !isShared(moduleElements) && (moduleElements.parent = this), - endOfFileToken.parent = this; - } - } - export class QualifiedNameSyntax extends SyntaxNode implements INameSyntax { - public left: INameSyntax; - public dotToken: ISyntaxToken; - public right: ISyntaxToken; - public _nameBrand: any; public _typeBrand: any; - constructor(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { - super(data); - this.left = left, - this.right = right, - left.parent = this, - right.parent = this; - } - } - export class ObjectTypeSyntax extends SyntaxNode implements ITypeSyntax { - public openBraceToken: ISyntaxToken; - public typeMembers: ITypeMemberSyntax[]; - public closeBraceToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, typeMembers: ITypeMemberSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.typeMembers = typeMembers, - !isShared(typeMembers) && (typeMembers.parent = this); - } - } - export class FunctionTypeSyntax extends SyntaxNode implements ITypeSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.type = type, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - type.parent = this; - } - } - export class ArrayTypeSyntax extends SyntaxNode implements ITypeSyntax { - public type: ITypeSyntax; - public openBracketToken: ISyntaxToken; - public closeBracketToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { - super(data); - this.type = type, - type.parent = this; - } - } - export class ConstructorTypeSyntax extends SyntaxNode implements ITypeSyntax { - public newKeyword: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.type = type, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - type.parent = this; - } - } - export class GenericTypeSyntax extends SyntaxNode implements ITypeSyntax { - public name: INameSyntax; - public typeArgumentList: TypeArgumentListSyntax; - public _typeBrand: any; - constructor(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { - super(data); - this.name = name, - this.typeArgumentList = typeArgumentList, - name.parent = this, - typeArgumentList.parent = this; - } - } - export class TypeQuerySyntax extends SyntaxNode implements ITypeSyntax { - public typeOfKeyword: ISyntaxToken; - public name: INameSyntax; - public _typeBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { - super(data); - this.name = name, - name.parent = this; - } - } - export class TupleTypeSyntax extends SyntaxNode implements ITypeSyntax { - public openBracketToken: ISyntaxToken; - public types: ITypeSyntax[]; - public closeBracketToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, types: ITypeSyntax[], closeBracketToken: ISyntaxToken) { - super(data); - this.types = types, - !isShared(types) && (types.parent = this); - } - } - export class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public interfaceKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public body: ObjectTypeSyntax; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.body = body, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - body.parent = this; - } - } - export class FunctionDeclarationSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - callSignature.parent = this, - block && (block.parent = this); - } - } - export class ModuleDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public moduleKeyword: ISyntaxToken; - public name: INameSyntax; - public stringLiteral: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public moduleElements: IModuleElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.name = name, - this.stringLiteral = stringLiteral, - this.moduleElements = moduleElements, - !isShared(modifiers) && (modifiers.parent = this), - name && (name.parent = this), - stringLiteral && (stringLiteral.parent = this), - !isShared(moduleElements) && (moduleElements.parent = this); - } - } - export class ClassDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public classKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public openBraceToken: ISyntaxToken; - public classElements: IClassElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.classElements = classElements, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - !isShared(classElements) && (classElements.parent = this); - } - } - export class EnumDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public enumKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public enumElements: EnumElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: EnumElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.enumElements = enumElements, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - !isShared(enumElements) && (enumElements.parent = this); - } - } - export class ImportDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public importKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public equalsToken: ISyntaxToken; - public moduleReference: IModuleReferenceSyntax; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.identifier = identifier, - this.moduleReference = moduleReference, - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - moduleReference.parent = this; - } - } - export class ExportAssignmentSyntax extends SyntaxNode implements IModuleElementSyntax { - public exportKeyword: ISyntaxToken; - public equalsToken: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.identifier = identifier, - identifier.parent = this; - } - } - export class MemberFunctionDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block && (block.parent = this); - } - } - export class MemberVariableDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclarator: VariableDeclaratorSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclarator = variableDeclarator, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclarator.parent = this; - } - } - export class ConstructorDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public constructorKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.constructorKeyword = constructorKeyword, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - constructorKeyword.parent = this, - callSignature.parent = this, - block && (block.parent = this); - } - } - export class IndexMemberDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public indexSignature: IndexSignatureSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.indexSignature = indexSignature, - !isShared(modifiers) && (modifiers.parent = this), - indexSignature.parent = this; - } - } - export class GetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public getKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class SetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public setKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class PropertySignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class CallSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.typeAnnotation = typeAnnotation, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class ConstructSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public newKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.callSignature = callSignature, - callSignature.parent = this; - } - } - export class IndexSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public openBracketToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeBracketToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, parameters: ParameterSyntax[], closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.openBracketToken = openBracketToken, - this.parameters = parameters, - this.closeBracketToken = closeBracketToken, - this.typeAnnotation = typeAnnotation, - openBracketToken.parent = this, - !isShared(parameters) && (parameters.parent = this), - closeBracketToken.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class MethodSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.callSignature = callSignature, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - callSignature.parent = this; - } - } - export class BlockSyntax extends SyntaxNode implements IStatementSyntax { - public openBraceToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.statements = statements, - openBraceToken.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class IfStatementSyntax extends SyntaxNode implements IStatementSyntax { - public ifKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public elseClause: ElseClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { - super(data); - this.condition = condition, - this.statement = statement, - this.elseClause = elseClause, - condition.parent = this, - statement.parent = this, - elseClause && (elseClause.parent = this); - } - } - export class VariableStatementSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclaration: VariableDeclarationSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclaration = variableDeclaration, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclaration.parent = this; - } - } - export class ExpressionStatementSyntax extends SyntaxNode implements IStatementSyntax { - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class ReturnStatementSyntax extends SyntaxNode implements IStatementSyntax { - public returnKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.returnKeyword = returnKeyword, - this.expression = expression, - returnKeyword.parent = this, - expression && (expression.parent = this); - } - } - export class SwitchStatementSyntax extends SyntaxNode implements IStatementSyntax { - public switchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public switchClauses: ISwitchClauseSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.switchClauses = switchClauses, - expression.parent = this, - !isShared(switchClauses) && (switchClauses.parent = this); - } - } - export class BreakStatementSyntax extends SyntaxNode implements IStatementSyntax { - public breakKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.breakKeyword = breakKeyword, - this.identifier = identifier, - breakKeyword.parent = this, - identifier && (identifier.parent = this); - } - } - export class ContinueStatementSyntax extends SyntaxNode implements IStatementSyntax { - public continueKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.continueKeyword = continueKeyword, - this.identifier = identifier, - continueKeyword.parent = this, - identifier && (identifier.parent = this); - } - } - export class ForStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public initializer: IExpressionSyntax; - public firstSemicolonToken: ISyntaxToken; - public condition: IExpressionSyntax; - public secondSemicolonToken: ISyntaxToken; - public incrementor: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.variableDeclaration = variableDeclaration, - this.initializer = initializer, - this.condition = condition, - this.incrementor = incrementor, - this.statement = statement, - variableDeclaration && (variableDeclaration.parent = this), - initializer && (initializer.parent = this), - condition && (condition.parent = this), - incrementor && (incrementor.parent = this), - statement.parent = this; - } - } - export class ForInStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public left: IExpressionSyntax; - public inKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.variableDeclaration = variableDeclaration, - this.left = left, - this.expression = expression, - this.statement = statement, - variableDeclaration && (variableDeclaration.parent = this), - left && (left.parent = this), - expression.parent = this, - statement.parent = this; - } - } - export class EmptyStatementSyntax extends SyntaxNode implements IStatementSyntax { - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, semicolonToken: ISyntaxToken) { - super(data); - this.semicolonToken = semicolonToken, - semicolonToken.parent = this; - } - } - export class ThrowStatementSyntax extends SyntaxNode implements IStatementSyntax { - public throwKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class WhileStatementSyntax extends SyntaxNode implements IStatementSyntax { - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.condition = condition, - this.statement = statement, - condition.parent = this, - statement.parent = this; - } - } - export class TryStatementSyntax extends SyntaxNode implements IStatementSyntax { - public tryKeyword: ISyntaxToken; - public block: BlockSyntax; - public catchClause: CatchClauseSyntax; - public finallyClause: FinallyClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { - super(data); - this.block = block, - this.catchClause = catchClause, - this.finallyClause = finallyClause, - block.parent = this, - catchClause && (catchClause.parent = this), - finallyClause && (finallyClause.parent = this); - } - } - export class LabeledStatementSyntax extends SyntaxNode implements IStatementSyntax { - public identifier: ISyntaxToken; - public colonToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.identifier = identifier, - this.statement = statement, - identifier.parent = this, - statement.parent = this; - } - } - export class DoStatementSyntax extends SyntaxNode implements IStatementSyntax { - public doKeyword: ISyntaxToken; - public statement: IStatementSyntax; - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.statement = statement, - this.condition = condition, - statement.parent = this, - condition.parent = this; - } - } - export class DebuggerStatementSyntax extends SyntaxNode implements IStatementSyntax { - public debuggerKeyword: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.debuggerKeyword = debuggerKeyword, - debuggerKeyword.parent = this; - } - } - export class WithStatementSyntax extends SyntaxNode implements IStatementSyntax { - public withKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.condition = condition, - this.statement = statement, - condition.parent = this, - statement.parent = this; - } - } - export class PrefixUnaryExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public operatorToken: ISyntaxToken; - public operand: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { - super(data); - this.operatorToken = operatorToken, - this.operand = operand, - operatorToken.parent = this, - operand.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class DeleteExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public deleteKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class TypeOfExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public typeOfKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class VoidExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public voidKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class ConditionalExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public condition: IExpressionSyntax; - public questionToken: ISyntaxToken; - public whenTrue: IExpressionSyntax; - public colonToken: ISyntaxToken; - public whenFalse: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { - super(data); - this.condition = condition, - this.whenTrue = whenTrue, - this.whenFalse = whenFalse, - condition.parent = this, - whenTrue.parent = this, - whenFalse.parent = this; - } - } - export class BinaryExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public left: IExpressionSyntax; - public operatorToken: ISyntaxToken; - public right: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { - super(data); - this.left = left, - this.operatorToken = operatorToken, - this.right = right, - left.parent = this, - operatorToken.parent = this, - right.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class PostfixUnaryExpressionSyntax extends SyntaxNode implements IPostfixExpressionSyntax { - public operand: ILeftHandSideExpressionSyntax; - public operatorToken: ISyntaxToken; - public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { - super(data); - this.operand = operand, - this.operatorToken = operatorToken, - operand.parent = this, - operatorToken.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class MemberAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public dotToken: ISyntaxToken; - public name: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { - super(data); - this.expression = expression, - this.name = name, - expression.parent = this, - name.parent = this; - } - } - export class InvocationExpressionSyntax extends SyntaxNode implements ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.expression = expression, - this.argumentList = argumentList, - expression.parent = this, - argumentList.parent = this; - } - } - export class ArrayLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBracketToken: ISyntaxToken; - public expressions: IExpressionSyntax[]; - public closeBracketToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, expressions: IExpressionSyntax[], closeBracketToken: ISyntaxToken) { - super(data); - this.expressions = expressions, - !isShared(expressions) && (expressions.parent = this); - } - } - export class ObjectLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBraceToken: ISyntaxToken; - public propertyAssignments: IPropertyAssignmentSyntax[]; - public closeBraceToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, propertyAssignments: IPropertyAssignmentSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.propertyAssignments = propertyAssignments, - !isShared(propertyAssignments) && (propertyAssignments.parent = this); - } - } - export class ObjectCreationExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public newKeyword: ISyntaxToken; - public expression: IMemberExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.expression = expression, - this.argumentList = argumentList, - expression.parent = this, - argumentList && (argumentList.parent = this); - } - } - export class ParenthesizedExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { - super(data); - this.expression = expression, - expression.parent = this; - } - } - export class ParenthesizedArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public callSignature: CallSignatureSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.callSignature = callSignature, - this.block = block, - this.expression = expression, - callSignature.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class SimpleArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public parameter: ParameterSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.parameter = parameter, - this.block = block, - this.expression = expression, - parameter.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class CastExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public lessThanToken: ISyntaxToken; - public type: ITypeSyntax; - public greaterThanToken: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.type = type, - this.expression = expression, - type.parent = this, - expression.parent = this; - } - } - export class ElementAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public openBracketToken: ISyntaxToken; - public argumentExpression: IExpressionSyntax; - public closeBracketToken: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.argumentExpression = argumentExpression, - expression.parent = this, - argumentExpression.parent = this; - } - } - export class FunctionExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - identifier && (identifier.parent = this), - callSignature.parent = this, - block.parent = this; - } - } - export class OmittedExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public _expressionBrand: any; - constructor(data: number) { - super(data); - } - } - export class VariableDeclarationSyntax extends SyntaxNode { - public varKeyword: ISyntaxToken; - public variableDeclarators: VariableDeclaratorSyntax[]; - constructor(data: number, varKeyword: ISyntaxToken, variableDeclarators: VariableDeclaratorSyntax[]) { - super(data); - this.varKeyword = varKeyword, - this.variableDeclarators = variableDeclarators, - varKeyword.parent = this, - !isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - } - export class VariableDeclaratorSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class ArgumentListSyntax extends SyntaxNode { - public typeArgumentList: TypeArgumentListSyntax; - public openParenToken: ISyntaxToken; - public arguments: IExpressionSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: IExpressionSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.typeArgumentList = typeArgumentList, - this.arguments = _arguments, - typeArgumentList && (typeArgumentList.parent = this), - !isShared(_arguments) && (_arguments.parent = this); - } - } - export class ParameterListSyntax extends SyntaxNode { - public openParenToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, openParenToken: ISyntaxToken, parameters: ParameterSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.parameters = parameters, - !isShared(parameters) && (parameters.parent = this); - } - } - export class TypeArgumentListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeArguments: ITypeSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeArguments: ITypeSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeArguments = typeArguments, - lessThanToken.parent = this, - !isShared(typeArguments) && (typeArguments.parent = this); - } - } - export class TypeParameterListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeParameters: TypeParameterSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeParameters: TypeParameterSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeParameters = typeParameters, - lessThanToken.parent = this, - !isShared(typeParameters) && (typeParameters.parent = this); - } - } - export class HeritageClauseSyntax extends SyntaxNode { - public extendsOrImplementsKeyword: ISyntaxToken; - public typeNames: INameSyntax[]; - constructor(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: INameSyntax[]) { - super(data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, - this.typeNames = typeNames, - extendsOrImplementsKeyword.parent = this, - !isShared(typeNames) && (typeNames.parent = this); - } - public kind(): SyntaxKind { return this.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword ? SyntaxKind.ExtendsHeritageClause : SyntaxKind.ImplementsHeritageClause; } - } - export class EqualsValueClauseSyntax extends SyntaxNode { - public equalsToken: ISyntaxToken; - public value: IExpressionSyntax; - constructor(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { - super(data); - this.value = value, - value.parent = this; - } - } - export class CaseSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public caseKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.expression = expression, - this.statements = statements, - expression.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class DefaultSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public defaultKeyword: ISyntaxToken; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.statements = statements, - !isShared(statements) && (statements.parent = this); - } - } - export class ElseClauseSyntax extends SyntaxNode { - public elseKeyword: ISyntaxToken; - public statement: IStatementSyntax; - constructor(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.statement = statement, - statement.parent = this; - } - } - export class CatchClauseSyntax extends SyntaxNode { - public catchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public identifier: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public closeParenToken: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { - super(data); - this.identifier = identifier, - this.typeAnnotation = typeAnnotation, - this.block = block, - identifier.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - block.parent = this; - } - } - export class FinallyClauseSyntax extends SyntaxNode { - public finallyKeyword: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { - super(data); - this.block = block, - block.parent = this; - } - } - export class TypeParameterSyntax extends SyntaxNode { - public identifier: ISyntaxToken; - public constraint: ConstraintSyntax; - constructor(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { - super(data); - this.identifier = identifier, - this.constraint = constraint, - identifier.parent = this, - constraint && (constraint.parent = this); - } - } - export class ConstraintSyntax extends SyntaxNode { - public extendsKeyword: ISyntaxToken; - public typeOrExpression: ISyntaxNodeOrToken; - constructor(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { - super(data); - this.typeOrExpression = typeOrExpression, - typeOrExpression.parent = this; - } - } - export class SimplePropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public colonToken: ISyntaxToken; - public expression: IExpressionSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax) { - super(data); - this.propertyName = propertyName, - this.expression = expression, - propertyName.parent = this, - expression.parent = this; - } - } - export class FunctionPropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class ParameterSyntax extends SyntaxNode { - public dotDotDotToken: ISyntaxToken; - public modifiers: ISyntaxToken[]; - public identifier: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.dotDotDotToken = dotDotDotToken, - this.modifiers = modifiers, - this.identifier = identifier, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - dotDotDotToken && (dotDotDotToken.parent = this), - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class EnumElementSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class TypeAnnotationSyntax extends SyntaxNode { - public colonToken: ISyntaxToken; - public type: ITypeSyntax; - constructor(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.type = type, - type.parent = this; - } - } - export class ExternalModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public requireKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public stringLiteral: ISyntaxToken; - public closeParenToken: ISyntaxToken; - public _moduleReferenceBrand: any; - constructor(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { - super(data); - this.stringLiteral = stringLiteral, - stringLiteral.parent = this; - } - } - export class ModuleNameModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public moduleName: INameSyntax; - public _moduleReferenceBrand: any; - constructor(data: number, moduleName: INameSyntax) { - super(data); - this.moduleName = moduleName, - moduleName.parent = this; - } - } - - (SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (TupleTypeSyntax).prototype.__kind = SyntaxKind.TupleType, (InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (BlockSyntax).prototype.__kind = SyntaxKind.Block, (IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (ArgumentListSyntax).prototype.__kind = SyntaxKind.ArgumentList, (ParameterListSyntax).prototype.__kind = SyntaxKind.ParameterList, (TypeArgumentListSyntax).prototype.__kind = SyntaxKind.TypeArgumentList, (TypeParameterListSyntax).prototype.__kind = SyntaxKind.TypeParameterList, (EqualsValueClauseSyntax).prototype.__kind = SyntaxKind.EqualsValueClause, (CaseSwitchClauseSyntax).prototype.__kind = SyntaxKind.CaseSwitchClause, (DefaultSwitchClauseSyntax).prototype.__kind = SyntaxKind.DefaultSwitchClause, (ElseClauseSyntax).prototype.__kind = SyntaxKind.ElseClause, (CatchClauseSyntax).prototype.__kind = SyntaxKind.CatchClause, (FinallyClauseSyntax).prototype.__kind = SyntaxKind.FinallyClause, (TypeParameterSyntax).prototype.__kind = SyntaxKind.TypeParameter, (ConstraintSyntax).prototype.__kind = SyntaxKind.Constraint, (SimplePropertyAssignmentSyntax).prototype.__kind = SyntaxKind.SimplePropertyAssignment, (FunctionPropertyAssignmentSyntax).prototype.__kind = SyntaxKind.FunctionPropertyAssignment, (ParameterSyntax).prototype.__kind = SyntaxKind.Parameter, (EnumElementSyntax).prototype.__kind = SyntaxKind.EnumElement, (TypeAnnotationSyntax).prototype.__kind = SyntaxKind.TypeAnnotation, (ExternalModuleReferenceSyntax).prototype.__kind = SyntaxKind.ExternalModuleReference, (ModuleNameModuleReferenceSyntax).prototype.__kind = SyntaxKind.ModuleNameModuleReference; -} \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.concrete.generated.ts b/src/services/syntax/syntaxNodes.concrete.generated.ts index fa593fd1976..e87e7e1e2b7 100644 --- a/src/services/syntax/syntaxNodes.concrete.generated.ts +++ b/src/services/syntax/syntaxNodes.concrete.generated.ts @@ -1,1439 +1,1898 @@ /// -module TypeScript.Syntax.Concrete { - // Inject this module as the factory for producing syntax nodes in the parser. - Parser.syntaxFactory = Concrete; - export var isConcrete: boolean = true; - - export class SourceUnitSyntax extends SyntaxNode { - public syntaxTree: SyntaxTree = null; - public moduleElements: IModuleElementSyntax[]; - public endOfFileToken: ISyntaxToken; - constructor(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { - super(data); - this.parent = null, - this.moduleElements = moduleElements, - this.endOfFileToken = endOfFileToken, - !isShared(moduleElements) && (moduleElements.parent = this), - endOfFileToken.parent = this; - } - } - export class QualifiedNameSyntax extends SyntaxNode implements INameSyntax { - public left: INameSyntax; - public dotToken: ISyntaxToken; - public right: ISyntaxToken; - public _nameBrand: any; public _typeBrand: any; - constructor(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { - super(data); - this.left = left, - this.dotToken = dotToken, - this.right = right, - left.parent = this, - dotToken.parent = this, - right.parent = this; - } - } - export class ObjectTypeSyntax extends SyntaxNode implements ITypeSyntax { - public openBraceToken: ISyntaxToken; - public typeMembers: ITypeMemberSyntax[]; - public closeBraceToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, typeMembers: ITypeMemberSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.typeMembers = typeMembers, - this.closeBraceToken = closeBraceToken, - openBraceToken.parent = this, - !isShared(typeMembers) && (typeMembers.parent = this), - closeBraceToken.parent = this; - } - } - export class FunctionTypeSyntax extends SyntaxNode implements ITypeSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.type = type, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - equalsGreaterThanToken.parent = this, - type.parent = this; - } - } - export class ArrayTypeSyntax extends SyntaxNode implements ITypeSyntax { - public type: ITypeSyntax; - public openBracketToken: ISyntaxToken; - public closeBracketToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { - super(data); - this.type = type, - this.openBracketToken = openBracketToken, - this.closeBracketToken = closeBracketToken, - type.parent = this, - openBracketToken.parent = this, - closeBracketToken.parent = this; - } - } - export class ConstructorTypeSyntax extends SyntaxNode implements ITypeSyntax { - public newKeyword: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public type: ITypeSyntax; - public _typeBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.newKeyword = newKeyword, - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.type = type, - newKeyword.parent = this, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - equalsGreaterThanToken.parent = this, - type.parent = this; - } - } - export class GenericTypeSyntax extends SyntaxNode implements ITypeSyntax { - public name: INameSyntax; - public typeArgumentList: TypeArgumentListSyntax; - public _typeBrand: any; - constructor(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { - super(data); - this.name = name, - this.typeArgumentList = typeArgumentList, - name.parent = this, - typeArgumentList.parent = this; - } - } - export class TypeQuerySyntax extends SyntaxNode implements ITypeSyntax { - public typeOfKeyword: ISyntaxToken; - public name: INameSyntax; - public _typeBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { - super(data); - this.typeOfKeyword = typeOfKeyword, - this.name = name, - typeOfKeyword.parent = this, - name.parent = this; - } - } - export class TupleTypeSyntax extends SyntaxNode implements ITypeSyntax { - public openBracketToken: ISyntaxToken; - public types: ITypeSyntax[]; - public closeBracketToken: ISyntaxToken; - public _typeBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, types: ITypeSyntax[], closeBracketToken: ISyntaxToken) { - super(data); - this.openBracketToken = openBracketToken, - this.types = types, - this.closeBracketToken = closeBracketToken, - openBracketToken.parent = this, - !isShared(types) && (types.parent = this), - closeBracketToken.parent = this; - } - } - export class InterfaceDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public interfaceKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public body: ObjectTypeSyntax; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { - super(data); - this.modifiers = modifiers, - this.interfaceKeyword = interfaceKeyword, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.body = body, - !isShared(modifiers) && (modifiers.parent = this), - interfaceKeyword.parent = this, - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - body.parent = this; - } - } - export class FunctionDeclarationSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.functionKeyword = functionKeyword, - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - functionKeyword.parent = this, - identifier.parent = this, - callSignature.parent = this, - block && (block.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class ModuleDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public moduleKeyword: ISyntaxToken; - public name: INameSyntax; - public stringLiteral: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public moduleElements: IModuleElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.moduleKeyword = moduleKeyword, - this.name = name, - this.stringLiteral = stringLiteral, - this.openBraceToken = openBraceToken, - this.moduleElements = moduleElements, - this.closeBraceToken = closeBraceToken, - !isShared(modifiers) && (modifiers.parent = this), - moduleKeyword.parent = this, - name && (name.parent = this), - stringLiteral && (stringLiteral.parent = this), - openBraceToken.parent = this, - !isShared(moduleElements) && (moduleElements.parent = this), - closeBraceToken.parent = this; - } - } - export class ClassDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public classKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public typeParameterList: TypeParameterListSyntax; - public heritageClauses: HeritageClauseSyntax[]; - public openBraceToken: ISyntaxToken; - public classElements: IClassElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.classKeyword = classKeyword, - this.identifier = identifier, - this.typeParameterList = typeParameterList, - this.heritageClauses = heritageClauses, - this.openBraceToken = openBraceToken, - this.classElements = classElements, - this.closeBraceToken = closeBraceToken, - !isShared(modifiers) && (modifiers.parent = this), - classKeyword.parent = this, - identifier.parent = this, - typeParameterList && (typeParameterList.parent = this), - !isShared(heritageClauses) && (heritageClauses.parent = this), - openBraceToken.parent = this, - !isShared(classElements) && (classElements.parent = this), - closeBraceToken.parent = this; - } - } - export class EnumDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public enumKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public enumElements: EnumElementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: EnumElementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.enumKeyword = enumKeyword, - this.identifier = identifier, - this.openBraceToken = openBraceToken, - this.enumElements = enumElements, - this.closeBraceToken = closeBraceToken, - !isShared(modifiers) && (modifiers.parent = this), - enumKeyword.parent = this, - identifier.parent = this, - openBraceToken.parent = this, - !isShared(enumElements) && (enumElements.parent = this), - closeBraceToken.parent = this; - } - } - export class ImportDeclarationSyntax extends SyntaxNode implements IModuleElementSyntax { - public modifiers: ISyntaxToken[]; - public importKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public equalsToken: ISyntaxToken; - public moduleReference: IModuleReferenceSyntax; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.importKeyword = importKeyword, - this.identifier = identifier, - this.equalsToken = equalsToken, - this.moduleReference = moduleReference, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - importKeyword.parent = this, - identifier.parent = this, - equalsToken.parent = this, - moduleReference.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ExportAssignmentSyntax extends SyntaxNode implements IModuleElementSyntax { - public exportKeyword: ISyntaxToken; - public equalsToken: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _moduleElementBrand: any; - constructor(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.exportKeyword = exportKeyword, - this.equalsToken = equalsToken, - this.identifier = identifier, - this.semicolonToken = semicolonToken, - exportKeyword.parent = this, - equalsToken.parent = this, - identifier.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class MemberFunctionDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - propertyName.parent = this, - callSignature.parent = this, - block && (block.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class MemberVariableDeclarationSyntax extends SyntaxNode implements IMemberDeclarationSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclarator: VariableDeclaratorSyntax; - public semicolonToken: ISyntaxToken; - public _memberDeclarationBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclarator = variableDeclarator, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclarator.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ConstructorDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public constructorKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.constructorKeyword = constructorKeyword, - this.callSignature = callSignature, - this.block = block, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - constructorKeyword.parent = this, - callSignature.parent = this, - block && (block.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class IndexMemberDeclarationSyntax extends SyntaxNode implements IClassElementSyntax { - public modifiers: ISyntaxToken[]; - public indexSignature: IndexSignatureSyntax; - public semicolonToken: ISyntaxToken; - public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.indexSignature = indexSignature, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - indexSignature.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class GetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public getKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.getKeyword = getKeyword, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - getKeyword.parent = this, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class SetAccessorSyntax extends SyntaxNode implements IMemberDeclarationSyntax, IPropertyAssignmentSyntax { - public modifiers: ISyntaxToken[]; - public setKeyword: ISyntaxToken; - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _memberDeclarationBrand: any; public _propertyAssignmentBrand: any; public _classElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.modifiers = modifiers, - this.setKeyword = setKeyword, - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - !isShared(modifiers) && (modifiers.parent = this), - setKeyword.parent = this, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class PropertySignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class CallSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public typeParameterList: TypeParameterListSyntax; - public parameterList: ParameterListSyntax; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.typeParameterList = typeParameterList, - this.parameterList = parameterList, - this.typeAnnotation = typeAnnotation, - typeParameterList && (typeParameterList.parent = this), - parameterList.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class ConstructSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public newKeyword: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.newKeyword = newKeyword, - this.callSignature = callSignature, - newKeyword.parent = this, - callSignature.parent = this; - } - } - export class IndexSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public openBracketToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeBracketToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public _typeMemberBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, parameters: ParameterSyntax[], closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { - super(data); - this.openBracketToken = openBracketToken, - this.parameters = parameters, - this.closeBracketToken = closeBracketToken, - this.typeAnnotation = typeAnnotation, - openBracketToken.parent = this, - !isShared(parameters) && (parameters.parent = this), - closeBracketToken.parent = this, - typeAnnotation && (typeAnnotation.parent = this); - } - } - export class MethodSignatureSyntax extends SyntaxNode implements ITypeMemberSyntax { - public propertyName: ISyntaxToken; - public questionToken: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public _typeMemberBrand: any; - constructor(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { - super(data); - this.propertyName = propertyName, - this.questionToken = questionToken, - this.callSignature = callSignature, - propertyName.parent = this, - questionToken && (questionToken.parent = this), - callSignature.parent = this; - } - } - export class BlockSyntax extends SyntaxNode implements IStatementSyntax { - public openBraceToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.statements = statements, - this.closeBraceToken = closeBraceToken, - openBraceToken.parent = this, - !isShared(statements) && (statements.parent = this), - closeBraceToken.parent = this; - } - } - export class IfStatementSyntax extends SyntaxNode implements IStatementSyntax { - public ifKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public elseClause: ElseClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { - super(data); - this.ifKeyword = ifKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.statement = statement, - this.elseClause = elseClause, - ifKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - statement.parent = this, - elseClause && (elseClause.parent = this); - } - } - export class VariableStatementSyntax extends SyntaxNode implements IStatementSyntax { - public modifiers: ISyntaxToken[]; - public variableDeclaration: VariableDeclarationSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.modifiers = modifiers, - this.variableDeclaration = variableDeclaration, - this.semicolonToken = semicolonToken, - !isShared(modifiers) && (modifiers.parent = this), - variableDeclaration.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ExpressionStatementSyntax extends SyntaxNode implements IStatementSyntax { - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.semicolonToken = semicolonToken, - expression.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class ReturnStatementSyntax extends SyntaxNode implements IStatementSyntax { - public returnKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.returnKeyword = returnKeyword, - this.expression = expression, - this.semicolonToken = semicolonToken, - returnKeyword.parent = this, - expression && (expression.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class SwitchStatementSyntax extends SyntaxNode implements IStatementSyntax { - public switchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public openBraceToken: ISyntaxToken; - public switchClauses: ISwitchClauseSyntax[]; - public closeBraceToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.switchKeyword = switchKeyword, - this.openParenToken = openParenToken, - this.expression = expression, - this.closeParenToken = closeParenToken, - this.openBraceToken = openBraceToken, - this.switchClauses = switchClauses, - this.closeBraceToken = closeBraceToken, - switchKeyword.parent = this, - openParenToken.parent = this, - expression.parent = this, - closeParenToken.parent = this, - openBraceToken.parent = this, - !isShared(switchClauses) && (switchClauses.parent = this), - closeBraceToken.parent = this; - } - } - export class BreakStatementSyntax extends SyntaxNode implements IStatementSyntax { - public breakKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.breakKeyword = breakKeyword, - this.identifier = identifier, - this.semicolonToken = semicolonToken, - breakKeyword.parent = this, - identifier && (identifier.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class ContinueStatementSyntax extends SyntaxNode implements IStatementSyntax { - public continueKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.continueKeyword = continueKeyword, - this.identifier = identifier, - this.semicolonToken = semicolonToken, - continueKeyword.parent = this, - identifier && (identifier.parent = this), - semicolonToken && (semicolonToken.parent = this); - } - } - export class ForStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public initializer: IExpressionSyntax; - public firstSemicolonToken: ISyntaxToken; - public condition: IExpressionSyntax; - public secondSemicolonToken: ISyntaxToken; - public incrementor: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.forKeyword = forKeyword, - this.openParenToken = openParenToken, - this.variableDeclaration = variableDeclaration, - this.initializer = initializer, - this.firstSemicolonToken = firstSemicolonToken, - this.condition = condition, - this.secondSemicolonToken = secondSemicolonToken, - this.incrementor = incrementor, - this.closeParenToken = closeParenToken, - this.statement = statement, - forKeyword.parent = this, - openParenToken.parent = this, - variableDeclaration && (variableDeclaration.parent = this), - initializer && (initializer.parent = this), - firstSemicolonToken.parent = this, - condition && (condition.parent = this), - secondSemicolonToken.parent = this, - incrementor && (incrementor.parent = this), - closeParenToken.parent = this, - statement.parent = this; - } - } - export class ForInStatementSyntax extends SyntaxNode implements IStatementSyntax { - public forKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public variableDeclaration: VariableDeclarationSyntax; - public left: IExpressionSyntax; - public inKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.forKeyword = forKeyword, - this.openParenToken = openParenToken, - this.variableDeclaration = variableDeclaration, - this.left = left, - this.inKeyword = inKeyword, - this.expression = expression, - this.closeParenToken = closeParenToken, - this.statement = statement, - forKeyword.parent = this, - openParenToken.parent = this, - variableDeclaration && (variableDeclaration.parent = this), - left && (left.parent = this), - inKeyword.parent = this, - expression.parent = this, - closeParenToken.parent = this, - statement.parent = this; - } - } - export class EmptyStatementSyntax extends SyntaxNode implements IStatementSyntax { - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, semicolonToken: ISyntaxToken) { - super(data); - this.semicolonToken = semicolonToken, - semicolonToken.parent = this; - } - } - export class ThrowStatementSyntax extends SyntaxNode implements IStatementSyntax { - public throwKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { - super(data); - this.throwKeyword = throwKeyword, - this.expression = expression, - this.semicolonToken = semicolonToken, - throwKeyword.parent = this, - expression.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class WhileStatementSyntax extends SyntaxNode implements IStatementSyntax { - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.whileKeyword = whileKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.statement = statement, - whileKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - statement.parent = this; - } - } - export class TryStatementSyntax extends SyntaxNode implements IStatementSyntax { - public tryKeyword: ISyntaxToken; - public block: BlockSyntax; - public catchClause: CatchClauseSyntax; - public finallyClause: FinallyClauseSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { - super(data); - this.tryKeyword = tryKeyword, - this.block = block, - this.catchClause = catchClause, - this.finallyClause = finallyClause, - tryKeyword.parent = this, - block.parent = this, - catchClause && (catchClause.parent = this), - finallyClause && (finallyClause.parent = this); - } - } - export class LabeledStatementSyntax extends SyntaxNode implements IStatementSyntax { - public identifier: ISyntaxToken; - public colonToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.identifier = identifier, - this.colonToken = colonToken, - this.statement = statement, - identifier.parent = this, - colonToken.parent = this, - statement.parent = this; - } - } - export class DoStatementSyntax extends SyntaxNode implements IStatementSyntax { - public doKeyword: ISyntaxToken; - public statement: IStatementSyntax; - public whileKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.doKeyword = doKeyword, - this.statement = statement, - this.whileKeyword = whileKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.semicolonToken = semicolonToken, - doKeyword.parent = this, - statement.parent = this, - whileKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class DebuggerStatementSyntax extends SyntaxNode implements IStatementSyntax { - public debuggerKeyword: ISyntaxToken; - public semicolonToken: ISyntaxToken; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { - super(data); - this.debuggerKeyword = debuggerKeyword, - this.semicolonToken = semicolonToken, - debuggerKeyword.parent = this, - semicolonToken && (semicolonToken.parent = this); - } - } - export class WithStatementSyntax extends SyntaxNode implements IStatementSyntax { - public withKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public condition: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public statement: IStatementSyntax; - public _statementBrand: any; public _moduleElementBrand: any; - constructor(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.withKeyword = withKeyword, - this.openParenToken = openParenToken, - this.condition = condition, - this.closeParenToken = closeParenToken, - this.statement = statement, - withKeyword.parent = this, - openParenToken.parent = this, - condition.parent = this, - closeParenToken.parent = this, - statement.parent = this; - } - } - export class PrefixUnaryExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public operatorToken: ISyntaxToken; - public operand: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { - super(data); - this.operatorToken = operatorToken, - this.operand = operand, - operatorToken.parent = this, - operand.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class DeleteExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public deleteKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.deleteKeyword = deleteKeyword, - this.expression = expression, - deleteKeyword.parent = this, - expression.parent = this; - } - } - export class TypeOfExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public typeOfKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.typeOfKeyword = typeOfKeyword, - this.expression = expression, - typeOfKeyword.parent = this, - expression.parent = this; - } - } - export class VoidExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public voidKeyword: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.voidKeyword = voidKeyword, - this.expression = expression, - voidKeyword.parent = this, - expression.parent = this; - } - } - export class ConditionalExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public condition: IExpressionSyntax; - public questionToken: ISyntaxToken; - public whenTrue: IExpressionSyntax; - public colonToken: ISyntaxToken; - public whenFalse: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { - super(data); - this.condition = condition, - this.questionToken = questionToken, - this.whenTrue = whenTrue, - this.colonToken = colonToken, - this.whenFalse = whenFalse, - condition.parent = this, - questionToken.parent = this, - whenTrue.parent = this, - colonToken.parent = this, - whenFalse.parent = this; - } - } - export class BinaryExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public left: IExpressionSyntax; - public operatorToken: ISyntaxToken; - public right: IExpressionSyntax; - public _expressionBrand: any; - constructor(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { - super(data); - this.left = left, - this.operatorToken = operatorToken, - this.right = right, - left.parent = this, - operatorToken.parent = this, - right.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class PostfixUnaryExpressionSyntax extends SyntaxNode implements IPostfixExpressionSyntax { - public operand: ILeftHandSideExpressionSyntax; - public operatorToken: ISyntaxToken; - public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { - super(data); - this.operand = operand, - this.operatorToken = operatorToken, - operand.parent = this, - operatorToken.parent = this; - } - public kind(): SyntaxKind { return SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); } - } - export class MemberAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public dotToken: ISyntaxToken; - public name: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { - super(data); - this.expression = expression, - this.dotToken = dotToken, - this.name = name, - expression.parent = this, - dotToken.parent = this, - name.parent = this; - } - } - export class InvocationExpressionSyntax extends SyntaxNode implements ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.expression = expression, - this.argumentList = argumentList, - expression.parent = this, - argumentList.parent = this; - } - } - export class ArrayLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBracketToken: ISyntaxToken; - public expressions: IExpressionSyntax[]; - public closeBracketToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBracketToken: ISyntaxToken, expressions: IExpressionSyntax[], closeBracketToken: ISyntaxToken) { - super(data); - this.openBracketToken = openBracketToken, - this.expressions = expressions, - this.closeBracketToken = closeBracketToken, - openBracketToken.parent = this, - !isShared(expressions) && (expressions.parent = this), - closeBracketToken.parent = this; - } - } - export class ObjectLiteralExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openBraceToken: ISyntaxToken; - public propertyAssignments: IPropertyAssignmentSyntax[]; - public closeBraceToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openBraceToken: ISyntaxToken, propertyAssignments: IPropertyAssignmentSyntax[], closeBraceToken: ISyntaxToken) { - super(data); - this.openBraceToken = openBraceToken, - this.propertyAssignments = propertyAssignments, - this.closeBraceToken = closeBraceToken, - openBraceToken.parent = this, - !isShared(propertyAssignments) && (propertyAssignments.parent = this), - closeBraceToken.parent = this; - } - } - export class ObjectCreationExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public newKeyword: ISyntaxToken; - public expression: IMemberExpressionSyntax; - public argumentList: ArgumentListSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { - super(data); - this.newKeyword = newKeyword, - this.expression = expression, - this.argumentList = argumentList, - newKeyword.parent = this, - expression.parent = this, - argumentList && (argumentList.parent = this); - } - } - export class ParenthesizedExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public openParenToken: ISyntaxToken; - public expression: IExpressionSyntax; - public closeParenToken: ISyntaxToken; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { - super(data); - this.openParenToken = openParenToken, - this.expression = expression, - this.closeParenToken = closeParenToken, - openParenToken.parent = this, - expression.parent = this, - closeParenToken.parent = this; - } - } - export class ParenthesizedArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public callSignature: CallSignatureSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.callSignature = callSignature, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.block = block, - this.expression = expression, - callSignature.parent = this, - equalsGreaterThanToken.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class SimpleArrowFunctionExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public parameter: ParameterSyntax; - public equalsGreaterThanToken: ISyntaxToken; - public block: BlockSyntax; - public expression: IExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { - super(data); - this.parameter = parameter, - this.equalsGreaterThanToken = equalsGreaterThanToken, - this.block = block, - this.expression = expression, - parameter.parent = this, - equalsGreaterThanToken.parent = this, - block && (block.parent = this), - expression && (expression.parent = this); - } - } - export class CastExpressionSyntax extends SyntaxNode implements IUnaryExpressionSyntax { - public lessThanToken: ISyntaxToken; - public type: ITypeSyntax; - public greaterThanToken: ISyntaxToken; - public expression: IUnaryExpressionSyntax; - public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { - super(data); - this.lessThanToken = lessThanToken, - this.type = type, - this.greaterThanToken = greaterThanToken, - this.expression = expression, - lessThanToken.parent = this, - type.parent = this, - greaterThanToken.parent = this, - expression.parent = this; - } - } - export class ElementAccessExpressionSyntax extends SyntaxNode implements IMemberExpressionSyntax, ICallExpressionSyntax { - public expression: ILeftHandSideExpressionSyntax; - public openBracketToken: ISyntaxToken; - public argumentExpression: IExpressionSyntax; - public closeBracketToken: ISyntaxToken; - public _memberExpressionBrand: any; public _callExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { - super(data); - this.expression = expression, - this.openBracketToken = openBracketToken, - this.argumentExpression = argumentExpression, - this.closeBracketToken = closeBracketToken, - expression.parent = this, - openBracketToken.parent = this, - argumentExpression.parent = this, - closeBracketToken.parent = this; - } - } - export class FunctionExpressionSyntax extends SyntaxNode implements IPrimaryExpressionSyntax { - public functionKeyword: ISyntaxToken; - public identifier: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; - constructor(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.functionKeyword = functionKeyword, - this.identifier = identifier, - this.callSignature = callSignature, - this.block = block, - functionKeyword.parent = this, - identifier && (identifier.parent = this), - callSignature.parent = this, - block.parent = this; - } - } - export class OmittedExpressionSyntax extends SyntaxNode implements IExpressionSyntax { - public _expressionBrand: any; - constructor(data: number) { - super(data); - } - } - export class VariableDeclarationSyntax extends SyntaxNode { - public varKeyword: ISyntaxToken; - public variableDeclarators: VariableDeclaratorSyntax[]; - constructor(data: number, varKeyword: ISyntaxToken, variableDeclarators: VariableDeclaratorSyntax[]) { - super(data); - this.varKeyword = varKeyword, - this.variableDeclarators = variableDeclarators, - varKeyword.parent = this, - !isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - } - export class VariableDeclaratorSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class ArgumentListSyntax extends SyntaxNode { - public typeArgumentList: TypeArgumentListSyntax; - public openParenToken: ISyntaxToken; - public arguments: IExpressionSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: IExpressionSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.typeArgumentList = typeArgumentList, - this.openParenToken = openParenToken, - this.arguments = _arguments, - this.closeParenToken = closeParenToken, - typeArgumentList && (typeArgumentList.parent = this), - openParenToken.parent = this, - !isShared(_arguments) && (_arguments.parent = this), - closeParenToken.parent = this; - } - } - export class ParameterListSyntax extends SyntaxNode { - public openParenToken: ISyntaxToken; - public parameters: ParameterSyntax[]; - public closeParenToken: ISyntaxToken; - constructor(data: number, openParenToken: ISyntaxToken, parameters: ParameterSyntax[], closeParenToken: ISyntaxToken) { - super(data); - this.openParenToken = openParenToken, - this.parameters = parameters, - this.closeParenToken = closeParenToken, - openParenToken.parent = this, - !isShared(parameters) && (parameters.parent = this), - closeParenToken.parent = this; - } - } - export class TypeArgumentListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeArguments: ITypeSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeArguments: ITypeSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeArguments = typeArguments, - this.greaterThanToken = greaterThanToken, - lessThanToken.parent = this, - !isShared(typeArguments) && (typeArguments.parent = this), - greaterThanToken.parent = this; - } - } - export class TypeParameterListSyntax extends SyntaxNode { - public lessThanToken: ISyntaxToken; - public typeParameters: TypeParameterSyntax[]; - public greaterThanToken: ISyntaxToken; - constructor(data: number, lessThanToken: ISyntaxToken, typeParameters: TypeParameterSyntax[], greaterThanToken: ISyntaxToken) { - super(data); - this.lessThanToken = lessThanToken, - this.typeParameters = typeParameters, - this.greaterThanToken = greaterThanToken, - lessThanToken.parent = this, - !isShared(typeParameters) && (typeParameters.parent = this), - greaterThanToken.parent = this; - } - } - export class HeritageClauseSyntax extends SyntaxNode { - public extendsOrImplementsKeyword: ISyntaxToken; - public typeNames: INameSyntax[]; - constructor(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: INameSyntax[]) { - super(data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, - this.typeNames = typeNames, - extendsOrImplementsKeyword.parent = this, - !isShared(typeNames) && (typeNames.parent = this); - } - public kind(): SyntaxKind { return this.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword ? SyntaxKind.ExtendsHeritageClause : SyntaxKind.ImplementsHeritageClause; } - } - export class EqualsValueClauseSyntax extends SyntaxNode { - public equalsToken: ISyntaxToken; - public value: IExpressionSyntax; - constructor(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { - super(data); - this.equalsToken = equalsToken, - this.value = value, - equalsToken.parent = this, - value.parent = this; - } - } - export class CaseSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public caseKeyword: ISyntaxToken; - public expression: IExpressionSyntax; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.caseKeyword = caseKeyword, - this.expression = expression, - this.colonToken = colonToken, - this.statements = statements, - caseKeyword.parent = this, - expression.parent = this, - colonToken.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class DefaultSwitchClauseSyntax extends SyntaxNode implements ISwitchClauseSyntax { - public defaultKeyword: ISyntaxToken; - public colonToken: ISyntaxToken; - public statements: IStatementSyntax[]; - public _switchClauseBrand: any; - constructor(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { - super(data); - this.defaultKeyword = defaultKeyword, - this.colonToken = colonToken, - this.statements = statements, - defaultKeyword.parent = this, - colonToken.parent = this, - !isShared(statements) && (statements.parent = this); - } - } - export class ElseClauseSyntax extends SyntaxNode { - public elseKeyword: ISyntaxToken; - public statement: IStatementSyntax; - constructor(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { - super(data); - this.elseKeyword = elseKeyword, - this.statement = statement, - elseKeyword.parent = this, - statement.parent = this; - } - } - export class CatchClauseSyntax extends SyntaxNode { - public catchKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public identifier: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public closeParenToken: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { - super(data); - this.catchKeyword = catchKeyword, - this.openParenToken = openParenToken, - this.identifier = identifier, - this.typeAnnotation = typeAnnotation, - this.closeParenToken = closeParenToken, - this.block = block, - catchKeyword.parent = this, - openParenToken.parent = this, - identifier.parent = this, - typeAnnotation && (typeAnnotation.parent = this), - closeParenToken.parent = this, - block.parent = this; - } - } - export class FinallyClauseSyntax extends SyntaxNode { - public finallyKeyword: ISyntaxToken; - public block: BlockSyntax; - constructor(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { - super(data); - this.finallyKeyword = finallyKeyword, - this.block = block, - finallyKeyword.parent = this, - block.parent = this; - } - } - export class TypeParameterSyntax extends SyntaxNode { - public identifier: ISyntaxToken; - public constraint: ConstraintSyntax; - constructor(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { - super(data); - this.identifier = identifier, - this.constraint = constraint, - identifier.parent = this, - constraint && (constraint.parent = this); - } - } - export class ConstraintSyntax extends SyntaxNode { - public extendsKeyword: ISyntaxToken; - public typeOrExpression: ISyntaxNodeOrToken; - constructor(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { - super(data); - this.extendsKeyword = extendsKeyword, - this.typeOrExpression = typeOrExpression, - extendsKeyword.parent = this, - typeOrExpression.parent = this; - } - } - export class SimplePropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public colonToken: ISyntaxToken; - public expression: IExpressionSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax) { - super(data); - this.propertyName = propertyName, - this.colonToken = colonToken, - this.expression = expression, - propertyName.parent = this, - colonToken.parent = this, - expression.parent = this; - } - } - export class FunctionPropertyAssignmentSyntax extends SyntaxNode implements IPropertyAssignmentSyntax { - public propertyName: ISyntaxToken; - public callSignature: CallSignatureSyntax; - public block: BlockSyntax; - public _propertyAssignmentBrand: any; - constructor(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { - super(data); - this.propertyName = propertyName, - this.callSignature = callSignature, - this.block = block, - propertyName.parent = this, - callSignature.parent = this, - block.parent = this; - } - } - export class ParameterSyntax extends SyntaxNode { - public dotDotDotToken: ISyntaxToken; - public modifiers: ISyntaxToken[]; - public identifier: ISyntaxToken; - public questionToken: ISyntaxToken; - public typeAnnotation: TypeAnnotationSyntax; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.dotDotDotToken = dotDotDotToken, - this.modifiers = modifiers, - this.identifier = identifier, - this.questionToken = questionToken, - this.typeAnnotation = typeAnnotation, - this.equalsValueClause = equalsValueClause, - dotDotDotToken && (dotDotDotToken.parent = this), - !isShared(modifiers) && (modifiers.parent = this), - identifier.parent = this, - questionToken && (questionToken.parent = this), - typeAnnotation && (typeAnnotation.parent = this), - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class EnumElementSyntax extends SyntaxNode { - public propertyName: ISyntaxToken; - public equalsValueClause: EqualsValueClauseSyntax; - constructor(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax) { - super(data); - this.propertyName = propertyName, - this.equalsValueClause = equalsValueClause, - propertyName.parent = this, - equalsValueClause && (equalsValueClause.parent = this); - } - } - export class TypeAnnotationSyntax extends SyntaxNode { - public colonToken: ISyntaxToken; - public type: ITypeSyntax; - constructor(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { - super(data); - this.colonToken = colonToken, - this.type = type, - colonToken.parent = this, - type.parent = this; - } - } - export class ExternalModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public requireKeyword: ISyntaxToken; - public openParenToken: ISyntaxToken; - public stringLiteral: ISyntaxToken; - public closeParenToken: ISyntaxToken; - public _moduleReferenceBrand: any; - constructor(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { - super(data); - this.requireKeyword = requireKeyword, - this.openParenToken = openParenToken, - this.stringLiteral = stringLiteral, - this.closeParenToken = closeParenToken, - requireKeyword.parent = this, - openParenToken.parent = this, - stringLiteral.parent = this, - closeParenToken.parent = this; - } - } - export class ModuleNameModuleReferenceSyntax extends SyntaxNode implements IModuleReferenceSyntax { - public moduleName: INameSyntax; - public _moduleReferenceBrand: any; - constructor(data: number, moduleName: INameSyntax) { - super(data); - this.moduleName = moduleName, - moduleName.parent = this; +module TypeScript { + export var SourceUnitSyntax: SourceUnitConstructor = function(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.moduleElements = moduleElements, + this.endOfFileToken = endOfFileToken, + moduleElements.parent = this, + endOfFileToken.parent = this; + }; + SourceUnitSyntax.prototype.kind = SyntaxKind.SourceUnit; + SourceUnitSyntax.prototype.childCount = 2; + SourceUnitSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.moduleElements; + case 1: return this.endOfFileToken; } } - (SourceUnitSyntax).prototype.__kind = SyntaxKind.SourceUnit, (QualifiedNameSyntax).prototype.__kind = SyntaxKind.QualifiedName, (ObjectTypeSyntax).prototype.__kind = SyntaxKind.ObjectType, (FunctionTypeSyntax).prototype.__kind = SyntaxKind.FunctionType, (ArrayTypeSyntax).prototype.__kind = SyntaxKind.ArrayType, (ConstructorTypeSyntax).prototype.__kind = SyntaxKind.ConstructorType, (GenericTypeSyntax).prototype.__kind = SyntaxKind.GenericType, (TypeQuerySyntax).prototype.__kind = SyntaxKind.TypeQuery, (TupleTypeSyntax).prototype.__kind = SyntaxKind.TupleType, (InterfaceDeclarationSyntax).prototype.__kind = SyntaxKind.InterfaceDeclaration, (FunctionDeclarationSyntax).prototype.__kind = SyntaxKind.FunctionDeclaration, (ModuleDeclarationSyntax).prototype.__kind = SyntaxKind.ModuleDeclaration, (ClassDeclarationSyntax).prototype.__kind = SyntaxKind.ClassDeclaration, (EnumDeclarationSyntax).prototype.__kind = SyntaxKind.EnumDeclaration, (ImportDeclarationSyntax).prototype.__kind = SyntaxKind.ImportDeclaration, (ExportAssignmentSyntax).prototype.__kind = SyntaxKind.ExportAssignment, (MemberFunctionDeclarationSyntax).prototype.__kind = SyntaxKind.MemberFunctionDeclaration, (MemberVariableDeclarationSyntax).prototype.__kind = SyntaxKind.MemberVariableDeclaration, (ConstructorDeclarationSyntax).prototype.__kind = SyntaxKind.ConstructorDeclaration, (IndexMemberDeclarationSyntax).prototype.__kind = SyntaxKind.IndexMemberDeclaration, (GetAccessorSyntax).prototype.__kind = SyntaxKind.GetAccessor, (SetAccessorSyntax).prototype.__kind = SyntaxKind.SetAccessor, (PropertySignatureSyntax).prototype.__kind = SyntaxKind.PropertySignature, (CallSignatureSyntax).prototype.__kind = SyntaxKind.CallSignature, (ConstructSignatureSyntax).prototype.__kind = SyntaxKind.ConstructSignature, (IndexSignatureSyntax).prototype.__kind = SyntaxKind.IndexSignature, (MethodSignatureSyntax).prototype.__kind = SyntaxKind.MethodSignature, (BlockSyntax).prototype.__kind = SyntaxKind.Block, (IfStatementSyntax).prototype.__kind = SyntaxKind.IfStatement, (VariableStatementSyntax).prototype.__kind = SyntaxKind.VariableStatement, (ExpressionStatementSyntax).prototype.__kind = SyntaxKind.ExpressionStatement, (ReturnStatementSyntax).prototype.__kind = SyntaxKind.ReturnStatement, (SwitchStatementSyntax).prototype.__kind = SyntaxKind.SwitchStatement, (BreakStatementSyntax).prototype.__kind = SyntaxKind.BreakStatement, (ContinueStatementSyntax).prototype.__kind = SyntaxKind.ContinueStatement, (ForStatementSyntax).prototype.__kind = SyntaxKind.ForStatement, (ForInStatementSyntax).prototype.__kind = SyntaxKind.ForInStatement, (EmptyStatementSyntax).prototype.__kind = SyntaxKind.EmptyStatement, (ThrowStatementSyntax).prototype.__kind = SyntaxKind.ThrowStatement, (WhileStatementSyntax).prototype.__kind = SyntaxKind.WhileStatement, (TryStatementSyntax).prototype.__kind = SyntaxKind.TryStatement, (LabeledStatementSyntax).prototype.__kind = SyntaxKind.LabeledStatement, (DoStatementSyntax).prototype.__kind = SyntaxKind.DoStatement, (DebuggerStatementSyntax).prototype.__kind = SyntaxKind.DebuggerStatement, (WithStatementSyntax).prototype.__kind = SyntaxKind.WithStatement, (DeleteExpressionSyntax).prototype.__kind = SyntaxKind.DeleteExpression, (TypeOfExpressionSyntax).prototype.__kind = SyntaxKind.TypeOfExpression, (VoidExpressionSyntax).prototype.__kind = SyntaxKind.VoidExpression, (ConditionalExpressionSyntax).prototype.__kind = SyntaxKind.ConditionalExpression, (MemberAccessExpressionSyntax).prototype.__kind = SyntaxKind.MemberAccessExpression, (InvocationExpressionSyntax).prototype.__kind = SyntaxKind.InvocationExpression, (ArrayLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ArrayLiteralExpression, (ObjectLiteralExpressionSyntax).prototype.__kind = SyntaxKind.ObjectLiteralExpression, (ObjectCreationExpressionSyntax).prototype.__kind = SyntaxKind.ObjectCreationExpression, (ParenthesizedExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedExpression, (ParenthesizedArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.ParenthesizedArrowFunctionExpression, (SimpleArrowFunctionExpressionSyntax).prototype.__kind = SyntaxKind.SimpleArrowFunctionExpression, (CastExpressionSyntax).prototype.__kind = SyntaxKind.CastExpression, (ElementAccessExpressionSyntax).prototype.__kind = SyntaxKind.ElementAccessExpression, (FunctionExpressionSyntax).prototype.__kind = SyntaxKind.FunctionExpression, (OmittedExpressionSyntax).prototype.__kind = SyntaxKind.OmittedExpression, (VariableDeclarationSyntax).prototype.__kind = SyntaxKind.VariableDeclaration, (VariableDeclaratorSyntax).prototype.__kind = SyntaxKind.VariableDeclarator, (ArgumentListSyntax).prototype.__kind = SyntaxKind.ArgumentList, (ParameterListSyntax).prototype.__kind = SyntaxKind.ParameterList, (TypeArgumentListSyntax).prototype.__kind = SyntaxKind.TypeArgumentList, (TypeParameterListSyntax).prototype.__kind = SyntaxKind.TypeParameterList, (EqualsValueClauseSyntax).prototype.__kind = SyntaxKind.EqualsValueClause, (CaseSwitchClauseSyntax).prototype.__kind = SyntaxKind.CaseSwitchClause, (DefaultSwitchClauseSyntax).prototype.__kind = SyntaxKind.DefaultSwitchClause, (ElseClauseSyntax).prototype.__kind = SyntaxKind.ElseClause, (CatchClauseSyntax).prototype.__kind = SyntaxKind.CatchClause, (FinallyClauseSyntax).prototype.__kind = SyntaxKind.FinallyClause, (TypeParameterSyntax).prototype.__kind = SyntaxKind.TypeParameter, (ConstraintSyntax).prototype.__kind = SyntaxKind.Constraint, (SimplePropertyAssignmentSyntax).prototype.__kind = SyntaxKind.SimplePropertyAssignment, (FunctionPropertyAssignmentSyntax).prototype.__kind = SyntaxKind.FunctionPropertyAssignment, (ParameterSyntax).prototype.__kind = SyntaxKind.Parameter, (EnumElementSyntax).prototype.__kind = SyntaxKind.EnumElement, (TypeAnnotationSyntax).prototype.__kind = SyntaxKind.TypeAnnotation, (ExternalModuleReferenceSyntax).prototype.__kind = SyntaxKind.ExternalModuleReference, (ModuleNameModuleReferenceSyntax).prototype.__kind = SyntaxKind.ModuleNameModuleReference; + export var QualifiedNameSyntax: QualifiedNameConstructor = function(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { + if (data) { this.__data = data; } + this.left = left, + this.dotToken = dotToken, + this.right = right, + left.parent = this, + dotToken.parent = this, + right.parent = this; + }; + QualifiedNameSyntax.prototype.kind = SyntaxKind.QualifiedName; + QualifiedNameSyntax.prototype.childCount = 3; + QualifiedNameSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.dotToken; + case 2: return this.right; + } + } + + export var ObjectTypeSyntax: ObjectTypeConstructor = function(data: number, openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBraceToken = openBraceToken, + this.typeMembers = typeMembers, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + typeMembers.parent = this, + closeBraceToken.parent = this; + }; + ObjectTypeSyntax.prototype.kind = SyntaxKind.ObjectType; + ObjectTypeSyntax.prototype.childCount = 3; + ObjectTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.typeMembers; + case 2: return this.closeBraceToken; + } + } + + export var FunctionTypeSyntax: FunctionTypeConstructor = function(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { + if (data) { this.__data = data; } + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.type = type, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + equalsGreaterThanToken.parent = this, + type.parent = this; + }; + FunctionTypeSyntax.prototype.kind = SyntaxKind.FunctionType; + FunctionTypeSyntax.prototype.childCount = 4; + FunctionTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeParameterList; + case 1: return this.parameterList; + case 2: return this.equalsGreaterThanToken; + case 3: return this.type; + } + } + + export var ArrayTypeSyntax: ArrayTypeConstructor = function(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.type = type, + this.openBracketToken = openBracketToken, + this.closeBracketToken = closeBracketToken, + type.parent = this, + openBracketToken.parent = this, + closeBracketToken.parent = this; + }; + ArrayTypeSyntax.prototype.kind = SyntaxKind.ArrayType; + ArrayTypeSyntax.prototype.childCount = 3; + ArrayTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.type; + case 1: return this.openBracketToken; + case 2: return this.closeBracketToken; + } + } + + export var ConstructorTypeSyntax: ConstructorTypeConstructor = function(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { + if (data) { this.__data = data; } + this.newKeyword = newKeyword, + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.type = type, + newKeyword.parent = this, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + equalsGreaterThanToken.parent = this, + type.parent = this; + }; + ConstructorTypeSyntax.prototype.kind = SyntaxKind.ConstructorType; + ConstructorTypeSyntax.prototype.childCount = 5; + ConstructorTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.typeParameterList; + case 2: return this.parameterList; + case 3: return this.equalsGreaterThanToken; + case 4: return this.type; + } + } + + export var GenericTypeSyntax: GenericTypeConstructor = function(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { + if (data) { this.__data = data; } + this.name = name, + this.typeArgumentList = typeArgumentList, + name.parent = this, + typeArgumentList.parent = this; + }; + GenericTypeSyntax.prototype.kind = SyntaxKind.GenericType; + GenericTypeSyntax.prototype.childCount = 2; + GenericTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.name; + case 1: return this.typeArgumentList; + } + } + + export var TypeQuerySyntax: TypeQueryConstructor = function(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { + if (data) { this.__data = data; } + this.typeOfKeyword = typeOfKeyword, + this.name = name, + typeOfKeyword.parent = this, + name.parent = this; + }; + TypeQuerySyntax.prototype.kind = SyntaxKind.TypeQuery; + TypeQuerySyntax.prototype.childCount = 2; + TypeQuerySyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeOfKeyword; + case 1: return this.name; + } + } + + export var TupleTypeSyntax: TupleTypeConstructor = function(data: number, openBracketToken: ISyntaxToken, types: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.types = types, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + types.parent = this, + closeBracketToken.parent = this; + }; + TupleTypeSyntax.prototype.kind = SyntaxKind.TupleType; + TupleTypeSyntax.prototype.childCount = 3; + TupleTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.types; + case 2: return this.closeBracketToken; + } + } + + export var UnionTypeSyntax: UnionTypeConstructor = function(data: number, left: ITypeSyntax, barToken: ISyntaxToken, right: ITypeSyntax) { + if (data) { this.__data = data; } + this.left = left, + this.barToken = barToken, + this.right = right, + left.parent = this, + barToken.parent = this, + right.parent = this; + }; + UnionTypeSyntax.prototype.kind = SyntaxKind.UnionType; + UnionTypeSyntax.prototype.childCount = 3; + UnionTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.barToken; + case 2: return this.right; + } + } + + export var ParenthesizedTypeSyntax: ParenthesizedTypeConstructor = function(data: number, openParenToken: ISyntaxToken, type: ITypeSyntax, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openParenToken = openParenToken, + this.type = type, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + type.parent = this, + closeParenToken.parent = this; + }; + ParenthesizedTypeSyntax.prototype.kind = SyntaxKind.ParenthesizedType; + ParenthesizedTypeSyntax.prototype.childCount = 3; + ParenthesizedTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.type; + case 2: return this.closeParenToken; + } + } + + export var InterfaceDeclarationSyntax: InterfaceDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.interfaceKeyword = interfaceKeyword, + this.identifier = identifier, + this.typeParameterList = typeParameterList, + this.heritageClauses = heritageClauses, + this.body = body, + modifiers.parent = this, + interfaceKeyword.parent = this, + identifier.parent = this, + typeParameterList && (typeParameterList.parent = this), + heritageClauses.parent = this, + body.parent = this; + }; + InterfaceDeclarationSyntax.prototype.kind = SyntaxKind.InterfaceDeclaration; + InterfaceDeclarationSyntax.prototype.childCount = 6; + InterfaceDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.interfaceKeyword; + case 2: return this.identifier; + case 3: return this.typeParameterList; + case 4: return this.heritageClauses; + case 5: return this.body; + } + } + + export var FunctionDeclarationSyntax: FunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.functionKeyword = functionKeyword, + this.asterixToken = asterixToken, + this.identifier = identifier, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + functionKeyword.parent = this, + asterixToken && (asterixToken.parent = this), + identifier.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + FunctionDeclarationSyntax.prototype.kind = SyntaxKind.FunctionDeclaration; + FunctionDeclarationSyntax.prototype.childCount = 6; + FunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.functionKeyword; + case 2: return this.asterixToken; + case 3: return this.identifier; + case 4: return this.callSignature; + case 5: return this.body; + } + } + + export var ModuleDeclarationSyntax: ModuleDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.moduleKeyword = moduleKeyword, + this.name = name, + this.openBraceToken = openBraceToken, + this.moduleElements = moduleElements, + this.closeBraceToken = closeBraceToken, + modifiers.parent = this, + moduleKeyword.parent = this, + name.parent = this, + openBraceToken.parent = this, + moduleElements.parent = this, + closeBraceToken.parent = this; + }; + ModuleDeclarationSyntax.prototype.kind = SyntaxKind.ModuleDeclaration; + ModuleDeclarationSyntax.prototype.childCount = 6; + ModuleDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.moduleKeyword; + case 2: return this.name; + case 3: return this.openBraceToken; + case 4: return this.moduleElements; + case 5: return this.closeBraceToken; + } + } + + export var ClassDeclarationSyntax: ClassDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.classKeyword = classKeyword, + this.identifier = identifier, + this.typeParameterList = typeParameterList, + this.heritageClauses = heritageClauses, + this.openBraceToken = openBraceToken, + this.classElements = classElements, + this.closeBraceToken = closeBraceToken, + modifiers.parent = this, + classKeyword.parent = this, + identifier.parent = this, + typeParameterList && (typeParameterList.parent = this), + heritageClauses.parent = this, + openBraceToken.parent = this, + classElements.parent = this, + closeBraceToken.parent = this; + }; + ClassDeclarationSyntax.prototype.kind = SyntaxKind.ClassDeclaration; + ClassDeclarationSyntax.prototype.childCount = 8; + ClassDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.classKeyword; + case 2: return this.identifier; + case 3: return this.typeParameterList; + case 4: return this.heritageClauses; + case 5: return this.openBraceToken; + case 6: return this.classElements; + case 7: return this.closeBraceToken; + } + } + + export var EnumDeclarationSyntax: EnumDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.enumKeyword = enumKeyword, + this.identifier = identifier, + this.openBraceToken = openBraceToken, + this.enumElements = enumElements, + this.closeBraceToken = closeBraceToken, + modifiers.parent = this, + enumKeyword.parent = this, + identifier.parent = this, + openBraceToken.parent = this, + enumElements.parent = this, + closeBraceToken.parent = this; + }; + EnumDeclarationSyntax.prototype.kind = SyntaxKind.EnumDeclaration; + EnumDeclarationSyntax.prototype.childCount = 6; + EnumDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.enumKeyword; + case 2: return this.identifier; + case 3: return this.openBraceToken; + case 4: return this.enumElements; + case 5: return this.closeBraceToken; + } + } + + export var ImportDeclarationSyntax: ImportDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.importKeyword = importKeyword, + this.identifier = identifier, + this.equalsToken = equalsToken, + this.moduleReference = moduleReference, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + importKeyword.parent = this, + identifier.parent = this, + equalsToken.parent = this, + moduleReference.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ImportDeclarationSyntax.prototype.kind = SyntaxKind.ImportDeclaration; + ImportDeclarationSyntax.prototype.childCount = 6; + ImportDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.importKeyword; + case 2: return this.identifier; + case 3: return this.equalsToken; + case 4: return this.moduleReference; + case 5: return this.semicolonToken; + } + } + + export var ExportAssignmentSyntax: ExportAssignmentConstructor = function(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.exportKeyword = exportKeyword, + this.equalsToken = equalsToken, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + exportKeyword.parent = this, + equalsToken.parent = this, + identifier.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ExportAssignmentSyntax.prototype.kind = SyntaxKind.ExportAssignment; + ExportAssignmentSyntax.prototype.childCount = 4; + ExportAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.exportKeyword; + case 1: return this.equalsToken; + case 2: return this.identifier; + case 3: return this.semicolonToken; + } + } + + export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.asterixToken = asterixToken, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + asterixToken && (asterixToken.parent = this), + propertyName.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + MemberFunctionDeclarationSyntax.prototype.kind = SyntaxKind.MemberFunctionDeclaration; + MemberFunctionDeclarationSyntax.prototype.childCount = 5; + MemberFunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.asterixToken; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.body; + } + } + + export var MemberVariableDeclarationSyntax: MemberVariableDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.variableDeclarator = variableDeclarator, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + variableDeclarator.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + MemberVariableDeclarationSyntax.prototype.kind = SyntaxKind.MemberVariableDeclaration; + MemberVariableDeclarationSyntax.prototype.childCount = 3; + MemberVariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.variableDeclarator; + case 2: return this.semicolonToken; + } + } + + export var ConstructorDeclarationSyntax: ConstructorDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.constructorKeyword = constructorKeyword, + this.callSignature = callSignature, + this.body = body, + modifiers.parent = this, + constructorKeyword.parent = this, + callSignature.parent = this, + body && (body.parent = this); + }; + ConstructorDeclarationSyntax.prototype.kind = SyntaxKind.ConstructorDeclaration; + ConstructorDeclarationSyntax.prototype.childCount = 4; + ConstructorDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.constructorKeyword; + case 2: return this.callSignature; + case 3: return this.body; + } + } + + export var IndexMemberDeclarationSyntax: IndexMemberDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.indexSignature = indexSignature, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + indexSignature.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + IndexMemberDeclarationSyntax.prototype.kind = SyntaxKind.IndexMemberDeclaration; + IndexMemberDeclarationSyntax.prototype.childCount = 3; + IndexMemberDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.indexSignature; + case 2: return this.semicolonToken; + } + } + + export var GetAccessorSyntax: GetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.getKeyword = getKeyword, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.block = block, + modifiers.parent = this, + getKeyword.parent = this, + propertyName.parent = this, + callSignature.parent = this, + block.parent = this; + }; + GetAccessorSyntax.prototype.kind = SyntaxKind.GetAccessor; + GetAccessorSyntax.prototype.childCount = 5; + GetAccessorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.getKeyword; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.block; + } + } + + export var SetAccessorSyntax: SetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.setKeyword = setKeyword, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.block = block, + modifiers.parent = this, + setKeyword.parent = this, + propertyName.parent = this, + callSignature.parent = this, + block.parent = this; + }; + SetAccessorSyntax.prototype.kind = SyntaxKind.SetAccessor; + SetAccessorSyntax.prototype.childCount = 5; + SetAccessorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.setKeyword; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.block; + } + } + + export var PropertySignatureSyntax: PropertySignatureConstructor = function(data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.questionToken = questionToken, + this.typeAnnotation = typeAnnotation, + propertyName.parent = this, + questionToken && (questionToken.parent = this), + typeAnnotation && (typeAnnotation.parent = this); + }; + PropertySignatureSyntax.prototype.kind = SyntaxKind.PropertySignature; + PropertySignatureSyntax.prototype.childCount = 3; + PropertySignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.questionToken; + case 2: return this.typeAnnotation; + } + } + + export var CallSignatureSyntax: CallSignatureConstructor = function(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { + if (data) { this.__data = data; } + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.typeAnnotation = typeAnnotation, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + typeAnnotation && (typeAnnotation.parent = this); + }; + CallSignatureSyntax.prototype.kind = SyntaxKind.CallSignature; + CallSignatureSyntax.prototype.childCount = 3; + CallSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeParameterList; + case 1: return this.parameterList; + case 2: return this.typeAnnotation; + } + } + + export var ConstructSignatureSyntax: ConstructSignatureConstructor = function(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { + if (data) { this.__data = data; } + this.newKeyword = newKeyword, + this.callSignature = callSignature, + newKeyword.parent = this, + callSignature.parent = this; + }; + ConstructSignatureSyntax.prototype.kind = SyntaxKind.ConstructSignature; + ConstructSignatureSyntax.prototype.childCount = 2; + ConstructSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.callSignature; + } + } + + export var IndexSignatureSyntax: IndexSignatureConstructor = function(data: number, openBracketToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.parameters = parameters, + this.closeBracketToken = closeBracketToken, + this.typeAnnotation = typeAnnotation, + openBracketToken.parent = this, + parameters.parent = this, + closeBracketToken.parent = this, + typeAnnotation && (typeAnnotation.parent = this); + }; + IndexSignatureSyntax.prototype.kind = SyntaxKind.IndexSignature; + IndexSignatureSyntax.prototype.childCount = 4; + IndexSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.parameters; + case 2: return this.closeBracketToken; + case 3: return this.typeAnnotation; + } + } + + export var MethodSignatureSyntax: MethodSignatureConstructor = function(data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.questionToken = questionToken, + this.callSignature = callSignature, + propertyName.parent = this, + questionToken && (questionToken.parent = this), + callSignature.parent = this; + }; + MethodSignatureSyntax.prototype.kind = SyntaxKind.MethodSignature; + MethodSignatureSyntax.prototype.childCount = 3; + MethodSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.questionToken; + case 2: return this.callSignature; + } + } + + export var BlockSyntax: BlockConstructor = function(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBraceToken = openBraceToken, + this.statements = statements, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + statements.parent = this, + closeBraceToken.parent = this; + }; + BlockSyntax.prototype.kind = SyntaxKind.Block; + BlockSyntax.prototype.childCount = 3; + BlockSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.statements; + case 2: return this.closeBraceToken; + } + } + + export var IfStatementSyntax: IfStatementConstructor = function(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { + if (data) { this.__data = data; } + this.ifKeyword = ifKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.statement = statement, + this.elseClause = elseClause, + ifKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + statement.parent = this, + elseClause && (elseClause.parent = this); + }; + IfStatementSyntax.prototype.kind = SyntaxKind.IfStatement; + IfStatementSyntax.prototype.childCount = 6; + IfStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.ifKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + case 5: return this.elseClause; + } + } + + export var VariableStatementSyntax: VariableStatementConstructor = function(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.modifiers = modifiers, + this.variableDeclaration = variableDeclaration, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + variableDeclaration.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + VariableStatementSyntax.prototype.kind = SyntaxKind.VariableStatement; + VariableStatementSyntax.prototype.childCount = 3; + VariableStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.variableDeclaration; + case 2: return this.semicolonToken; + } + } + + export var ExpressionStatementSyntax: ExpressionStatementConstructor = function(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.semicolonToken = semicolonToken, + expression.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ExpressionStatementSyntax.prototype.kind = SyntaxKind.ExpressionStatement; + ExpressionStatementSyntax.prototype.childCount = 2; + ExpressionStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.semicolonToken; + } + } + + export var ReturnStatementSyntax: ReturnStatementConstructor = function(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.returnKeyword = returnKeyword, + this.expression = expression, + this.semicolonToken = semicolonToken, + returnKeyword.parent = this, + expression && (expression.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + ReturnStatementSyntax.prototype.kind = SyntaxKind.ReturnStatement; + ReturnStatementSyntax.prototype.childCount = 3; + ReturnStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.returnKeyword; + case 1: return this.expression; + case 2: return this.semicolonToken; + } + } + + export var SwitchStatementSyntax: SwitchStatementConstructor = function(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.switchKeyword = switchKeyword, + this.openParenToken = openParenToken, + this.expression = expression, + this.closeParenToken = closeParenToken, + this.openBraceToken = openBraceToken, + this.switchClauses = switchClauses, + this.closeBraceToken = closeBraceToken, + switchKeyword.parent = this, + openParenToken.parent = this, + expression.parent = this, + closeParenToken.parent = this, + openBraceToken.parent = this, + switchClauses.parent = this, + closeBraceToken.parent = this; + }; + SwitchStatementSyntax.prototype.kind = SyntaxKind.SwitchStatement; + SwitchStatementSyntax.prototype.childCount = 7; + SwitchStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.switchKeyword; + case 1: return this.openParenToken; + case 2: return this.expression; + case 3: return this.closeParenToken; + case 4: return this.openBraceToken; + case 5: return this.switchClauses; + case 6: return this.closeBraceToken; + } + } + + export var BreakStatementSyntax: BreakStatementConstructor = function(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.breakKeyword = breakKeyword, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + breakKeyword.parent = this, + identifier && (identifier.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + BreakStatementSyntax.prototype.kind = SyntaxKind.BreakStatement; + BreakStatementSyntax.prototype.childCount = 3; + BreakStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.breakKeyword; + case 1: return this.identifier; + case 2: return this.semicolonToken; + } + } + + export var ContinueStatementSyntax: ContinueStatementConstructor = function(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.continueKeyword = continueKeyword, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + continueKeyword.parent = this, + identifier && (identifier.parent = this), + semicolonToken && (semicolonToken.parent = this); + }; + ContinueStatementSyntax.prototype.kind = SyntaxKind.ContinueStatement; + ContinueStatementSyntax.prototype.childCount = 3; + ContinueStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.continueKeyword; + case 1: return this.identifier; + case 2: return this.semicolonToken; + } + } + + export var ForStatementSyntax: ForStatementConstructor = function(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, initializer: VariableDeclarationSyntax | IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.forKeyword = forKeyword, + this.openParenToken = openParenToken, + this.initializer = initializer, + this.firstSemicolonToken = firstSemicolonToken, + this.condition = condition, + this.secondSemicolonToken = secondSemicolonToken, + this.incrementor = incrementor, + this.closeParenToken = closeParenToken, + this.statement = statement, + forKeyword.parent = this, + openParenToken.parent = this, + initializer && (initializer.parent = this), + firstSemicolonToken.parent = this, + condition && (condition.parent = this), + secondSemicolonToken.parent = this, + incrementor && (incrementor.parent = this), + closeParenToken.parent = this, + statement.parent = this; + }; + ForStatementSyntax.prototype.kind = SyntaxKind.ForStatement; + ForStatementSyntax.prototype.childCount = 9; + ForStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.forKeyword; + case 1: return this.openParenToken; + case 2: return this.initializer; + case 3: return this.firstSemicolonToken; + case 4: return this.condition; + case 5: return this.secondSemicolonToken; + case 6: return this.incrementor; + case 7: return this.closeParenToken; + case 8: return this.statement; + } + } + + export var ForInStatementSyntax: ForInStatementConstructor = function(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, left: VariableDeclarationSyntax | IExpressionSyntax, inKeyword: ISyntaxToken, right: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.forKeyword = forKeyword, + this.openParenToken = openParenToken, + this.left = left, + this.inKeyword = inKeyword, + this.right = right, + this.closeParenToken = closeParenToken, + this.statement = statement, + forKeyword.parent = this, + openParenToken.parent = this, + left.parent = this, + inKeyword.parent = this, + right.parent = this, + closeParenToken.parent = this, + statement.parent = this; + }; + ForInStatementSyntax.prototype.kind = SyntaxKind.ForInStatement; + ForInStatementSyntax.prototype.childCount = 7; + ForInStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.forKeyword; + case 1: return this.openParenToken; + case 2: return this.left; + case 3: return this.inKeyword; + case 4: return this.right; + case 5: return this.closeParenToken; + case 6: return this.statement; + } + } + + export var EmptyStatementSyntax: EmptyStatementConstructor = function(data: number, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.semicolonToken = semicolonToken, + semicolonToken.parent = this; + }; + EmptyStatementSyntax.prototype.kind = SyntaxKind.EmptyStatement; + EmptyStatementSyntax.prototype.childCount = 1; + EmptyStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.semicolonToken; + } + } + + export var ThrowStatementSyntax: ThrowStatementConstructor = function(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.throwKeyword = throwKeyword, + this.expression = expression, + this.semicolonToken = semicolonToken, + throwKeyword.parent = this, + expression.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + ThrowStatementSyntax.prototype.kind = SyntaxKind.ThrowStatement; + ThrowStatementSyntax.prototype.childCount = 3; + ThrowStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.throwKeyword; + case 1: return this.expression; + case 2: return this.semicolonToken; + } + } + + export var WhileStatementSyntax: WhileStatementConstructor = function(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.whileKeyword = whileKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.statement = statement, + whileKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + statement.parent = this; + }; + WhileStatementSyntax.prototype.kind = SyntaxKind.WhileStatement; + WhileStatementSyntax.prototype.childCount = 5; + WhileStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.whileKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + } + } + + export var TryStatementSyntax: TryStatementConstructor = function(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { + if (data) { this.__data = data; } + this.tryKeyword = tryKeyword, + this.block = block, + this.catchClause = catchClause, + this.finallyClause = finallyClause, + tryKeyword.parent = this, + block.parent = this, + catchClause && (catchClause.parent = this), + finallyClause && (finallyClause.parent = this); + }; + TryStatementSyntax.prototype.kind = SyntaxKind.TryStatement; + TryStatementSyntax.prototype.childCount = 4; + TryStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.tryKeyword; + case 1: return this.block; + case 2: return this.catchClause; + case 3: return this.finallyClause; + } + } + + export var LabeledStatementSyntax: LabeledStatementConstructor = function(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.identifier = identifier, + this.colonToken = colonToken, + this.statement = statement, + identifier.parent = this, + colonToken.parent = this, + statement.parent = this; + }; + LabeledStatementSyntax.prototype.kind = SyntaxKind.LabeledStatement; + LabeledStatementSyntax.prototype.childCount = 3; + LabeledStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.identifier; + case 1: return this.colonToken; + case 2: return this.statement; + } + } + + export var DoStatementSyntax: DoStatementConstructor = function(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.doKeyword = doKeyword, + this.statement = statement, + this.whileKeyword = whileKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.semicolonToken = semicolonToken, + doKeyword.parent = this, + statement.parent = this, + whileKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + DoStatementSyntax.prototype.kind = SyntaxKind.DoStatement; + DoStatementSyntax.prototype.childCount = 7; + DoStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.doKeyword; + case 1: return this.statement; + case 2: return this.whileKeyword; + case 3: return this.openParenToken; + case 4: return this.condition; + case 5: return this.closeParenToken; + case 6: return this.semicolonToken; + } + } + + export var DebuggerStatementSyntax: DebuggerStatementConstructor = function(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.debuggerKeyword = debuggerKeyword, + this.semicolonToken = semicolonToken, + debuggerKeyword.parent = this, + semicolonToken && (semicolonToken.parent = this); + }; + DebuggerStatementSyntax.prototype.kind = SyntaxKind.DebuggerStatement; + DebuggerStatementSyntax.prototype.childCount = 2; + DebuggerStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.debuggerKeyword; + case 1: return this.semicolonToken; + } + } + + export var WithStatementSyntax: WithStatementConstructor = function(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.withKeyword = withKeyword, + this.openParenToken = openParenToken, + this.condition = condition, + this.closeParenToken = closeParenToken, + this.statement = statement, + withKeyword.parent = this, + openParenToken.parent = this, + condition.parent = this, + closeParenToken.parent = this, + statement.parent = this; + }; + WithStatementSyntax.prototype.kind = SyntaxKind.WithStatement; + WithStatementSyntax.prototype.childCount = 5; + WithStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.withKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + } + } + + export var PrefixUnaryExpressionSyntax: PrefixUnaryExpressionConstructor = function(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.operatorToken = operatorToken, + this.operand = operand, + operatorToken.parent = this, + operand.parent = this; + }; + PrefixUnaryExpressionSyntax.prototype.kind = SyntaxKind.PrefixUnaryExpression; + PrefixUnaryExpressionSyntax.prototype.childCount = 2; + PrefixUnaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.operatorToken; + case 1: return this.operand; + } + } + + export var DeleteExpressionSyntax: DeleteExpressionConstructor = function(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.deleteKeyword = deleteKeyword, + this.expression = expression, + deleteKeyword.parent = this, + expression.parent = this; + }; + DeleteExpressionSyntax.prototype.kind = SyntaxKind.DeleteExpression; + DeleteExpressionSyntax.prototype.childCount = 2; + DeleteExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.deleteKeyword; + case 1: return this.expression; + } + } + + export var TypeOfExpressionSyntax: TypeOfExpressionConstructor = function(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.typeOfKeyword = typeOfKeyword, + this.expression = expression, + typeOfKeyword.parent = this, + expression.parent = this; + }; + TypeOfExpressionSyntax.prototype.kind = SyntaxKind.TypeOfExpression; + TypeOfExpressionSyntax.prototype.childCount = 2; + TypeOfExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeOfKeyword; + case 1: return this.expression; + } + } + + export var VoidExpressionSyntax: VoidExpressionConstructor = function(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.voidKeyword = voidKeyword, + this.expression = expression, + voidKeyword.parent = this, + expression.parent = this; + }; + VoidExpressionSyntax.prototype.kind = SyntaxKind.VoidExpression; + VoidExpressionSyntax.prototype.childCount = 2; + VoidExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.voidKeyword; + case 1: return this.expression; + } + } + + export var ConditionalExpressionSyntax: ConditionalExpressionConstructor = function(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { + if (data) { this.__data = data; } + this.condition = condition, + this.questionToken = questionToken, + this.whenTrue = whenTrue, + this.colonToken = colonToken, + this.whenFalse = whenFalse, + condition.parent = this, + questionToken.parent = this, + whenTrue.parent = this, + colonToken.parent = this, + whenFalse.parent = this; + }; + ConditionalExpressionSyntax.prototype.kind = SyntaxKind.ConditionalExpression; + ConditionalExpressionSyntax.prototype.childCount = 5; + ConditionalExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.condition; + case 1: return this.questionToken; + case 2: return this.whenTrue; + case 3: return this.colonToken; + case 4: return this.whenFalse; + } + } + + export var BinaryExpressionSyntax: BinaryExpressionConstructor = function(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { + if (data) { this.__data = data; } + this.left = left, + this.operatorToken = operatorToken, + this.right = right, + left.parent = this, + operatorToken.parent = this, + right.parent = this; + }; + BinaryExpressionSyntax.prototype.kind = SyntaxKind.BinaryExpression; + BinaryExpressionSyntax.prototype.childCount = 3; + BinaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.operatorToken; + case 2: return this.right; + } + } + + export var PostfixUnaryExpressionSyntax: PostfixUnaryExpressionConstructor = function(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.operand = operand, + this.operatorToken = operatorToken, + operand.parent = this, + operatorToken.parent = this; + }; + PostfixUnaryExpressionSyntax.prototype.kind = SyntaxKind.PostfixUnaryExpression; + PostfixUnaryExpressionSyntax.prototype.childCount = 2; + PostfixUnaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.operand; + case 1: return this.operatorToken; + } + } + + export var MemberAccessExpressionSyntax: MemberAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.dotToken = dotToken, + this.name = name, + expression.parent = this, + dotToken.parent = this, + name.parent = this; + }; + MemberAccessExpressionSyntax.prototype.kind = SyntaxKind.MemberAccessExpression; + MemberAccessExpressionSyntax.prototype.childCount = 3; + MemberAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.dotToken; + case 2: return this.name; + } + } + + export var InvocationExpressionSyntax: InvocationExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { + if (data) { this.__data = data; } + this.expression = expression, + this.argumentList = argumentList, + expression.parent = this, + argumentList.parent = this; + }; + InvocationExpressionSyntax.prototype.kind = SyntaxKind.InvocationExpression; + InvocationExpressionSyntax.prototype.childCount = 2; + InvocationExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.argumentList; + } + } + + export var ArrayLiteralExpressionSyntax: ArrayLiteralExpressionConstructor = function(data: number, openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.expressions = expressions, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + expressions.parent = this, + closeBracketToken.parent = this; + }; + ArrayLiteralExpressionSyntax.prototype.kind = SyntaxKind.ArrayLiteralExpression; + ArrayLiteralExpressionSyntax.prototype.childCount = 3; + ArrayLiteralExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.expressions; + case 2: return this.closeBracketToken; + } + } + + export var ObjectLiteralExpressionSyntax: ObjectLiteralExpressionConstructor = function(data: number, openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBraceToken = openBraceToken, + this.propertyAssignments = propertyAssignments, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + propertyAssignments.parent = this, + closeBraceToken.parent = this; + }; + ObjectLiteralExpressionSyntax.prototype.kind = SyntaxKind.ObjectLiteralExpression; + ObjectLiteralExpressionSyntax.prototype.childCount = 3; + ObjectLiteralExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.propertyAssignments; + case 2: return this.closeBraceToken; + } + } + + export var ObjectCreationExpressionSyntax: ObjectCreationExpressionConstructor = function(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { + if (data) { this.__data = data; } + this.newKeyword = newKeyword, + this.expression = expression, + this.argumentList = argumentList, + newKeyword.parent = this, + expression.parent = this, + argumentList && (argumentList.parent = this); + }; + ObjectCreationExpressionSyntax.prototype.kind = SyntaxKind.ObjectCreationExpression; + ObjectCreationExpressionSyntax.prototype.childCount = 3; + ObjectCreationExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.expression; + case 2: return this.argumentList; + } + } + + export var ParenthesizedExpressionSyntax: ParenthesizedExpressionConstructor = function(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openParenToken = openParenToken, + this.expression = expression, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + expression.parent = this, + closeParenToken.parent = this; + }; + ParenthesizedExpressionSyntax.prototype.kind = SyntaxKind.ParenthesizedExpression; + ParenthesizedExpressionSyntax.prototype.childCount = 3; + ParenthesizedExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.expression; + case 2: return this.closeParenToken; + } + } + + export var ParenthesizedArrowFunctionExpressionSyntax: ParenthesizedArrowFunctionExpressionConstructor = function(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax) { + if (data) { this.__data = data; } + this.callSignature = callSignature, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.body = body, + callSignature.parent = this, + equalsGreaterThanToken.parent = this, + body.parent = this; + }; + ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = SyntaxKind.ParenthesizedArrowFunctionExpression; + ParenthesizedArrowFunctionExpressionSyntax.prototype.childCount = 3; + ParenthesizedArrowFunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.callSignature; + case 1: return this.equalsGreaterThanToken; + case 2: return this.body; + } + } + + export var SimpleArrowFunctionExpressionSyntax: SimpleArrowFunctionExpressionConstructor = function(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, body: BlockSyntax | IExpressionSyntax) { + if (data) { this.__data = data; } + this.parameter = parameter, + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.body = body, + parameter.parent = this, + equalsGreaterThanToken.parent = this, + body.parent = this; + }; + SimpleArrowFunctionExpressionSyntax.prototype.kind = SyntaxKind.SimpleArrowFunctionExpression; + SimpleArrowFunctionExpressionSyntax.prototype.childCount = 3; + SimpleArrowFunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.parameter; + case 1: return this.equalsGreaterThanToken; + case 2: return this.body; + } + } + + export var CastExpressionSyntax: CastExpressionConstructor = function(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { + if (data) { this.__data = data; } + this.lessThanToken = lessThanToken, + this.type = type, + this.greaterThanToken = greaterThanToken, + this.expression = expression, + lessThanToken.parent = this, + type.parent = this, + greaterThanToken.parent = this, + expression.parent = this; + }; + CastExpressionSyntax.prototype.kind = SyntaxKind.CastExpression; + CastExpressionSyntax.prototype.childCount = 4; + CastExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.type; + case 2: return this.greaterThanToken; + case 3: return this.expression; + } + } + + export var ElementAccessExpressionSyntax: ElementAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.openBracketToken = openBracketToken, + this.argumentExpression = argumentExpression, + this.closeBracketToken = closeBracketToken, + expression.parent = this, + openBracketToken.parent = this, + argumentExpression.parent = this, + closeBracketToken.parent = this; + }; + ElementAccessExpressionSyntax.prototype.kind = SyntaxKind.ElementAccessExpression; + ElementAccessExpressionSyntax.prototype.childCount = 4; + ElementAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.openBracketToken; + case 2: return this.argumentExpression; + case 3: return this.closeBracketToken; + } + } + + export var FunctionExpressionSyntax: FunctionExpressionConstructor = function(data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { + if (data) { this.__data = data; } + this.functionKeyword = functionKeyword, + this.asterixToken = asterixToken, + this.identifier = identifier, + this.callSignature = callSignature, + this.block = block, + functionKeyword.parent = this, + asterixToken && (asterixToken.parent = this), + identifier && (identifier.parent = this), + callSignature.parent = this, + block.parent = this; + }; + FunctionExpressionSyntax.prototype.kind = SyntaxKind.FunctionExpression; + FunctionExpressionSyntax.prototype.childCount = 5; + FunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.functionKeyword; + case 1: return this.asterixToken; + case 2: return this.identifier; + case 3: return this.callSignature; + case 4: return this.block; + } + } + + export var OmittedExpressionSyntax: OmittedExpressionConstructor = function(data: number) { + if (data) { this.__data = data; } + }; + OmittedExpressionSyntax.prototype.kind = SyntaxKind.OmittedExpression; + OmittedExpressionSyntax.prototype.childCount = 0; + OmittedExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + throw Errors.invalidOperation(); + } + + export var TemplateExpressionSyntax: TemplateExpressionConstructor = function(data: number, templateStartToken: ISyntaxToken, templateClauses: TemplateClauseSyntax[]) { + if (data) { this.__data = data; } + this.templateStartToken = templateStartToken, + this.templateClauses = templateClauses, + templateStartToken.parent = this, + templateClauses.parent = this; + }; + TemplateExpressionSyntax.prototype.kind = SyntaxKind.TemplateExpression; + TemplateExpressionSyntax.prototype.childCount = 2; + TemplateExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.templateStartToken; + case 1: return this.templateClauses; + } + } + + export var TemplateAccessExpressionSyntax: TemplateAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, templateExpression: IPrimaryExpressionSyntax) { + if (data) { this.__data = data; } + this.expression = expression, + this.templateExpression = templateExpression, + expression.parent = this, + templateExpression.parent = this; + }; + TemplateAccessExpressionSyntax.prototype.kind = SyntaxKind.TemplateAccessExpression; + TemplateAccessExpressionSyntax.prototype.childCount = 2; + TemplateAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.templateExpression; + } + } + + export var YieldExpressionSyntax: YieldExpressionConstructor = function(data: number, yieldKeyword: ISyntaxToken, asterixToken: ISyntaxToken, expression: IExpressionSyntax) { + if (data) { this.__data = data; } + this.yieldKeyword = yieldKeyword, + this.asterixToken = asterixToken, + this.expression = expression, + yieldKeyword.parent = this, + asterixToken && (asterixToken.parent = this), + expression && (expression.parent = this); + }; + YieldExpressionSyntax.prototype.kind = SyntaxKind.YieldExpression; + YieldExpressionSyntax.prototype.childCount = 3; + YieldExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.yieldKeyword; + case 1: return this.asterixToken; + case 2: return this.expression; + } + } + + export var VariableDeclarationSyntax: VariableDeclarationConstructor = function(data: number, varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList) { + if (data) { this.__data = data; } + this.varKeyword = varKeyword, + this.variableDeclarators = variableDeclarators, + varKeyword.parent = this, + variableDeclarators.parent = this; + }; + VariableDeclarationSyntax.prototype.kind = SyntaxKind.VariableDeclaration; + VariableDeclarationSyntax.prototype.childCount = 2; + VariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.varKeyword; + case 1: return this.variableDeclarators; + } + } + + export var VariableDeclaratorSyntax: VariableDeclaratorConstructor = function(data: number, propertyName: IPropertyNameSyntax, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.typeAnnotation = typeAnnotation, + this.equalsValueClause = equalsValueClause, + propertyName.parent = this, + typeAnnotation && (typeAnnotation.parent = this), + equalsValueClause && (equalsValueClause.parent = this); + }; + VariableDeclaratorSyntax.prototype.kind = SyntaxKind.VariableDeclarator; + VariableDeclaratorSyntax.prototype.childCount = 3; + VariableDeclaratorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.typeAnnotation; + case 2: return this.equalsValueClause; + } + } + + export var ArgumentListSyntax: ArgumentListConstructor = function(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.typeArgumentList = typeArgumentList, + this.openParenToken = openParenToken, + this.arguments = _arguments, + this.closeParenToken = closeParenToken, + typeArgumentList && (typeArgumentList.parent = this), + openParenToken.parent = this, + _arguments.parent = this, + closeParenToken.parent = this; + }; + ArgumentListSyntax.prototype.kind = SyntaxKind.ArgumentList; + ArgumentListSyntax.prototype.childCount = 4; + ArgumentListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeArgumentList; + case 1: return this.openParenToken; + case 2: return this.arguments; + case 3: return this.closeParenToken; + } + } + + export var ParameterListSyntax: ParameterListConstructor = function(data: number, openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openParenToken = openParenToken, + this.parameters = parameters, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + parameters.parent = this, + closeParenToken.parent = this; + }; + ParameterListSyntax.prototype.kind = SyntaxKind.ParameterList; + ParameterListSyntax.prototype.childCount = 3; + ParameterListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.parameters; + case 2: return this.closeParenToken; + } + } + + export var TypeArgumentListSyntax: TypeArgumentListConstructor = function(data: number, lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.lessThanToken = lessThanToken, + this.typeArguments = typeArguments, + this.greaterThanToken = greaterThanToken, + lessThanToken.parent = this, + typeArguments.parent = this, + greaterThanToken.parent = this; + }; + TypeArgumentListSyntax.prototype.kind = SyntaxKind.TypeArgumentList; + TypeArgumentListSyntax.prototype.childCount = 3; + TypeArgumentListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.typeArguments; + case 2: return this.greaterThanToken; + } + } + + export var TypeParameterListSyntax: TypeParameterListConstructor = function(data: number, lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.lessThanToken = lessThanToken, + this.typeParameters = typeParameters, + this.greaterThanToken = greaterThanToken, + lessThanToken.parent = this, + typeParameters.parent = this, + greaterThanToken.parent = this; + }; + TypeParameterListSyntax.prototype.kind = SyntaxKind.TypeParameterList; + TypeParameterListSyntax.prototype.childCount = 3; + TypeParameterListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.typeParameters; + case 2: return this.greaterThanToken; + } + } + + export var HeritageClauseSyntax: HeritageClauseConstructor = function(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList) { + if (data) { this.__data = data; } + this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, + this.typeNames = typeNames, + extendsOrImplementsKeyword.parent = this, + typeNames.parent = this; + }; + HeritageClauseSyntax.prototype.kind = SyntaxKind.HeritageClause; + HeritageClauseSyntax.prototype.childCount = 2; + HeritageClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.extendsOrImplementsKeyword; + case 1: return this.typeNames; + } + } + + export var EqualsValueClauseSyntax: EqualsValueClauseConstructor = function(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { + if (data) { this.__data = data; } + this.equalsToken = equalsToken, + this.value = value, + equalsToken.parent = this, + value.parent = this; + }; + EqualsValueClauseSyntax.prototype.kind = SyntaxKind.EqualsValueClause; + EqualsValueClauseSyntax.prototype.childCount = 2; + EqualsValueClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.equalsToken; + case 1: return this.value; + } + } + + export var CaseSwitchClauseSyntax: CaseSwitchClauseConstructor = function(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { + if (data) { this.__data = data; } + this.caseKeyword = caseKeyword, + this.expression = expression, + this.colonToken = colonToken, + this.statements = statements, + caseKeyword.parent = this, + expression.parent = this, + colonToken.parent = this, + statements.parent = this; + }; + CaseSwitchClauseSyntax.prototype.kind = SyntaxKind.CaseSwitchClause; + CaseSwitchClauseSyntax.prototype.childCount = 4; + CaseSwitchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.caseKeyword; + case 1: return this.expression; + case 2: return this.colonToken; + case 3: return this.statements; + } + } + + export var DefaultSwitchClauseSyntax: DefaultSwitchClauseConstructor = function(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { + if (data) { this.__data = data; } + this.defaultKeyword = defaultKeyword, + this.colonToken = colonToken, + this.statements = statements, + defaultKeyword.parent = this, + colonToken.parent = this, + statements.parent = this; + }; + DefaultSwitchClauseSyntax.prototype.kind = SyntaxKind.DefaultSwitchClause; + DefaultSwitchClauseSyntax.prototype.childCount = 3; + DefaultSwitchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.defaultKeyword; + case 1: return this.colonToken; + case 2: return this.statements; + } + } + + export var ElseClauseSyntax: ElseClauseConstructor = function(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { + if (data) { this.__data = data; } + this.elseKeyword = elseKeyword, + this.statement = statement, + elseKeyword.parent = this, + statement.parent = this; + }; + ElseClauseSyntax.prototype.kind = SyntaxKind.ElseClause; + ElseClauseSyntax.prototype.childCount = 2; + ElseClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.elseKeyword; + case 1: return this.statement; + } + } + + export var CatchClauseSyntax: CatchClauseConstructor = function(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { + if (data) { this.__data = data; } + this.catchKeyword = catchKeyword, + this.openParenToken = openParenToken, + this.identifier = identifier, + this.typeAnnotation = typeAnnotation, + this.closeParenToken = closeParenToken, + this.block = block, + catchKeyword.parent = this, + openParenToken.parent = this, + identifier.parent = this, + typeAnnotation && (typeAnnotation.parent = this), + closeParenToken.parent = this, + block.parent = this; + }; + CatchClauseSyntax.prototype.kind = SyntaxKind.CatchClause; + CatchClauseSyntax.prototype.childCount = 6; + CatchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.catchKeyword; + case 1: return this.openParenToken; + case 2: return this.identifier; + case 3: return this.typeAnnotation; + case 4: return this.closeParenToken; + case 5: return this.block; + } + } + + export var FinallyClauseSyntax: FinallyClauseConstructor = function(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { + if (data) { this.__data = data; } + this.finallyKeyword = finallyKeyword, + this.block = block, + finallyKeyword.parent = this, + block.parent = this; + }; + FinallyClauseSyntax.prototype.kind = SyntaxKind.FinallyClause; + FinallyClauseSyntax.prototype.childCount = 2; + FinallyClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.finallyKeyword; + case 1: return this.block; + } + } + + export var TemplateClauseSyntax: TemplateClauseConstructor = function(data: number, expression: IExpressionSyntax, templateMiddleOrEndToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.expression = expression, + this.templateMiddleOrEndToken = templateMiddleOrEndToken, + expression.parent = this, + templateMiddleOrEndToken.parent = this; + }; + TemplateClauseSyntax.prototype.kind = SyntaxKind.TemplateClause; + TemplateClauseSyntax.prototype.childCount = 2; + TemplateClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.templateMiddleOrEndToken; + } + } + + export var TypeParameterSyntax: TypeParameterConstructor = function(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { + if (data) { this.__data = data; } + this.identifier = identifier, + this.constraint = constraint, + identifier.parent = this, + constraint && (constraint.parent = this); + }; + TypeParameterSyntax.prototype.kind = SyntaxKind.TypeParameter; + TypeParameterSyntax.prototype.childCount = 2; + TypeParameterSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.identifier; + case 1: return this.constraint; + } + } + + export var ConstraintSyntax: ConstraintConstructor = function(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { + if (data) { this.__data = data; } + this.extendsKeyword = extendsKeyword, + this.typeOrExpression = typeOrExpression, + extendsKeyword.parent = this, + typeOrExpression.parent = this; + }; + ConstraintSyntax.prototype.kind = SyntaxKind.Constraint; + ConstraintSyntax.prototype.childCount = 2; + ConstraintSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.extendsKeyword; + case 1: return this.typeOrExpression; + } + } + + export var SimplePropertyAssignmentSyntax: SimplePropertyAssignmentConstructor = function(data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.colonToken = colonToken, + this.expression = expression, + propertyName.parent = this, + colonToken.parent = this, + expression.parent = this; + }; + SimplePropertyAssignmentSyntax.prototype.kind = SyntaxKind.SimplePropertyAssignment; + SimplePropertyAssignmentSyntax.prototype.childCount = 3; + SimplePropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.colonToken; + case 2: return this.expression; + } + } + + export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = function(data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { + if (data) { this.__data = data; } + this.asterixToken = asterixToken, + this.propertyName = propertyName, + this.callSignature = callSignature, + this.block = block, + asterixToken && (asterixToken.parent = this), + propertyName.parent = this, + callSignature.parent = this, + block.parent = this; + }; + FunctionPropertyAssignmentSyntax.prototype.kind = SyntaxKind.FunctionPropertyAssignment; + FunctionPropertyAssignmentSyntax.prototype.childCount = 4; + FunctionPropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.asterixToken; + case 1: return this.propertyName; + case 2: return this.callSignature; + case 3: return this.block; + } + } + + export var ParameterSyntax: ParameterConstructor = function(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { + if (data) { this.__data = data; } + this.dotDotDotToken = dotDotDotToken, + this.modifiers = modifiers, + this.identifier = identifier, + this.questionToken = questionToken, + this.typeAnnotation = typeAnnotation, + this.equalsValueClause = equalsValueClause, + dotDotDotToken && (dotDotDotToken.parent = this), + modifiers.parent = this, + identifier.parent = this, + questionToken && (questionToken.parent = this), + typeAnnotation && (typeAnnotation.parent = this), + equalsValueClause && (equalsValueClause.parent = this); + }; + ParameterSyntax.prototype.kind = SyntaxKind.Parameter; + ParameterSyntax.prototype.childCount = 6; + ParameterSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.dotDotDotToken; + case 1: return this.modifiers; + case 2: return this.identifier; + case 3: return this.questionToken; + case 4: return this.typeAnnotation; + case 5: return this.equalsValueClause; + } + } + + export var EnumElementSyntax: EnumElementConstructor = function(data: number, propertyName: IPropertyNameSyntax, equalsValueClause: EqualsValueClauseSyntax) { + if (data) { this.__data = data; } + this.propertyName = propertyName, + this.equalsValueClause = equalsValueClause, + propertyName.parent = this, + equalsValueClause && (equalsValueClause.parent = this); + }; + EnumElementSyntax.prototype.kind = SyntaxKind.EnumElement; + EnumElementSyntax.prototype.childCount = 2; + EnumElementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.equalsValueClause; + } + } + + export var TypeAnnotationSyntax: TypeAnnotationConstructor = function(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { + if (data) { this.__data = data; } + this.colonToken = colonToken, + this.type = type, + colonToken.parent = this, + type.parent = this; + }; + TypeAnnotationSyntax.prototype.kind = SyntaxKind.TypeAnnotation; + TypeAnnotationSyntax.prototype.childCount = 2; + TypeAnnotationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.colonToken; + case 1: return this.type; + } + } + + export var ComputedPropertyNameSyntax: ComputedPropertyNameConstructor = function(data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.expression = expression, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + expression.parent = this, + closeBracketToken.parent = this; + }; + ComputedPropertyNameSyntax.prototype.kind = SyntaxKind.ComputedPropertyName; + ComputedPropertyNameSyntax.prototype.childCount = 3; + ComputedPropertyNameSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.expression; + case 2: return this.closeBracketToken; + } + } + + export var ExternalModuleReferenceSyntax: ExternalModuleReferenceConstructor = function(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.requireKeyword = requireKeyword, + this.openParenToken = openParenToken, + this.stringLiteral = stringLiteral, + this.closeParenToken = closeParenToken, + requireKeyword.parent = this, + openParenToken.parent = this, + stringLiteral.parent = this, + closeParenToken.parent = this; + }; + ExternalModuleReferenceSyntax.prototype.kind = SyntaxKind.ExternalModuleReference; + ExternalModuleReferenceSyntax.prototype.childCount = 4; + ExternalModuleReferenceSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.requireKeyword; + case 1: return this.openParenToken; + case 2: return this.stringLiteral; + case 3: return this.closeParenToken; + } + } + + export var ModuleNameModuleReferenceSyntax: ModuleNameModuleReferenceConstructor = function(data: number, moduleName: INameSyntax) { + if (data) { this.__data = data; } + this.moduleName = moduleName, + moduleName.parent = this; + }; + ModuleNameModuleReferenceSyntax.prototype.kind = SyntaxKind.ModuleNameModuleReference; + ModuleNameModuleReferenceSyntax.prototype.childCount = 1; + ModuleNameModuleReferenceSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.moduleName; + } + } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.interfaces.generated.ts b/src/services/syntax/syntaxNodes.interfaces.generated.ts index 949141ba229..23fe6c40f56 100644 --- a/src/services/syntax/syntaxNodes.interfaces.generated.ts +++ b/src/services/syntax/syntaxNodes.interfaces.generated.ts @@ -13,7 +13,7 @@ module TypeScript { } export interface ObjectTypeSyntax extends ISyntaxNode, ITypeSyntax { openBraceToken: ISyntaxToken; - typeMembers: ITypeMemberSyntax[]; + typeMembers: ISeparatedSyntaxList; closeBraceToken: ISyntaxToken; } export interface FunctionTypeSyntax extends ISyntaxNode, ITypeSyntax { @@ -44,9 +44,19 @@ module TypeScript { } export interface TupleTypeSyntax extends ISyntaxNode, ITypeSyntax { openBracketToken: ISyntaxToken; - types: ITypeSyntax[]; + types: ISeparatedSyntaxList; closeBracketToken: ISyntaxToken; } + export interface UnionTypeSyntax extends ISyntaxNode, ITypeSyntax { + left: ITypeSyntax; + barToken: ISyntaxToken; + right: ITypeSyntax; + } + export interface ParenthesizedTypeSyntax extends ISyntaxNode, ITypeSyntax { + openParenToken: ISyntaxToken; + type: ITypeSyntax; + closeParenToken: ISyntaxToken; + } export interface InterfaceDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { modifiers: ISyntaxToken[]; interfaceKeyword: ISyntaxToken; @@ -87,7 +97,7 @@ module TypeScript { enumKeyword: ISyntaxToken; identifier: ISyntaxToken; openBraceToken: ISyntaxToken; - enumElements: EnumElementSyntax[]; + enumElements: ISeparatedSyntaxList; closeBraceToken: ISyntaxToken; } export interface ImportDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { @@ -158,7 +168,7 @@ module TypeScript { } export interface IndexSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { openBracketToken: ISyntaxToken; - parameters: ParameterSyntax[]; + parameters: ISeparatedSyntaxList; closeBracketToken: ISyntaxToken; typeAnnotation: TypeAnnotationSyntax; } @@ -324,12 +334,12 @@ module TypeScript { } export interface ArrayLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { openBracketToken: ISyntaxToken; - expressions: IExpressionSyntax[]; + expressions: ISeparatedSyntaxList; closeBracketToken: ISyntaxToken; } export interface ObjectLiteralExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { openBraceToken: ISyntaxToken; - propertyAssignments: IPropertyAssignmentSyntax[]; + propertyAssignments: ISeparatedSyntaxList; closeBraceToken: ISyntaxToken; } export interface ObjectCreationExpressionSyntax extends ISyntaxNode, IPrimaryExpressionSyntax { @@ -376,7 +386,7 @@ module TypeScript { } export interface VariableDeclarationSyntax extends ISyntaxNode { varKeyword: ISyntaxToken; - variableDeclarators: VariableDeclaratorSyntax[]; + variableDeclarators: ISeparatedSyntaxList; } export interface VariableDeclaratorSyntax extends ISyntaxNode { propertyName: ISyntaxToken; @@ -386,27 +396,27 @@ module TypeScript { export interface ArgumentListSyntax extends ISyntaxNode { typeArgumentList: TypeArgumentListSyntax; openParenToken: ISyntaxToken; - arguments: IExpressionSyntax[]; + arguments: ISeparatedSyntaxList; closeParenToken: ISyntaxToken; } export interface ParameterListSyntax extends ISyntaxNode { openParenToken: ISyntaxToken; - parameters: ParameterSyntax[]; + parameters: ISeparatedSyntaxList; closeParenToken: ISyntaxToken; } export interface TypeArgumentListSyntax extends ISyntaxNode { lessThanToken: ISyntaxToken; - typeArguments: ITypeSyntax[]; + typeArguments: ISeparatedSyntaxList; greaterThanToken: ISyntaxToken; } export interface TypeParameterListSyntax extends ISyntaxNode { lessThanToken: ISyntaxToken; - typeParameters: TypeParameterSyntax[]; + typeParameters: ISeparatedSyntaxList; greaterThanToken: ISyntaxToken; } export interface HeritageClauseSyntax extends ISyntaxNode { extendsOrImplementsKeyword: ISyntaxToken; - typeNames: INameSyntax[]; + typeNames: ISeparatedSyntaxList; } export interface EqualsValueClauseSyntax extends ISyntaxNode { equalsToken: ISyntaxToken; @@ -482,98 +492,4 @@ module TypeScript { export interface ModuleNameModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { moduleName: INameSyntax; } - - export var nodeMetadata: string[][] = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],["moduleElements","endOfFileToken"],["left","dotToken","right"],["openBraceToken","typeMembers","closeBraceToken"],["typeParameterList","parameterList","equalsGreaterThanToken","type"],["type","openBracketToken","closeBracketToken"],["newKeyword","typeParameterList","parameterList","equalsGreaterThanToken","type"],["name","typeArgumentList"],["typeOfKeyword","name"],["openBracketToken","types","closeBracketToken"],["modifiers","interfaceKeyword","identifier","typeParameterList","heritageClauses","body"],["modifiers","functionKeyword","identifier","callSignature","block","semicolonToken"],["modifiers","moduleKeyword","name","stringLiteral","openBraceToken","moduleElements","closeBraceToken"],["modifiers","classKeyword","identifier","typeParameterList","heritageClauses","openBraceToken","classElements","closeBraceToken"],["modifiers","enumKeyword","identifier","openBraceToken","enumElements","closeBraceToken"],["modifiers","importKeyword","identifier","equalsToken","moduleReference","semicolonToken"],["exportKeyword","equalsToken","identifier","semicolonToken"],["modifiers","propertyName","callSignature","block","semicolonToken"],["modifiers","variableDeclarator","semicolonToken"],["modifiers","constructorKeyword","callSignature","block","semicolonToken"],["modifiers","indexSignature","semicolonToken"],["modifiers","getKeyword","propertyName","callSignature","block"],["modifiers","setKeyword","propertyName","callSignature","block"],["propertyName","questionToken","typeAnnotation"],["typeParameterList","parameterList","typeAnnotation"],["newKeyword","callSignature"],["openBracketToken","parameters","closeBracketToken","typeAnnotation"],["propertyName","questionToken","callSignature"],["openBraceToken","statements","closeBraceToken"],["ifKeyword","openParenToken","condition","closeParenToken","statement","elseClause"],["modifiers","variableDeclaration","semicolonToken"],["expression","semicolonToken"],["returnKeyword","expression","semicolonToken"],["switchKeyword","openParenToken","expression","closeParenToken","openBraceToken","switchClauses","closeBraceToken"],["breakKeyword","identifier","semicolonToken"],["continueKeyword","identifier","semicolonToken"],["forKeyword","openParenToken","variableDeclaration","initializer","firstSemicolonToken","condition","secondSemicolonToken","incrementor","closeParenToken","statement"],["forKeyword","openParenToken","variableDeclaration","left","inKeyword","expression","closeParenToken","statement"],["semicolonToken"],["throwKeyword","expression","semicolonToken"],["whileKeyword","openParenToken","condition","closeParenToken","statement"],["tryKeyword","block","catchClause","finallyClause"],["identifier","colonToken","statement"],["doKeyword","statement","whileKeyword","openParenToken","condition","closeParenToken","semicolonToken"],["debuggerKeyword","semicolonToken"],["withKeyword","openParenToken","condition","closeParenToken","statement"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["operatorToken","operand"],["deleteKeyword","expression"],["typeOfKeyword","expression"],["voidKeyword","expression"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["condition","questionToken","whenTrue","colonToken","whenFalse"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["left","operatorToken","right"],["operand","operatorToken"],["operand","operatorToken"],["expression","dotToken","name"],["expression","argumentList"],["openBracketToken","expressions","closeBracketToken"],["openBraceToken","propertyAssignments","closeBraceToken"],["newKeyword","expression","argumentList"],["openParenToken","expression","closeParenToken"],["callSignature","equalsGreaterThanToken","block","expression"],["parameter","equalsGreaterThanToken","block","expression"],["lessThanToken","type","greaterThanToken","expression"],["expression","openBracketToken","argumentExpression","closeBracketToken"],["functionKeyword","identifier","callSignature","block"],[],["varKeyword","variableDeclarators"],["propertyName","typeAnnotation","equalsValueClause"],["typeArgumentList","openParenToken","arguments","closeParenToken"],["openParenToken","parameters","closeParenToken"],["lessThanToken","typeArguments","greaterThanToken"],["lessThanToken","typeParameters","greaterThanToken"],["extendsOrImplementsKeyword","typeNames"],["extendsOrImplementsKeyword","typeNames"],["equalsToken","value"],["caseKeyword","expression","colonToken","statements"],["defaultKeyword","colonToken","statements"],["elseKeyword","statement"],["catchKeyword","openParenToken","identifier","typeAnnotation","closeParenToken","block"],["finallyKeyword","block"],["identifier","constraint"],["extendsKeyword","typeOrExpression"],["propertyName","colonToken","expression"],["propertyName","callSignature","block"],["dotDotDotToken","modifiers","identifier","questionToken","typeAnnotation","equalsValueClause"],["propertyName","equalsValueClause"],["colonToken","type"],["requireKeyword","openParenToken","stringLiteral","closeParenToken"],["moduleName"],]; - - export module Syntax { - export interface ISyntaxFactory { - isConcrete: boolean; - SourceUnitSyntax: { new(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken): SourceUnitSyntax }; - QualifiedNameSyntax: { new(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken): QualifiedNameSyntax }; - ObjectTypeSyntax: { new(data: number, openBraceToken: ISyntaxToken, typeMembers: ITypeMemberSyntax[], closeBraceToken: ISyntaxToken): ObjectTypeSyntax }; - FunctionTypeSyntax: { new(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): FunctionTypeSyntax }; - ArrayTypeSyntax: { new(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken): ArrayTypeSyntax }; - ConstructorTypeSyntax: { new(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax): ConstructorTypeSyntax }; - GenericTypeSyntax: { new(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax): GenericTypeSyntax }; - TypeQuerySyntax: { new(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax): TypeQuerySyntax }; - TupleTypeSyntax: { new(data: number, openBracketToken: ISyntaxToken, types: ITypeSyntax[], closeBracketToken: ISyntaxToken): TupleTypeSyntax }; - InterfaceDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax): InterfaceDeclarationSyntax }; - FunctionDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): FunctionDeclarationSyntax }; - ModuleDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken): ModuleDeclarationSyntax }; - ClassDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken): ClassDeclarationSyntax }; - EnumDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: EnumElementSyntax[], closeBraceToken: ISyntaxToken): EnumDeclarationSyntax }; - ImportDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken): ImportDeclarationSyntax }; - ExportAssignmentSyntax: { new(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax }; - MemberFunctionDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax }; - MemberVariableDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax }; - ConstructorDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): ConstructorDeclarationSyntax }; - IndexMemberDeclarationSyntax: { new(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax }; - GetAccessorSyntax: { new(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): GetAccessorSyntax }; - SetAccessorSyntax: { new(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): SetAccessorSyntax }; - PropertySignatureSyntax: { new(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax }; - CallSignatureSyntax: { new(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax): CallSignatureSyntax }; - ConstructSignatureSyntax: { new(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax): ConstructSignatureSyntax }; - IndexSignatureSyntax: { new(data: number, openBracketToken: ISyntaxToken, parameters: ParameterSyntax[], closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax }; - MethodSignatureSyntax: { new(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax }; - BlockSyntax: { new(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken): BlockSyntax }; - IfStatementSyntax: { new(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax): IfStatementSyntax }; - VariableStatementSyntax: { new(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken): VariableStatementSyntax }; - ExpressionStatementSyntax: { new(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ExpressionStatementSyntax }; - ReturnStatementSyntax: { new(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ReturnStatementSyntax }; - SwitchStatementSyntax: { new(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken): SwitchStatementSyntax }; - BreakStatementSyntax: { new(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): BreakStatementSyntax }; - ContinueStatementSyntax: { new(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ContinueStatementSyntax }; - ForStatementSyntax: { new(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForStatementSyntax }; - ForInStatementSyntax: { new(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): ForInStatementSyntax }; - EmptyStatementSyntax: { new(data: number, semicolonToken: ISyntaxToken): EmptyStatementSyntax }; - ThrowStatementSyntax: { new(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken): ThrowStatementSyntax }; - WhileStatementSyntax: { new(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WhileStatementSyntax }; - TryStatementSyntax: { new(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax): TryStatementSyntax }; - LabeledStatementSyntax: { new(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax): LabeledStatementSyntax }; - DoStatementSyntax: { new(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken): DoStatementSyntax }; - DebuggerStatementSyntax: { new(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken): DebuggerStatementSyntax }; - WithStatementSyntax: { new(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax): WithStatementSyntax }; - PrefixUnaryExpressionSyntax: { new(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax): PrefixUnaryExpressionSyntax }; - DeleteExpressionSyntax: { new(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): DeleteExpressionSyntax }; - TypeOfExpressionSyntax: { new(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): TypeOfExpressionSyntax }; - VoidExpressionSyntax: { new(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): VoidExpressionSyntax }; - ConditionalExpressionSyntax: { new(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax): ConditionalExpressionSyntax }; - BinaryExpressionSyntax: { new(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax): BinaryExpressionSyntax }; - PostfixUnaryExpressionSyntax: { new(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax }; - MemberAccessExpressionSyntax: { new(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax }; - InvocationExpressionSyntax: { new(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax): InvocationExpressionSyntax }; - ArrayLiteralExpressionSyntax: { new(data: number, openBracketToken: ISyntaxToken, expressions: IExpressionSyntax[], closeBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax }; - ObjectLiteralExpressionSyntax: { new(data: number, openBraceToken: ISyntaxToken, propertyAssignments: IPropertyAssignmentSyntax[], closeBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax }; - ObjectCreationExpressionSyntax: { new(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax): ObjectCreationExpressionSyntax }; - ParenthesizedExpressionSyntax: { new(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken): ParenthesizedExpressionSyntax }; - ParenthesizedArrowFunctionExpressionSyntax: { new(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): ParenthesizedArrowFunctionExpressionSyntax }; - SimpleArrowFunctionExpressionSyntax: { new(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax): SimpleArrowFunctionExpressionSyntax }; - CastExpressionSyntax: { new(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax): CastExpressionSyntax }; - ElementAccessExpressionSyntax: { new(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ElementAccessExpressionSyntax }; - FunctionExpressionSyntax: { new(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax }; - OmittedExpressionSyntax: { new(data: number): OmittedExpressionSyntax }; - VariableDeclarationSyntax: { new(data: number, varKeyword: ISyntaxToken, variableDeclarators: VariableDeclaratorSyntax[]): VariableDeclarationSyntax }; - VariableDeclaratorSyntax: { new(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax }; - ArgumentListSyntax: { new(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, arguments: IExpressionSyntax[], closeParenToken: ISyntaxToken): ArgumentListSyntax }; - ParameterListSyntax: { new(data: number, openParenToken: ISyntaxToken, parameters: ParameterSyntax[], closeParenToken: ISyntaxToken): ParameterListSyntax }; - TypeArgumentListSyntax: { new(data: number, lessThanToken: ISyntaxToken, typeArguments: ITypeSyntax[], greaterThanToken: ISyntaxToken): TypeArgumentListSyntax }; - TypeParameterListSyntax: { new(data: number, lessThanToken: ISyntaxToken, typeParameters: TypeParameterSyntax[], greaterThanToken: ISyntaxToken): TypeParameterListSyntax }; - HeritageClauseSyntax: { new(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: INameSyntax[]): HeritageClauseSyntax }; - EqualsValueClauseSyntax: { new(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax): EqualsValueClauseSyntax }; - CaseSwitchClauseSyntax: { new(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]): CaseSwitchClauseSyntax }; - DefaultSwitchClauseSyntax: { new(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]): DefaultSwitchClauseSyntax }; - ElseClauseSyntax: { new(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax): ElseClauseSyntax }; - CatchClauseSyntax: { new(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax): CatchClauseSyntax }; - FinallyClauseSyntax: { new(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax): FinallyClauseSyntax }; - TypeParameterSyntax: { new(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax): TypeParameterSyntax }; - ConstraintSyntax: { new(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken): ConstraintSyntax }; - SimplePropertyAssignmentSyntax: { new(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax }; - FunctionPropertyAssignmentSyntax: { new(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax }; - ParameterSyntax: { new(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax }; - EnumElementSyntax: { new(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax }; - TypeAnnotationSyntax: { new(data: number, colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax }; - ExternalModuleReferenceSyntax: { new(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken): ExternalModuleReferenceSyntax }; - ModuleNameModuleReferenceSyntax: { new(data: number, moduleName: INameSyntax): ModuleNameModuleReferenceSyntax }; - } - } } \ No newline at end of file diff --git a/src/services/syntax/syntaxToken.ts b/src/services/syntax/syntaxToken.ts index 4f3906e1fe9..6b6854cd08e 100644 --- a/src/services/syntax/syntaxToken.ts +++ b/src/services/syntax/syntaxToken.ts @@ -1,7 +1,7 @@ /// module TypeScript { - export interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax { + export interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax, IPropertyAssignmentSyntax, IPropertyNameSyntax { // Adjusts the full start of this token. Should only be called by the parser. setFullStart(fullStart: number): void; @@ -16,17 +16,12 @@ module TypeScript { fullText(text?: ISimpleText): string; hasLeadingTrivia(): boolean; - hasTrailingTrivia(): boolean; + hasLeadingNewLine(): boolean; hasLeadingComment(): boolean; - hasTrailingComment(): boolean; - - hasSkippedToken(): boolean; + hasLeadingSkippedToken(): boolean; leadingTrivia(text?: ISimpleText): ISyntaxTriviaList; - trailingTrivia(text?: ISimpleText): ISyntaxTriviaList; - leadingTriviaWidth(text?: ISimpleText): number; - trailingTriviaWidth(text?: ISimpleText): number; // True if this was a keyword that the parser converted to an identifier. i.e. if you have // x.public @@ -71,10 +66,10 @@ module TypeScript { module TypeScript { export function tokenValue(token: ISyntaxToken): any { if (token.fullWidth() === 0) { - return null; + return undefined; } - var kind = token.kind(); + var kind = token.kind; var text = token.text(); if (kind === SyntaxKind.IdentifierName) { @@ -87,7 +82,7 @@ module TypeScript { case SyntaxKind.FalseKeyword: return false; case SyntaxKind.NullKeyword: - return null; + return undefined; } if (SyntaxFacts.isAnyKeyword(kind) || SyntaxFacts.isAnyPunctuation(kind)) { @@ -98,21 +93,29 @@ module TypeScript { return IntegerUtilities.isHexInteger(text) ? parseInt(text, /*radix:*/ 16) : parseFloat(text); } else if (kind === SyntaxKind.StringLiteral) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - // Properly terminated. Remove the quotes, and massage any escape characters we see. - return massageEscapes(text.substr(1, text.length - 2)); - } - else { - // Not property terminated. Remove the first quote and massage any escape characters we see. - return massageEscapes(text.substr(1)); - - } + return (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) + ? massageEscapes(text.substr(1, text.length - "''".length)) + : massageEscapes(text.substr(1)); + } + else if (kind === SyntaxKind.NoSubstitutionTemplateToken || kind === SyntaxKind.TemplateEndToken) { + // Both of these template types may be missing their closing backtick (if they were at + // the end of the file). Check to make sure it is there before grabbing the portion + // we're examining. + return (text.length > 1 && text.charCodeAt(text.length - 1) === CharacterCodes.backtick) + ? massageTemplate(text.substr(1, text.length - "``".length)) + : massageTemplate(text.substr(1)); + } + else if (kind === SyntaxKind.TemplateStartToken || kind === SyntaxKind.TemplateMiddleToken) { + // Both these tokens must have been properly ended. i.e. if it didn't end with a ${ + // then we would not have parsed a start or middle token out at all. So we don't + // need to check for an incomplete token. + return massageTemplate(text.substr(1, text.length - "`${".length)); } else if (kind === SyntaxKind.RegularExpressionLiteral) { return regularExpressionValue(text); } else if (kind === SyntaxKind.EndOfFileToken || kind === SyntaxKind.ErrorToken) { - return null; + return undefined; } else { throw Errors.invalidOperation(); @@ -121,7 +124,19 @@ module TypeScript { export function tokenValueText(token: ISyntaxToken): string { var value = tokenValue(token); - return value === null ? "" : massageDisallowedIdentifiers(value.toString()); + return value === undefined ? "" : massageDisallowedIdentifiers(value.toString()); + } + + function massageTemplate(text: string): string { + // First, convert all carriage-return newlines into line-feed newlines. This is due to: + // + // The TRV of LineTerminatorSequence :: is the code unit value 0x000A. + // ... + // The TRV of LineTerminatorSequence :: is the sequence consisting of the code unit value 0x000A. + text = text.replace("\r\n", "\n").replace("\r", "\n"); + + // Now remove any escape characters that may be in the string. + return massageEscapes(text); } export function massageEscapes(text: string): string { @@ -136,7 +151,7 @@ module TypeScript { return new RegExp(body, flags); } catch (e) { - return null; + return undefined; } } @@ -235,13 +250,13 @@ module TypeScript { characterArray.push(ch); if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); characterArray.length = 0; } } if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); } return result; @@ -264,7 +279,7 @@ module TypeScript { module TypeScript.Syntax { export function realizeToken(token: ISyntaxToken, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text()); } export function convertKeywordToIdentifier(token: ISyntaxToken): ISyntaxToken { @@ -272,11 +287,7 @@ module TypeScript.Syntax { } export function withLeadingTrivia(token: ISyntaxToken, leadingTrivia: ISyntaxTriviaList, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); - } - - export function withTrailingTrivia(token: ISyntaxToken, trailingTrivia: ISyntaxTriviaList, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text()); } export function emptyToken(kind: SyntaxKind): ISyntaxToken { @@ -284,21 +295,22 @@ module TypeScript.Syntax { } class EmptyToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; - constructor(private _kind: SyntaxKind) { + public parent: ISyntaxElement; + public childCount: number; + + constructor(public kind: SyntaxKind) { } public setFullStart(fullStart: number): void { // An empty token is always at the -1 position. } - public kind(): SyntaxKind { - return this._kind; - } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public clone(): ISyntaxToken { - return new EmptyToken(this.kind()); + return new EmptyToken(this.kind); } // Empty tokens are never incrementally reusable. @@ -330,15 +342,15 @@ module TypeScript.Syntax { // the full-start of this token to be at the full-end of that element. var previousElement = this.previousNonZeroWidthElement(); - return previousElement === null ? 0 : fullStart(previousElement) + fullWidth(previousElement); + return !previousElement ? 0 : fullStart(previousElement) + fullWidth(previousElement); } private previousNonZeroWidthElement(): ISyntaxElement { var current: ISyntaxElement = this; while (true) { var parent = current.parent; - if (parent === null) { - Debug.assert(current.kind() === SyntaxKind.SourceUnit, "We had a node without a parent that was not the root node!"); + if (parent === undefined) { + Debug.assert(current.kind === SyntaxKind.SourceUnit, "We had a node without a parent that was not the root node!"); // We walked all the way to the top, and never found a previous element. This // can happen with code like: @@ -346,9 +358,9 @@ module TypeScript.Syntax { // / b; // // We will have an empty identifier token as the first token in the tree. In - // this case, return null so that the position of the empty token will be + // this case, return undefined so that the position of the empty token will be // considered to be 0. - return null; + return undefined; } // Ok. We have a parent. First, find out which slot we're at in the parent. @@ -383,61 +395,50 @@ module TypeScript.Syntax { public fullText(): string { return ""; } public hasLeadingTrivia() { return false; } - public hasTrailingTrivia() { return false; } + public hasLeadingNewLine() { return false; } public hasLeadingComment() { return false; } - public hasTrailingComment() { return false; } - public hasSkippedToken() { return false; } + public hasLeadingSkippedToken() { return false; } public leadingTriviaWidth() { return 0; } - public trailingTriviaWidth() { return 0; } - public leadingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } - public trailingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } } + EmptyToken.prototype.childCount = 0; class RealizedToken implements ISyntaxToken { + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + private _fullStart: number; - private _kind: SyntaxKind; private _isKeywordConvertedToIdentifier: boolean; private _leadingTrivia: ISyntaxTriviaList; private _text: string; - private _trailingTrivia: ISyntaxTriviaList; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public parent: ISyntaxElement; + public childCount: number; constructor(fullStart: number, - kind: SyntaxKind, - isKeywordConvertedToIdentifier: boolean, - leadingTrivia: ISyntaxTriviaList, - text: string, - trailingTrivia: ISyntaxTriviaList) { + public kind: SyntaxKind, + isKeywordConvertedToIdentifier: boolean, + leadingTrivia: ISyntaxTriviaList, + text: string) { this._fullStart = fullStart; - this._kind = kind; this._isKeywordConvertedToIdentifier = isKeywordConvertedToIdentifier; this._text = text; this._leadingTrivia = leadingTrivia.clone(); - this._trailingTrivia = trailingTrivia.clone(); if (!this._leadingTrivia.isShared()) { this._leadingTrivia.parent = this; } - - if (!this._trailingTrivia.isShared()) { - this._trailingTrivia.parent = this; - } } public setFullStart(fullStart: number): void { this._fullStart = fullStart; } - public kind(): SyntaxKind { - return this._kind; - } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public clone(): ISyntaxToken { - return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); + return new RealizedToken(this._fullStart, this.kind, this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text); } // Realized tokens are created from the parser. They are *never* incrementally reusable. @@ -448,39 +449,37 @@ module TypeScript.Syntax { } public fullStart(): number { return this._fullStart; } - public fullWidth(): number { return this._leadingTrivia.fullWidth() + this._text.length + this._trailingTrivia.fullWidth(); } + public fullWidth(): number { return this._leadingTrivia.fullWidth() + this._text.length; } public text(): string { return this._text; } - public fullText(): string { return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); } + public fullText(): string { return this._leadingTrivia.fullText() + this.text(); } public hasLeadingTrivia(): boolean { return this._leadingTrivia.count() > 0; } - public hasTrailingTrivia(): boolean { return this._trailingTrivia.count() > 0; } + public hasLeadingNewLine(): boolean { return this._leadingTrivia.hasNewLine(); } public hasLeadingComment(): boolean { return this._leadingTrivia.hasComment(); } - public hasTrailingComment(): boolean { return this._trailingTrivia.hasComment(); } - - public leadingTriviaWidth(): number { return this._leadingTrivia.fullWidth(); } - public trailingTriviaWidth(): number { return this._trailingTrivia.fullWidth(); } - - public hasSkippedToken(): boolean { return this._leadingTrivia.hasSkippedToken() || this._trailingTrivia.hasSkippedToken(); } + public hasLeadingSkippedToken(): boolean { return this._leadingTrivia.hasSkippedToken(); } public leadingTrivia(): ISyntaxTriviaList { return this._leadingTrivia; } - public trailingTrivia(): ISyntaxTriviaList { return this._trailingTrivia; } + public leadingTriviaWidth(): number { return this._leadingTrivia.fullWidth(); } } + RealizedToken.prototype.childCount = 0; class ConvertedKeywordToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + + public parent: ISyntaxElement; + public kind: SyntaxKind; + public childCount: number; constructor(private underlyingToken: ISyntaxToken) { } - public kind() { - return SyntaxKind.IdentifierName; - } - public setFullStart(fullStart: number): void { this.underlyingToken.setFullStart(fullStart); } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } + public fullStart(): number { return this.underlyingToken.fullStart(); } @@ -503,25 +502,10 @@ module TypeScript.Syntax { return this.underlyingToken.fullText(this.syntaxTreeText(text)); } - public hasLeadingTrivia(): boolean { - return this.underlyingToken.hasLeadingTrivia(); - } - - public hasTrailingTrivia(): boolean { - return this.underlyingToken.hasTrailingTrivia(); - } - - public hasLeadingComment(): boolean { - return this.underlyingToken.hasLeadingComment(); - } - - public hasTrailingComment(): boolean { - return this.underlyingToken.hasTrailingComment(); - } - - public hasSkippedToken(): boolean { - return this.underlyingToken.hasSkippedToken(); - } + public hasLeadingTrivia(): boolean { return this.underlyingToken.hasLeadingTrivia(); } + public hasLeadingNewLine(): boolean { return this.underlyingToken.hasLeadingNewLine(); } + public hasLeadingComment(): boolean { return this.underlyingToken.hasLeadingComment(); } + public hasLeadingSkippedToken(): boolean { return this.underlyingToken.hasLeadingSkippedToken(); } public leadingTrivia(text?: ISimpleText): ISyntaxTriviaList { var result = this.underlyingToken.leadingTrivia(this.syntaxTreeText(text)); @@ -529,20 +513,10 @@ module TypeScript.Syntax { return result; } - public trailingTrivia(text?: ISimpleText): ISyntaxTriviaList { - var result = this.underlyingToken.trailingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - } - public leadingTriviaWidth(text?: ISimpleText): number { return this.underlyingToken.leadingTriviaWidth(this.syntaxTreeText(text)); } - public trailingTriviaWidth(text?: ISimpleText): number { - return this.underlyingToken.trailingTriviaWidth(this.syntaxTreeText(text)); - } - public isKeywordConvertedToIdentifier(): boolean { return true; } @@ -559,4 +533,6 @@ module TypeScript.Syntax { return new ConvertedKeywordToken(this.underlyingToken); } } + ConvertedKeywordToken.prototype.kind = SyntaxKind.IdentifierName; + ConvertedKeywordToken.prototype.childCount = 0; } \ No newline at end of file diff --git a/src/services/syntax/syntaxTree.ts b/src/services/syntax/syntaxTree.ts index 1c68350d918..c21b741025d 100644 --- a/src/services/syntax/syntaxTree.ts +++ b/src/services/syntax/syntaxTree.ts @@ -4,11 +4,10 @@ module TypeScript { export var syntaxDiagnosticsTime: number = 0; export class SyntaxTree { - private _isConcrete: boolean; private _sourceUnit: SourceUnitSyntax; private _isDeclaration: boolean; private _parserDiagnostics: Diagnostic[]; - private _allDiagnostics: Diagnostic[] = null; + private _allDiagnostics: Diagnostic[] = undefined; private _fileName: string; private _lineMap: LineMap; private _languageVersion: ts.ScriptTarget; @@ -17,14 +16,12 @@ module TypeScript { private _amdDependencies: string[]; private _isExternalModule: boolean; - constructor(isConcrete: boolean, - sourceUnit: SourceUnitSyntax, + constructor(sourceUnit: SourceUnitSyntax, isDeclaration: boolean, diagnostics: Diagnostic[], fileName: string, public text: ISimpleText, languageVersion: ts.ScriptTarget) { - this._isConcrete = isConcrete; this._sourceUnit = sourceUnit; this._isDeclaration = isDeclaration; this._parserDiagnostics = diagnostics; @@ -35,10 +32,6 @@ module TypeScript { sourceUnit.syntaxTree = this; } - public isConcrete(): boolean { - return this._isConcrete; - } - public sourceUnit(): SourceUnitSyntax { return this._sourceUnit; } @@ -60,7 +53,7 @@ module TypeScript { } public diagnostics(): Diagnostic[] { - if (this._allDiagnostics === null) { + if (!this._allDiagnostics) { var start = new Date().getTime(); this._allDiagnostics = this.computeDiagnostics(); syntaxDiagnosticsTime += new Date().getTime() - start; @@ -87,7 +80,7 @@ module TypeScript { var firstToken = firstSyntaxTreeToken(this); var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = externalModuleIndicatorSpanWorker(this, firstToken) !== null; + this._isExternalModule = !!externalModuleIndicatorSpanWorker(this, firstToken); var amdDependencies: string[] = []; for (var i = 0, n = leadingTrivia.count(); i < n; i++) { @@ -106,7 +99,7 @@ module TypeScript { private getAmdDependency(comment: string): string { var amdDependencyRegEx = /^\/\/\/\s* 0) { return false; } @@ -287,7 +280,7 @@ module TypeScript { public visitHeritageClause(node: HeritageClauseSyntax): void { if (this.checkForTrailingComma(node.typeNames) || - this.checkForAtLeastOneElement(node, node.typeNames, node.extendsOrImplementsKeyword, SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { + this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind))) { return; } @@ -303,7 +296,7 @@ module TypeScript { } public visitVariableDeclaration(node: VariableDeclarationSyntax): void { - if (this.checkForAtLeastOneElement(node, node.variableDeclarators, node.varKeyword, getLocalizedText(DiagnosticCode.variable_declaration, null)) || + if (this.checkForAtLeastOneElement(node.variableDeclarators, node.varKeyword, getLocalizedText(DiagnosticCode.variable_declaration, undefined)) || this.checkForTrailingComma(node.variableDeclarators)) { return; } @@ -313,7 +306,7 @@ module TypeScript { public visitTypeArgumentList(node: TypeArgumentListSyntax): void { if (this.checkForTrailingComma(node.typeArguments) || - this.checkForAtLeastOneElement(node, node.typeArguments, node.lessThanToken, getLocalizedText(DiagnosticCode.type_argument, null))) { + this.checkForAtLeastOneElement(node.typeArguments, node.lessThanToken, getLocalizedText(DiagnosticCode.type_argument, undefined))) { return; } @@ -322,7 +315,7 @@ module TypeScript { public visitTupleType(node: TupleTypeSyntax): void { if (this.checkForTrailingComma(node.types) || - this.checkForAtLeastOneElement(node, node.types, node.openBracketToken, getLocalizedText(DiagnosticCode.type, null))) { + this.checkForAtLeastOneElement(node.types, node.openBracketToken, getLocalizedText(DiagnosticCode.type, undefined))) { return } @@ -331,7 +324,7 @@ module TypeScript { public visitTypeParameterList(node: TypeParameterListSyntax): void { if (this.checkForTrailingComma(node.typeParameters) || - this.checkForAtLeastOneElement(node, node.typeParameters, node.lessThanToken, getLocalizedText(DiagnosticCode.type_parameter, null))) { + this.checkForAtLeastOneElement(node.typeParameters, node.lessThanToken, getLocalizedText(DiagnosticCode.type_parameter, undefined))) { return; } @@ -344,7 +337,7 @@ module TypeScript { return true; } - var parameter = node.parameters[0]; + var parameter = nonSeparatorAt(node.parameters, 0); if (parameter.dotDotDotToken) { this.pushDiagnostic(parameter, DiagnosticCode.Index_signatures_cannot_have_rest_parameters); @@ -366,8 +359,8 @@ module TypeScript { this.pushDiagnostic(parameter, DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); return true; } - else if (parameter.typeAnnotation.type.kind() !== SyntaxKind.StringKeyword && - parameter.typeAnnotation.type.kind() !== SyntaxKind.NumberKeyword) { + else if (parameter.typeAnnotation.type.kind !== SyntaxKind.StringKeyword && + parameter.typeAnnotation.type.kind !== SyntaxKind.NumberKeyword) { this.pushDiagnostic(parameter, DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); return true; } @@ -396,7 +389,7 @@ module TypeScript { Debug.assert(i <= 2); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword) { + if (heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ExtendsKeyword) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.extends_clause_already_seen); return true; @@ -407,7 +400,7 @@ module TypeScript { return true; } - if (heritageClause.typeNames.length > 1) { + if (nonSeparatorCount(heritageClause.typeNames) > 1) { this.pushDiagnostic(heritageClause, DiagnosticCode.Classes_can_only_extend_a_single_class); return true; } @@ -415,7 +408,7 @@ module TypeScript { seenExtendsClause = true; } else { - Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ImplementsKeyword); + Debug.assert(heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ImplementsKeyword); if (seenImplementsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.implements_clause_already_seen); return true; @@ -475,7 +468,7 @@ module TypeScript { Debug.assert(i <= 1); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword) { + if (heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ExtendsKeyword) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.extends_clause_already_seen); return true; @@ -484,7 +477,7 @@ module TypeScript { seenExtendsClause = true; } else { - Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ImplementsKeyword); + Debug.assert(heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ImplementsKeyword); this.pushDiagnostic(heritageClause, DiagnosticCode.Interface_declaration_cannot_have_implements_clause); return true; } @@ -496,7 +489,7 @@ module TypeScript { private checkInterfaceModifiers(modifiers: ISyntaxToken[]): boolean { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (modifier.kind() === SyntaxKind.DeclareKeyword) { + if (modifier.kind === SyntaxKind.DeclareKeyword) { this.pushDiagnostic(modifier, DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); return true; @@ -523,7 +516,7 @@ module TypeScript { for (var i = 0, n = list.length; i < n; i++) { var modifier = list[i]; - if (SyntaxFacts.isAccessibilityModifier(modifier.kind())) { + if (SyntaxFacts.isAccessibilityModifier(modifier.kind)) { if (seenAccessibilityModifier) { this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen); return true; @@ -537,7 +530,7 @@ module TypeScript { seenAccessibilityModifier = true; } - else if (modifier.kind() === SyntaxKind.StaticKeyword) { + else if (modifier.kind === SyntaxKind.StaticKeyword) { if (seenStaticModifier) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return true; @@ -562,8 +555,27 @@ module TypeScript { super.visitMemberVariableDeclaration(node); } + public visitMethodSignature(node: MethodSignatureSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { + return; + } + + super.visitMethodSignature(node); + } + + public visitPropertySignature(node: PropertySignatureSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { + return; + } + + super.visitPropertySignature(node); + } + public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { - if (this.checkClassElementModifiers(node.modifiers)) { + if (this.checkClassElementModifiers(node.modifiers) || + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -589,14 +601,14 @@ module TypeScript { private checkIndexMemberModifiers(node: IndexMemberDeclarationSyntax): boolean { if (node.modifiers.length > 0) { - this.pushDiagnostic(childAt(node.modifiers, 0), DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(node.modifiers[0], DiagnosticCode.Modifiers_cannot_appear_here); return true; } return false; } - private checkEcmaScriptVersionIsAtLeast(parent: ISyntaxElement, reportToken: ISyntaxToken, languageVersion: ts.ScriptTarget, diagnosticKey: string): boolean { + private checkEcmaScriptVersionIsAtLeast(reportToken: ISyntaxToken, languageVersion: ts.ScriptTarget, diagnosticKey: string): boolean { if (this.syntaxTree.languageVersion() < languageVersion) { this.pushDiagnostic(reportToken, diagnosticKey); return true; @@ -614,11 +626,12 @@ module TypeScript { public visitGetAccessor(node: GetAccessorSyntax): void { if (this.checkForAccessorDeclarationInAmbientContext(node) || - this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkEcmaScriptVersionIsAtLeast(node.getKeyword, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || - this.checkGetAccessorParameter(node)) { + this.checkGetAccessorParameter(node) || + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -635,7 +648,7 @@ module TypeScript { } private checkForDisallowedAccessorTypeParameters(callSignature: CallSignatureSyntax): boolean { - if (callSignature.typeParameterList !== null) { + if (callSignature.typeParameterList) { this.pushDiagnostic(callSignature.typeParameterList, DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); return true; } @@ -654,12 +667,12 @@ module TypeScript { private checkSetAccessorParameter(node: SetAccessorSyntax): boolean { var parameters = node.callSignature.parameterList.parameters; - if (childCount(parameters) !== 1) { + if (nonSeparatorCount(parameters) !== 1) { this.pushDiagnostic(node.propertyName, DiagnosticCode.set_accessor_must_have_exactly_one_parameter); return true; } - var parameter = parameters[0]; + var parameter = nonSeparatorAt(parameters, 0); if (parameter.questionToken) { this.pushDiagnostic(parameter, DiagnosticCode.set_accessor_parameter_cannot_be_optional); @@ -679,14 +692,23 @@ module TypeScript { return false; } + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) { + return; + } + + super.visitSimplePropertyAssignment(node); + } + public visitSetAccessor(node: SetAccessorSyntax): void { if (this.checkForAccessorDeclarationInAmbientContext(node) || - this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkEcmaScriptVersionIsAtLeast(node.setKeyword, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || - this.checkSetAccessorParameter(node)) { + this.checkSetAccessorParameter(node) || + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -710,28 +732,28 @@ module TypeScript { private checkEnumElements(node: EnumDeclarationSyntax): boolean { var previousValueWasComputed = false; - for (var i = 0, n = childCount(node.enumElements); i < n; i++) { - var child = childAt(node.enumElements, i); + for (var i = 0, n = nonSeparatorCount(node.enumElements); i < n; i++) { + var enumElement = nonSeparatorAt(node.enumElements, i); - if (i % 2 === 0) { - var enumElement = child; + if (!enumElement.equalsValueClause && previousValueWasComputed) { + this.pushDiagnostic(enumElement, DiagnosticCode.Enum_member_must_have_initializer); + return true; + } - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic(enumElement, DiagnosticCode.Enum_member_must_have_initializer); - return true; - } - - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !Syntax.isIntegerLiteral(value); - } + if (enumElement.equalsValueClause) { + var value = enumElement.equalsValueClause.value; + previousValueWasComputed = !Syntax.isIntegerLiteral(value); } } - return false; } public visitEnumElement(node: EnumElementSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { + return; + } + if (this.inAmbientDeclaration && node.equalsValueClause) { var expression = node.equalsValueClause.value; if (!Syntax.isIntegerLiteral(expression)) { @@ -744,8 +766,8 @@ module TypeScript { } public visitInvocationExpression(node: InvocationExpressionSyntax): void { - if (node.expression.kind() === SyntaxKind.SuperKeyword && - node.argumentList.typeArgumentList !== null) { + if (node.expression.kind === SyntaxKind.SuperKeyword && + node.argumentList.typeArgumentList) { this.pushDiagnostic(node, DiagnosticCode.super_invocation_cannot_have_type_arguments); } @@ -758,13 +780,13 @@ module TypeScript { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (SyntaxFacts.isAccessibilityModifier(modifier.kind()) || - modifier.kind() === SyntaxKind.StaticKeyword) { + if (SyntaxFacts.isAccessibilityModifier(modifier.kind) || + modifier.kind === SyntaxKind.StaticKeyword) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); return true; } - if (modifier.kind() === SyntaxKind.DeclareKeyword) { + if (modifier.kind === SyntaxKind.DeclareKeyword) { if (seenDeclareModifier) { this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen); return; @@ -772,7 +794,7 @@ module TypeScript { seenDeclareModifier = true; } - else if (modifier.kind() === SyntaxKind.ExportKeyword) { + else if (modifier.kind === SyntaxKind.ExportKeyword) { if (seenExportModifier) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return; @@ -792,12 +814,12 @@ module TypeScript { } private checkForDisallowedImportDeclaration(node: ModuleDeclarationSyntax): boolean { - if (!node.stringLiteral) { + if (node.name.kind !== SyntaxKind.StringLiteral) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === SyntaxKind.ImportDeclaration) { + if (child.kind === SyntaxKind.ImportDeclaration) { var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === SyntaxKind.ExternalModuleReference) { + if (importDeclaration.moduleReference.kind === SyntaxKind.ExternalModuleReference) { this.pushDiagnostic(importDeclaration, DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } } @@ -827,21 +849,21 @@ module TypeScript { public visitModuleDeclaration(node: ModuleDeclarationSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || - this.checkForRequiredDeclareModifier(node, node.stringLiteral ? node.stringLiteral : firstToken(node.name), node.modifiers) || + this.checkForRequiredDeclareModifier(node, firstToken(node.name), node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node)) { return; } - if (node.stringLiteral) { + if (node.name.kind === SyntaxKind.StringLiteral) { if (!this.inAmbientDeclaration && !SyntaxUtilities.containsToken(node.modifiers, SyntaxKind.DeclareKeyword)) { - this.pushDiagnostic(node.stringLiteral, DiagnosticCode.Only_ambient_modules_can_use_quoted_names); + this.pushDiagnostic(node.name, DiagnosticCode.Only_ambient_modules_can_use_quoted_names); return; } } - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { + if (node.name.kind !== SyntaxKind.StringLiteral && this.checkForDisallowedExportAssignment(node)) { return; } @@ -855,7 +877,7 @@ module TypeScript { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === SyntaxKind.ExportAssignment) { + if (child.kind === SyntaxKind.ExportAssignment) { this.pushDiagnostic(child, DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); return true; } @@ -879,7 +901,7 @@ module TypeScript { if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { // Provide a specialized message for a block as a statement versus the block as a // function body. - if (node.parent.kind() === SyntaxKind.List) { + if (node.parent.kind === SyntaxKind.List) { this.pushDiagnostic(firstToken(node), DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); } else { @@ -960,7 +982,7 @@ module TypeScript { private inSwitchStatement(ast: ISyntaxElement): boolean { while (ast) { - if (ast.kind() === SyntaxKind.SwitchStatement) { + if (ast.kind === SyntaxKind.SwitchStatement) { return true; } @@ -975,7 +997,7 @@ module TypeScript { } private isIterationStatement(ast: ISyntaxElement): boolean { - switch (ast.kind()) { + switch (ast.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.WhileStatement: @@ -1007,7 +1029,7 @@ module TypeScript { element = element.parent; while (element) { - if (element.kind() === SyntaxKind.LabeledStatement) { + if (element.kind === SyntaxKind.LabeledStatement) { var labeledStatement = element; if (breakable) { // Breakable labels can be placed on any construct @@ -1033,7 +1055,7 @@ module TypeScript { } private labelIsOnContinuableConstruct(statement: ISyntaxElement): boolean { - switch (statement.kind()) { + switch (statement.kind) { case SyntaxKind.LabeledStatement: // Labels work transitively. i.e. if you have: // foo: @@ -1136,7 +1158,7 @@ module TypeScript { } private checkForInLeftHandSideExpression(node: ForInStatementSyntax): boolean { - if (node.left && !SyntaxUtilities.isLeftHandSizeExpression(node.left)) { + if (node.left.kind !== SyntaxKind.VariableDeclaration && !SyntaxUtilities.isLeftHandSizeExpression(node.left)) { this.pushDiagnostic(node.left, DiagnosticCode.Invalid_left_hand_side_in_for_in_statement); return true; } @@ -1148,8 +1170,8 @@ module TypeScript { // The parser accepts a Variable Declaration in a ForInStatement, but the grammar only // allows a very restricted form. Specifically, there must be only a single Variable // Declarator in the Declaration. - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.length > 1) { - this.pushDiagnostic(node.variableDeclaration, DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + if (node.left.kind === SyntaxKind.VariableDeclaration && (node.left).variableDeclarators.length > 1) { + this.pushDiagnostic(node.left, DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); return true; } @@ -1275,7 +1297,7 @@ module TypeScript { } private checkForWithInStrictMode(node: WithStatementSyntax): boolean { - if (parsedInStrictMode(node)) { + if (parsedInStrictModeContext(node)) { this.pushDiagnostic(firstToken(node), DiagnosticCode.with_statements_are_not_allowed_in_strict_mode); return true; } @@ -1283,10 +1305,10 @@ module TypeScript { return false; } - private checkForDisallowedModifiers(parent: ISyntaxElement, modifiers: ISyntaxToken[]): boolean { + private checkForDisallowedModifiers(modifiers: ISyntaxToken[]): boolean { if (this.inBlock || this.inObjectLiteralExpression) { if (modifiers.length > 0) { - this.pushDiagnostic(childAt(modifiers, 0), DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(modifiers[0], DiagnosticCode.Modifiers_cannot_appear_here); return true; } } @@ -1296,7 +1318,7 @@ module TypeScript { public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { @@ -1318,9 +1340,17 @@ module TypeScript { super.visitFunctionExpression(node); } + public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) { + return; + } + + super.visitFunctionPropertyAssignment(node); + } + public visitVariableStatement(node: VariableStatementSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || - this.checkForDisallowedModifiers(node, node.modifiers) || + this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { @@ -1333,10 +1363,10 @@ module TypeScript { this.inAmbientDeclaration = savedInAmbientDeclaration; } - private checkListSeparators(parent: ISyntaxElement, list: T[], kind: SyntaxKind): boolean { - for (var i = 0, n = childCount(list); i < n; i++) { - var child = childAt(list, i); - if (i % 2 === 1 && child.kind() !== kind) { + private checkListSeparators(list: ISeparatedSyntaxList, kind: SyntaxKind): boolean { + for (var i = 0, n = separatorCount(list); i < n; i++) { + var child = separatorAt(list, i); + if (child.kind !== kind) { this.pushDiagnostic(child, DiagnosticCode._0_expected, [SyntaxFacts.getText(kind)]); } } @@ -1345,7 +1375,7 @@ module TypeScript { } public visitObjectType(node: ObjectTypeSyntax): void { - if (this.checkListSeparators(node, node.typeMembers, SyntaxKind.SemicolonToken)) { + if (this.checkListSeparators(node.typeMembers, SyntaxKind.SemicolonToken)) { return; } @@ -1382,16 +1412,36 @@ module TypeScript { public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { if (this.checkVariableDeclaratorInitializer(node) || - this.checkVariableDeclaratorIdentifier(node)) { + this.checkVariableDeclaratorIdentifier(node) || + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } super.visitVariableDeclarator(node); } + private checkForDisallowedTemplatePropertyName(propertyName: IPropertyNameSyntax): boolean { + if (propertyName.kind === SyntaxKind.NoSubstitutionTemplateToken) { + this.pushDiagnostic(propertyName, DiagnosticCode.Template_literal_cannot_be_used_as_an_element_name); + return true; + } + + return false; + } + + private checkForDisallowedComputedPropertyName(propertyName: IPropertyNameSyntax): boolean { + if (propertyName.kind === SyntaxKind.ComputedPropertyName) { + this.pushDiagnostic(propertyName, DiagnosticCode.Computed_property_names_cannot_be_used_here); + return true; + } + + return false; + } + private checkVariableDeclaratorIdentifier(node: VariableDeclaratorSyntax): boolean { - if (node.parent.kind() !== SyntaxKind.MemberVariableDeclaration) { - if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { + if (node.parent.kind !== SyntaxKind.MemberVariableDeclaration) { + Debug.assert(isToken(node.propertyName), "A normal variable declarator must always have a token for a name."); + if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { return true; } } @@ -1423,8 +1473,8 @@ module TypeScript { private checkConstructorModifiers(modifiers: ISyntaxToken[]): boolean { for (var i = 0, n = modifiers.length; i < n; i++) { var child = modifiers[i]; - if (child.kind() !== SyntaxKind.PublicKeyword) { - this.pushDiagnostic(child, DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [SyntaxFacts.getText(child.kind())]); + if (child.kind !== SyntaxKind.PublicKeyword) { + this.pushDiagnostic(child, DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [SyntaxFacts.getText(child.kind)]); return true; } } @@ -1459,7 +1509,7 @@ module TypeScript { } public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): void { - if (parsedInStrictMode(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { + if (parsedInStrictModeContext(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); } @@ -1467,7 +1517,7 @@ module TypeScript { } public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): void { - if (parsedInStrictMode(node) && this.isEvalOrArguments(node.operand)) { + if (parsedInStrictModeContext(node) && this.isEvalOrArguments(node.operand)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); } @@ -1484,7 +1534,7 @@ module TypeScript { private checkForDisallowedEvalOrArguments(node: ISyntaxNode, token: ISyntaxToken): boolean { if (token) { - if (parsedInStrictMode(node) && this.isEvalOrArguments(token)) { + if (parsedInStrictModeContext(node) && this.isEvalOrArguments(token)) { this.pushDiagnostic(token, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(token)]); return true; } @@ -1494,9 +1544,9 @@ module TypeScript { } private isPreIncrementOrDecrementExpression(node: PrefixUnaryExpressionSyntax) { - switch (node.kind()) { - case SyntaxKind.PreDecrementExpression: - case SyntaxKind.PreIncrementExpression: + switch (node.operatorToken.kind) { + case SyntaxKind.MinusMinusToken: + case SyntaxKind.PlusPlusToken: return true; } @@ -1504,16 +1554,25 @@ module TypeScript { } public visitDeleteExpression(node: DeleteExpressionSyntax): void { - if (parsedInStrictMode(node) && node.expression.kind() === SyntaxKind.IdentifierName) { - this.pushDiagnostic(firstToken(node), DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); + if (parsedInStrictModeContext(node) && node.expression.kind === SyntaxKind.IdentifierName) { + this.pushDiagnostic(node.deleteKeyword, DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); return; } super.visitDeleteExpression(node); } + public visitYieldExpression(node: YieldExpressionSyntax): void { + if (!parsedInYieldContext(node)) { + this.pushDiagnostic(node.yieldKeyword, DiagnosticCode.yield_expression_must_be_contained_within_a_generator_declaration); + return; + } + + super.visitYieldExpression(node); + } + private checkIllegalAssignment(node: BinaryExpressionSyntax): boolean { - if (parsedInStrictMode(node) && SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind()) && this.isEvalOrArguments(node.left)) { + if (parsedInStrictModeContext(node) && SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind) && this.isEvalOrArguments(node.left)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.left)]); return true; } @@ -1522,18 +1581,18 @@ module TypeScript { } private getEvalOrArguments(expr: IExpressionSyntax): string { - if (expr.kind() === SyntaxKind.IdentifierName) { + if (expr.kind === SyntaxKind.IdentifierName) { var text = tokenValueText(expr); if (text === "eval" || text === "arguments") { return text; } } - return null; + return undefined; } private isEvalOrArguments(expr: IExpressionSyntax): boolean { - return this.getEvalOrArguments(expr) !== null; + return !!this.getEvalOrArguments(expr); } public visitConstraint(node: ConstraintSyntax): void { @@ -1545,7 +1604,7 @@ module TypeScript { } private checkConstraintType(node: ConstraintSyntax): boolean { - if (!SyntaxFacts.isType(node.typeOrExpression.kind())) { + if (!SyntaxFacts.isType(node.typeOrExpression.kind)) { this.pushDiagnostic(node.typeOrExpression, DiagnosticCode.Type_expected); return true; } @@ -1583,7 +1642,7 @@ module TypeScript { } } - return null; + return undefined; } function implicitImportSpanWorker(trivia: ISyntaxTrivia): TextSpan { @@ -1594,7 +1653,7 @@ module TypeScript { return new TextSpan(trivia.fullStart(), trivia.fullWidth()); } - return null; + return undefined; } function topLevelImportOrExportSpan(node: SourceUnitSyntax): TextSpan { @@ -1602,19 +1661,19 @@ module TypeScript { var moduleElement = node.moduleElements[i]; var _firstToken = firstToken(moduleElement); - if (_firstToken !== null && _firstToken.kind() === SyntaxKind.ExportKeyword) { + if (_firstToken && _firstToken.kind === SyntaxKind.ExportKeyword) { return new TextSpan(start(_firstToken), width(_firstToken)); } - if (moduleElement.kind() === SyntaxKind.ImportDeclaration) { + if (moduleElement.kind === SyntaxKind.ImportDeclaration) { var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === SyntaxKind.ExternalModuleReference) { + if (importDecl.moduleReference.kind === SyntaxKind.ExternalModuleReference) { var literal = (importDecl.moduleReference).stringLiteral; return new TextSpan(start(literal), width(literal)); } } } - return null; + return undefined; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxTrivia.ts b/src/services/syntax/syntaxTrivia.ts index 38e641d86f9..02162e19fa6 100644 --- a/src/services/syntax/syntaxTrivia.ts +++ b/src/services/syntax/syntaxTrivia.ts @@ -2,8 +2,8 @@ module TypeScript { export interface ISyntaxTrivia { - parent?: ISyntaxTriviaList; - kind(): SyntaxKind; + parent: ISyntaxTriviaList; + kind: SyntaxKind; isWhitespace(): boolean; isComment(): boolean; @@ -25,11 +25,9 @@ module TypeScript { module TypeScript.Syntax { class AbstractTrivia implements ISyntaxTrivia { - constructor(private _kind: SyntaxKind) { - } + public parent: ISyntaxTriviaList; - public kind(): SyntaxKind { - return this._kind; + constructor(public kind: SyntaxKind) { } public clone(): ISyntaxTrivia { @@ -53,19 +51,19 @@ module TypeScript.Syntax { } public isWhitespace(): boolean { - return this.kind() === SyntaxKind.WhitespaceTrivia; + return this.kind === SyntaxKind.WhitespaceTrivia; } public isComment(): boolean { - return this.kind() === SyntaxKind.SingleLineCommentTrivia || this.kind() === SyntaxKind.MultiLineCommentTrivia; + return this.kind === SyntaxKind.SingleLineCommentTrivia || this.kind === SyntaxKind.MultiLineCommentTrivia; } public isNewLine(): boolean { - return this.kind() === SyntaxKind.NewLineTrivia; + return this.kind === SyntaxKind.NewLineTrivia; } public isSkippedToken(): boolean { - return this.kind() === SyntaxKind.SkippedTokenTrivia; + return this.kind === SyntaxKind.SkippedTokenTrivia; } } @@ -103,7 +101,7 @@ module TypeScript.Syntax { } public clone(): ISyntaxTrivia { - return new DeferredTrivia(this.kind(), this._text, this._fullStart, this._fullWidth); + return new DeferredTrivia(this.kind, this._text, this._fullStart, this._fullWidth); } public fullStart(): number { @@ -129,7 +127,6 @@ module TypeScript.Syntax { export function skippedTokenTrivia(token: ISyntaxToken, text: ISimpleText): ISyntaxTrivia { Debug.assert(!token.hasLeadingTrivia()); - Debug.assert(!token.hasTrailingTrivia()); Debug.assert(token.fullWidth() > 0); return new SkippedTokenTrivia(token, token.fullText(text)); } diff --git a/src/services/syntax/syntaxTriviaList.ts b/src/services/syntax/syntaxTriviaList.ts index 937b66b129f..6794a823340 100644 --- a/src/services/syntax/syntaxTriviaList.ts +++ b/src/services/syntax/syntaxTriviaList.ts @@ -28,10 +28,6 @@ module TypeScript { module TypeScript.Syntax { class EmptyTriviaList implements ISyntaxTriviaList { - public kind() { - return SyntaxKind.TriviaList; - } - public isShared(): boolean { return true; } @@ -80,7 +76,7 @@ module TypeScript.Syntax { export var emptyTriviaList: ISyntaxTriviaList = new EmptyTriviaList(); function isComment(trivia: ISyntaxTrivia): boolean { - return trivia.kind() === SyntaxKind.MultiLineCommentTrivia || trivia.kind() === SyntaxKind.SingleLineCommentTrivia; + return trivia.kind === SyntaxKind.MultiLineCommentTrivia || trivia.kind === SyntaxKind.SingleLineCommentTrivia; } class SingletonSyntaxTriviaList implements ISyntaxTriviaList { @@ -91,10 +87,6 @@ module TypeScript.Syntax { this.item.parent = this; } - public kind() { - return SyntaxKind.TriviaList; - } - public isShared(): boolean { return false; } @@ -128,11 +120,11 @@ module TypeScript.Syntax { } public hasNewLine(): boolean { - return this.item.kind() === SyntaxKind.NewLineTrivia; + return this.item.kind === SyntaxKind.NewLineTrivia; } public hasSkippedToken(): boolean { - return this.item.kind() === SyntaxKind.SkippedTokenTrivia; + return this.item.kind === SyntaxKind.SkippedTokenTrivia; } public toArray(): ISyntaxTrivia[] { @@ -155,10 +147,6 @@ module TypeScript.Syntax { }); } - public kind() { - return SyntaxKind.TriviaList; - } - public isShared(): boolean { return false; } @@ -205,7 +193,7 @@ module TypeScript.Syntax { public hasNewLine(): boolean { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === SyntaxKind.NewLineTrivia) { + if (this.trivia[i].kind === SyntaxKind.NewLineTrivia) { return true; } } @@ -215,7 +203,7 @@ module TypeScript.Syntax { public hasSkippedToken(): boolean { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === SyntaxKind.SkippedTokenTrivia) { + if (this.trivia[i].kind === SyntaxKind.SkippedTokenTrivia) { return true; } } @@ -233,7 +221,7 @@ module TypeScript.Syntax { } export function triviaList(trivia: ISyntaxTrivia[]): ISyntaxTriviaList { - if (trivia === undefined || trivia === null || trivia.length === 0) { + if (!trivia || trivia.length === 0) { return Syntax.emptyTriviaList; } diff --git a/src/services/syntax/syntaxUtilities.ts b/src/services/syntax/syntaxUtilities.ts index c5e122e927b..8c799edb4d9 100644 --- a/src/services/syntax/syntaxUtilities.ts +++ b/src/services/syntax/syntaxUtilities.ts @@ -1,9 +1,19 @@ /// module TypeScript { - export class SyntaxUtilities { - public static isAnyFunctionExpressionOrDeclaration(ast: ISyntaxElement): boolean { - switch (ast.kind()) { + export function childCount(element: ISyntaxElement): number { + if (isList(element)) { return (element).length; } + return (element).childCount; + } + + export function childAt(element: ISyntaxElement, index: number): ISyntaxElement { + if (isList(element)) { return (element)[index]; } + return (element).childAt(index); + } + + export module SyntaxUtilities { + export function isAnyFunctionExpressionOrDeclaration(ast: ISyntaxElement): boolean { + switch (ast.kind) { case SyntaxKind.SimpleArrowFunctionExpression: case SyntaxKind.ParenthesizedArrowFunctionExpression: case SyntaxKind.FunctionExpression: @@ -19,24 +29,25 @@ module TypeScript { return false; } - public static isLastTokenOnLine(token: ISyntaxToken, text: ISimpleText): boolean { + export function isLastTokenOnLine(token: ISyntaxToken, text: ISimpleText): boolean { var _nextToken = nextToken(token, text); - if (_nextToken === null) { + if (_nextToken === undefined) { return true; } var lineMap = text.lineMap(); - var tokenLine = lineMap.getLineNumberFromPosition(end(token, text)); + var tokenLine = lineMap.getLineNumberFromPosition(fullEnd(token)); var nextTokenLine = lineMap.getLineNumberFromPosition(start(_nextToken, text)); return tokenLine !== nextTokenLine; } - public static isLeftHandSizeExpression(element: ISyntaxElement) { + export function isLeftHandSizeExpression(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.MemberAccessExpression: case SyntaxKind.ElementAccessExpression: + case SyntaxKind.TemplateAccessExpression: case SyntaxKind.ObjectCreationExpression: case SyntaxKind.InvocationExpression: case SyntaxKind.ArrayLiteralExpression: @@ -59,89 +70,9 @@ module TypeScript { return false; } - public static isExpression(element: ISyntaxElement) { + export function isSwitchClause(element: ISyntaxElement) { if (element) { - switch (element.kind()) { - case SyntaxKind.IdentifierName: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - case SyntaxKind.FalseKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.ThisKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.SuperKeyword: - - case SyntaxKind.PlusExpression: - case SyntaxKind.NegateExpression: - case SyntaxKind.BitwiseNotExpression: - case SyntaxKind.LogicalNotExpression: - case SyntaxKind.PreIncrementExpression: - case SyntaxKind.PreDecrementExpression: - case SyntaxKind.DeleteExpression: - case SyntaxKind.TypeOfExpression: - case SyntaxKind.VoidExpression: - case SyntaxKind.CommaExpression: - case SyntaxKind.AssignmentExpression: - case SyntaxKind.AddAssignmentExpression: - case SyntaxKind.SubtractAssignmentExpression: - case SyntaxKind.MultiplyAssignmentExpression: - case SyntaxKind.DivideAssignmentExpression: - case SyntaxKind.ModuloAssignmentExpression: - case SyntaxKind.AndAssignmentExpression: - case SyntaxKind.ExclusiveOrAssignmentExpression: - case SyntaxKind.OrAssignmentExpression: - case SyntaxKind.LeftShiftAssignmentExpression: - case SyntaxKind.SignedRightShiftAssignmentExpression: - case SyntaxKind.UnsignedRightShiftAssignmentExpression: - case SyntaxKind.ConditionalExpression: - case SyntaxKind.LogicalOrExpression: - case SyntaxKind.LogicalAndExpression: - case SyntaxKind.BitwiseOrExpression: - case SyntaxKind.BitwiseExclusiveOrExpression: - case SyntaxKind.BitwiseAndExpression: - case SyntaxKind.EqualsWithTypeConversionExpression: - case SyntaxKind.NotEqualsWithTypeConversionExpression: - case SyntaxKind.EqualsExpression: - case SyntaxKind.NotEqualsExpression: - case SyntaxKind.LessThanExpression: - case SyntaxKind.GreaterThanExpression: - case SyntaxKind.LessThanOrEqualExpression: - case SyntaxKind.GreaterThanOrEqualExpression: - case SyntaxKind.InstanceOfExpression: - case SyntaxKind.InExpression: - case SyntaxKind.LeftShiftExpression: - case SyntaxKind.SignedRightShiftExpression: - case SyntaxKind.UnsignedRightShiftExpression: - case SyntaxKind.MultiplyExpression: - case SyntaxKind.DivideExpression: - case SyntaxKind.ModuloExpression: - case SyntaxKind.AddExpression: - case SyntaxKind.SubtractExpression: - case SyntaxKind.PostIncrementExpression: - case SyntaxKind.PostDecrementExpression: - case SyntaxKind.MemberAccessExpression: - case SyntaxKind.InvocationExpression: - case SyntaxKind.ArrayLiteralExpression: - case SyntaxKind.ObjectLiteralExpression: - case SyntaxKind.ObjectCreationExpression: - case SyntaxKind.ParenthesizedExpression: - case SyntaxKind.ParenthesizedArrowFunctionExpression: - case SyntaxKind.SimpleArrowFunctionExpression: - case SyntaxKind.CastExpression: - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.FunctionExpression: - case SyntaxKind.OmittedExpression: - return true; - } - } - - return false; - } - - public static isSwitchClause(element: ISyntaxElement) { - if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.CaseSwitchClause: case SyntaxKind.DefaultSwitchClause: return true; @@ -151,9 +82,9 @@ module TypeScript { return false; } - public static isTypeMember(element: ISyntaxElement) { + export function isTypeMember(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ConstructSignature: case SyntaxKind.MethodSignature: case SyntaxKind.IndexSignature: @@ -166,9 +97,9 @@ module TypeScript { return false; } - public static isClassElement(element: ISyntaxElement) { + export function isClassElement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ConstructorDeclaration: case SyntaxKind.IndexMemberDeclaration: case SyntaxKind.MemberFunctionDeclaration: @@ -183,9 +114,9 @@ module TypeScript { return false; } - public static isModuleElement(element: ISyntaxElement) { + export function isModuleElement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ImportDeclaration: case SyntaxKind.ExportAssignment: case SyntaxKind.ClassDeclaration: @@ -220,9 +151,9 @@ module TypeScript { return false; } - public static isStatement(element: ISyntaxElement) { + export function isStatement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.VariableStatement: case SyntaxKind.Block: @@ -249,11 +180,11 @@ module TypeScript { return false; } - public static isAngleBracket(positionedElement: ISyntaxElement): boolean { + export function isAngleBracket(positionedElement: ISyntaxElement): boolean { var element = positionedElement; var parent = positionedElement.parent; - if (parent !== null && (element.kind() === SyntaxKind.LessThanToken || element.kind() === SyntaxKind.GreaterThanToken)) { - switch (parent.kind()) { + if (parent && (element.kind === SyntaxKind.LessThanToken || element.kind === SyntaxKind.GreaterThanToken)) { + switch (parent.kind) { case SyntaxKind.TypeArgumentList: case SyntaxKind.TypeParameterList: case SyntaxKind.CastExpression: @@ -264,27 +195,27 @@ module TypeScript { return false; } - public static getToken(list: ISyntaxToken[], kind: SyntaxKind): ISyntaxToken { + export function getToken(list: ISyntaxToken[], kind: SyntaxKind): ISyntaxToken { for (var i = 0, n = list.length; i < n; i++) { var token = list[i]; - if (token.kind() === kind) { + if (token.kind === kind) { return token; } } - return null; + return undefined; } - public static containsToken(list: ISyntaxToken[], kind: SyntaxKind): boolean { - return SyntaxUtilities.getToken(list, kind) !== null; + export function containsToken(list: ISyntaxToken[], kind: SyntaxKind): boolean { + return !!SyntaxUtilities.getToken(list, kind); } - public static hasExportKeyword(moduleElement: IModuleElementSyntax): boolean { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; + export function hasExportKeyword(moduleElement: IModuleElementSyntax): boolean { + return !!SyntaxUtilities.getExportKeyword(moduleElement); } - public static getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken { - switch (moduleElement.kind()) { + export function getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken { + switch (moduleElement.kind) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.FunctionDeclaration: @@ -294,17 +225,17 @@ module TypeScript { case SyntaxKind.ImportDeclaration: return SyntaxUtilities.getToken((moduleElement).modifiers, SyntaxKind.ExportKeyword); default: - return null; + return undefined; } } - public static isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean { + export function isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean { if (!positionNode) { return false; } var node = positionNode; - switch (node.kind()) { + switch (node.kind) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.FunctionDeclaration: diff --git a/src/services/syntax/syntaxVisitor.generated.ts b/src/services/syntax/syntaxVisitor.generated.ts index 55aaef53255..57cea0cbe95 100644 --- a/src/services/syntax/syntaxVisitor.generated.ts +++ b/src/services/syntax/syntaxVisitor.generated.ts @@ -2,9 +2,8 @@ module TypeScript { export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any { - if (element === null) { return null; } - if (isToken(element)) { return visitor.visitToken(element); } - switch (element.kind()) { + if (element === undefined) { return undefined; } + switch (element.kind) { case SyntaxKind.SourceUnit: return visitor.visitSourceUnit(element); case SyntaxKind.QualifiedName: return visitor.visitQualifiedName(element); case SyntaxKind.ObjectType: return visitor.visitObjectType(element); @@ -14,6 +13,8 @@ module TypeScript { case SyntaxKind.GenericType: return visitor.visitGenericType(element); case SyntaxKind.TypeQuery: return visitor.visitTypeQuery(element); case SyntaxKind.TupleType: return visitor.visitTupleType(element); + case SyntaxKind.UnionType: return visitor.visitUnionType(element); + case SyntaxKind.ParenthesizedType: return visitor.visitParenthesizedType(element); case SyntaxKind.InterfaceDeclaration: return visitor.visitInterfaceDeclaration(element); case SyntaxKind.FunctionDeclaration: return visitor.visitFunctionDeclaration(element); case SyntaxKind.ModuleDeclaration: return visitor.visitModuleDeclaration(element); @@ -50,16 +51,13 @@ module TypeScript { case SyntaxKind.DoStatement: return visitor.visitDoStatement(element); case SyntaxKind.DebuggerStatement: return visitor.visitDebuggerStatement(element); case SyntaxKind.WithStatement: return visitor.visitWithStatement(element); - case SyntaxKind.PreIncrementExpression: case SyntaxKind.PreDecrementExpression: case SyntaxKind.PlusExpression: case SyntaxKind.NegateExpression: case SyntaxKind.BitwiseNotExpression: case SyntaxKind.LogicalNotExpression: - return visitor.visitPrefixUnaryExpression(element); + case SyntaxKind.PrefixUnaryExpression: return visitor.visitPrefixUnaryExpression(element); case SyntaxKind.DeleteExpression: return visitor.visitDeleteExpression(element); case SyntaxKind.TypeOfExpression: return visitor.visitTypeOfExpression(element); case SyntaxKind.VoidExpression: return visitor.visitVoidExpression(element); case SyntaxKind.ConditionalExpression: return visitor.visitConditionalExpression(element); - case SyntaxKind.MultiplyExpression: case SyntaxKind.DivideExpression: case SyntaxKind.ModuloExpression: case SyntaxKind.AddExpression: case SyntaxKind.SubtractExpression: case SyntaxKind.LeftShiftExpression: case SyntaxKind.SignedRightShiftExpression: case SyntaxKind.UnsignedRightShiftExpression: case SyntaxKind.LessThanExpression: case SyntaxKind.GreaterThanExpression: case SyntaxKind.LessThanOrEqualExpression: case SyntaxKind.GreaterThanOrEqualExpression: case SyntaxKind.InstanceOfExpression: case SyntaxKind.InExpression: case SyntaxKind.EqualsWithTypeConversionExpression: case SyntaxKind.NotEqualsWithTypeConversionExpression: case SyntaxKind.EqualsExpression: case SyntaxKind.NotEqualsExpression: case SyntaxKind.BitwiseAndExpression: case SyntaxKind.BitwiseExclusiveOrExpression: case SyntaxKind.BitwiseOrExpression: case SyntaxKind.LogicalAndExpression: case SyntaxKind.LogicalOrExpression: case SyntaxKind.OrAssignmentExpression: case SyntaxKind.AndAssignmentExpression: case SyntaxKind.ExclusiveOrAssignmentExpression: case SyntaxKind.LeftShiftAssignmentExpression: case SyntaxKind.SignedRightShiftAssignmentExpression: case SyntaxKind.UnsignedRightShiftAssignmentExpression: case SyntaxKind.AddAssignmentExpression: case SyntaxKind.SubtractAssignmentExpression: case SyntaxKind.MultiplyAssignmentExpression: case SyntaxKind.DivideAssignmentExpression: case SyntaxKind.ModuloAssignmentExpression: case SyntaxKind.AssignmentExpression: case SyntaxKind.CommaExpression: - return visitor.visitBinaryExpression(element); - case SyntaxKind.PostIncrementExpression: case SyntaxKind.PostDecrementExpression: - return visitor.visitPostfixUnaryExpression(element); + case SyntaxKind.BinaryExpression: return visitor.visitBinaryExpression(element); + case SyntaxKind.PostfixUnaryExpression: return visitor.visitPostfixUnaryExpression(element); case SyntaxKind.MemberAccessExpression: return visitor.visitMemberAccessExpression(element); case SyntaxKind.InvocationExpression: return visitor.visitInvocationExpression(element); case SyntaxKind.ArrayLiteralExpression: return visitor.visitArrayLiteralExpression(element); @@ -72,20 +70,23 @@ module TypeScript { case SyntaxKind.ElementAccessExpression: return visitor.visitElementAccessExpression(element); case SyntaxKind.FunctionExpression: return visitor.visitFunctionExpression(element); case SyntaxKind.OmittedExpression: return visitor.visitOmittedExpression(element); + case SyntaxKind.TemplateExpression: return visitor.visitTemplateExpression(element); + case SyntaxKind.TemplateAccessExpression: return visitor.visitTemplateAccessExpression(element); + case SyntaxKind.YieldExpression: return visitor.visitYieldExpression(element); case SyntaxKind.VariableDeclaration: return visitor.visitVariableDeclaration(element); case SyntaxKind.VariableDeclarator: return visitor.visitVariableDeclarator(element); case SyntaxKind.ArgumentList: return visitor.visitArgumentList(element); case SyntaxKind.ParameterList: return visitor.visitParameterList(element); case SyntaxKind.TypeArgumentList: return visitor.visitTypeArgumentList(element); case SyntaxKind.TypeParameterList: return visitor.visitTypeParameterList(element); - case SyntaxKind.ExtendsHeritageClause: case SyntaxKind.ImplementsHeritageClause: - return visitor.visitHeritageClause(element); + case SyntaxKind.HeritageClause: return visitor.visitHeritageClause(element); case SyntaxKind.EqualsValueClause: return visitor.visitEqualsValueClause(element); case SyntaxKind.CaseSwitchClause: return visitor.visitCaseSwitchClause(element); case SyntaxKind.DefaultSwitchClause: return visitor.visitDefaultSwitchClause(element); case SyntaxKind.ElseClause: return visitor.visitElseClause(element); case SyntaxKind.CatchClause: return visitor.visitCatchClause(element); case SyntaxKind.FinallyClause: return visitor.visitFinallyClause(element); + case SyntaxKind.TemplateClause: return visitor.visitTemplateClause(element); case SyntaxKind.TypeParameter: return visitor.visitTypeParameter(element); case SyntaxKind.Constraint: return visitor.visitConstraint(element); case SyntaxKind.SimplePropertyAssignment: return visitor.visitSimplePropertyAssignment(element); @@ -93,11 +94,11 @@ module TypeScript { case SyntaxKind.Parameter: return visitor.visitParameter(element); case SyntaxKind.EnumElement: return visitor.visitEnumElement(element); case SyntaxKind.TypeAnnotation: return visitor.visitTypeAnnotation(element); + case SyntaxKind.ComputedPropertyName: return visitor.visitComputedPropertyName(element); case SyntaxKind.ExternalModuleReference: return visitor.visitExternalModuleReference(element); case SyntaxKind.ModuleNameModuleReference: return visitor.visitModuleNameModuleReference(element); + default: return visitor.visitToken(element); } - - throw Errors.invalidOperation(); } export interface ISyntaxVisitor { @@ -111,6 +112,8 @@ module TypeScript { visitGenericType(node: GenericTypeSyntax): any; visitTypeQuery(node: TypeQuerySyntax): any; visitTupleType(node: TupleTypeSyntax): any; + visitUnionType(node: UnionTypeSyntax): any; + visitParenthesizedType(node: ParenthesizedTypeSyntax): any; visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): any; visitFunctionDeclaration(node: FunctionDeclarationSyntax): any; visitModuleDeclaration(node: ModuleDeclarationSyntax): any; @@ -166,6 +169,9 @@ module TypeScript { visitElementAccessExpression(node: ElementAccessExpressionSyntax): any; visitFunctionExpression(node: FunctionExpressionSyntax): any; visitOmittedExpression(node: OmittedExpressionSyntax): any; + visitTemplateExpression(node: TemplateExpressionSyntax): any; + visitTemplateAccessExpression(node: TemplateAccessExpressionSyntax): any; + visitYieldExpression(node: YieldExpressionSyntax): any; visitVariableDeclaration(node: VariableDeclarationSyntax): any; visitVariableDeclarator(node: VariableDeclaratorSyntax): any; visitArgumentList(node: ArgumentListSyntax): any; @@ -179,6 +185,7 @@ module TypeScript { visitElseClause(node: ElseClauseSyntax): any; visitCatchClause(node: CatchClauseSyntax): any; visitFinallyClause(node: FinallyClauseSyntax): any; + visitTemplateClause(node: TemplateClauseSyntax): any; visitTypeParameter(node: TypeParameterSyntax): any; visitConstraint(node: ConstraintSyntax): any; visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any; @@ -186,6 +193,7 @@ module TypeScript { visitParameter(node: ParameterSyntax): any; visitEnumElement(node: EnumElementSyntax): any; visitTypeAnnotation(node: TypeAnnotationSyntax): any; + visitComputedPropertyName(node: ComputedPropertyNameSyntax): any; visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any; visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any; } diff --git a/src/services/syntax/syntaxWalker.generated.ts b/src/services/syntax/syntaxWalker.generated.ts index 7b335709853..7a095aec157 100644 --- a/src/services/syntax/syntaxWalker.generated.ts +++ b/src/services/syntax/syntaxWalker.generated.ts @@ -5,53 +5,17 @@ module TypeScript { public visitToken(token: ISyntaxToken): void { } - public visitNode(node: ISyntaxNode): void { - visitNodeOrToken(this, node); - } - - public visitNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { - if (isToken(nodeOrToken)) { - this.visitToken(nodeOrToken); - } - else { - this.visitNode(nodeOrToken); - } - } - private visitOptionalToken(token: ISyntaxToken): void { - if (token === null) { + if (token === undefined) { return; } this.visitToken(token); } - public visitOptionalNode(node: ISyntaxNode): void { - if (node === null) { - return; - } - - this.visitNode(node); - } - - public visitOptionalNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { - if (nodeOrToken === null) { - return; - } - - this.visitNodeOrToken(nodeOrToken); - } - public visitList(list: ISyntaxNodeOrToken[]): void { for (var i = 0, n = list.length; i < n; i++) { - this.visitNodeOrToken(list[i]); - } - } - - public visitSeparatedList(list: ISyntaxNodeOrToken[]): void { - for (var i = 0, n = childCount(list); i < n; i++) { - var item = childAt(list, i); - this.visitNodeOrToken(item); + visitNodeOrToken(this, list[i]); } } @@ -61,77 +25,88 @@ module TypeScript { } public visitQualifiedName(node: QualifiedNameSyntax): void { - this.visitNodeOrToken(node.left); + visitNodeOrToken(this, node.left); this.visitToken(node.dotToken); this.visitToken(node.right); } public visitObjectType(node: ObjectTypeSyntax): void { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); + this.visitList(node.typeMembers); this.visitToken(node.closeBraceToken); } public visitFunctionType(node: FunctionTypeSyntax): void { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + visitNodeOrToken(this, node.typeParameterList); + visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); } public visitArrayType(node: ArrayTypeSyntax): void { - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); this.visitToken(node.openBracketToken); this.visitToken(node.closeBracketToken); } public visitConstructorType(node: ConstructorTypeSyntax): void { this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + visitNodeOrToken(this, node.typeParameterList); + visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); } public visitGenericType(node: GenericTypeSyntax): void { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); + visitNodeOrToken(this, node.name); + visitNodeOrToken(this, node.typeArgumentList); } public visitTypeQuery(node: TypeQuerySyntax): void { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); + visitNodeOrToken(this, node.name); } public visitTupleType(node: TupleTypeSyntax): void { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.types); + this.visitList(node.types); this.visitToken(node.closeBracketToken); } + public visitUnionType(node: UnionTypeSyntax): void { + visitNodeOrToken(this, node.left); + this.visitToken(node.barToken); + visitNodeOrToken(this, node.right); + } + + public visitParenthesizedType(node: ParenthesizedTypeSyntax): void { + this.visitToken(node.openParenToken); + visitNodeOrToken(this, node.type); + this.visitToken(node.closeParenToken); + } + public visitInterfaceDeclaration(node: InterfaceDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.interfaceKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); - this.visitNode(node.body); + visitNodeOrToken(this, node.body); } public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.functionKeyword); + this.visitOptionalToken(node.asterixToken); this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitModuleDeclaration(node: ModuleDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); - this.visitOptionalToken(node.stringLiteral); + visitNodeOrToken(this, node.name); this.visitToken(node.openBraceToken); this.visitList(node.moduleElements); this.visitToken(node.closeBraceToken); @@ -141,7 +116,7 @@ module TypeScript { this.visitList(node.modifiers); this.visitToken(node.classKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); this.visitToken(node.openBraceToken); this.visitList(node.classElements); @@ -153,7 +128,7 @@ module TypeScript { this.visitToken(node.enumKeyword); this.visitToken(node.identifier); this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); + this.visitList(node.enumElements); this.visitToken(node.closeBraceToken); } @@ -162,7 +137,7 @@ module TypeScript { this.visitToken(node.importKeyword); this.visitToken(node.identifier); this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); + visitNodeOrToken(this, node.moduleReference); this.visitOptionalToken(node.semicolonToken); } @@ -175,76 +150,75 @@ module TypeScript { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); + this.visitOptionalToken(node.asterixToken); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); + visitNodeOrToken(this, node.variableDeclarator); this.visitOptionalToken(node.semicolonToken); } public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void { this.visitList(node.modifiers); this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.body); } public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitNode(node.indexSignature); + visitNodeOrToken(this, node.indexSignature); this.visitOptionalToken(node.semicolonToken); } public visitGetAccessor(node: GetAccessorSyntax): void { this.visitList(node.modifiers); this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.block); } public visitSetAccessor(node: SetAccessorSyntax): void { this.visitList(node.modifiers); this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.block); } public visitPropertySignature(node: PropertySignatureSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeAnnotation); } public visitCallSignature(node: CallSignatureSyntax): void { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeParameterList); + visitNodeOrToken(this, node.parameterList); + visitNodeOrToken(this, node.typeAnnotation); } public visitConstructSignature(node: ConstructSignatureSyntax): void { this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); + visitNodeOrToken(this, node.callSignature); } public visitIndexSignature(node: IndexSignatureSyntax): void { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeAnnotation); } public visitMethodSignature(node: MethodSignatureSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); + visitNodeOrToken(this, node.callSignature); } public visitBlock(node: BlockSyntax): void { @@ -256,33 +230,33 @@ module TypeScript { public visitIfStatement(node: IfStatementSyntax): void { this.visitToken(node.ifKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); + visitNodeOrToken(this, node.statement); + visitNodeOrToken(this, node.elseClause); } public visitVariableStatement(node: VariableStatementSyntax): void { this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); + visitNodeOrToken(this, node.variableDeclaration); this.visitOptionalToken(node.semicolonToken); } public visitExpressionStatement(node: ExpressionStatementSyntax): void { - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); } public visitReturnStatement(node: ReturnStatementSyntax): void { this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); } public visitSwitchStatement(node: SwitchStatementSyntax): void { this.visitToken(node.switchKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); this.visitToken(node.openBraceToken); this.visitList(node.switchClauses); @@ -304,25 +278,23 @@ module TypeScript { public visitForStatement(node: ForStatementSyntax): void { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); + visitNodeOrToken(this, node.initializer); this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); + visitNodeOrToken(this, node.incrementor); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitForInStatement(node: ForInStatementSyntax): void { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); + visitNodeOrToken(this, node.left); this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.right); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitEmptyStatement(node: EmptyStatementSyntax): void { @@ -331,37 +303,37 @@ module TypeScript { public visitThrowStatement(node: ThrowStatementSyntax): void { this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); } public visitWhileStatement(node: WhileStatementSyntax): void { this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitTryStatement(node: TryStatementSyntax): void { this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); + visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.catchClause); + visitNodeOrToken(this, node.finallyClause); } public visitLabeledStatement(node: LabeledStatementSyntax): void { this.visitToken(node.identifier); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitDoStatement(node: DoStatementSyntax): void { this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); this.visitOptionalToken(node.semicolonToken); } @@ -374,172 +346,187 @@ module TypeScript { public visitWithStatement(node: WithStatementSyntax): void { this.visitToken(node.withKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitPrefixUnaryExpression(node: PrefixUnaryExpressionSyntax): void { this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); + visitNodeOrToken(this, node.operand); } public visitDeleteExpression(node: DeleteExpressionSyntax): void { this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitTypeOfExpression(node: TypeOfExpressionSyntax): void { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitVoidExpression(node: VoidExpressionSyntax): void { this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitConditionalExpression(node: ConditionalExpressionSyntax): void { - this.visitNodeOrToken(node.condition); + visitNodeOrToken(this, node.condition); this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); + visitNodeOrToken(this, node.whenTrue); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); + visitNodeOrToken(this, node.whenFalse); } public visitBinaryExpression(node: BinaryExpressionSyntax): void { - this.visitNodeOrToken(node.left); + visitNodeOrToken(this, node.left); this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); + visitNodeOrToken(this, node.right); } public visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): void { - this.visitNodeOrToken(node.operand); + visitNodeOrToken(this, node.operand); this.visitToken(node.operatorToken); } public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): void { - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.dotToken); this.visitToken(node.name); } public visitInvocationExpression(node: InvocationExpressionSyntax): void { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); + visitNodeOrToken(this, node.expression); + visitNodeOrToken(this, node.argumentList); } public visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): void { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); + this.visitList(node.expressions); this.visitToken(node.closeBracketToken); } public visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): void { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); + this.visitList(node.propertyAssignments); this.visitToken(node.closeBraceToken); } public visitObjectCreationExpression(node: ObjectCreationExpressionSyntax): void { this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); + visitNodeOrToken(this, node.expression); + visitNodeOrToken(this, node.argumentList); } public visitParenthesizedExpression(node: ParenthesizedExpressionSyntax): void { this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); } public visitParenthesizedArrowFunctionExpression(node: ParenthesizedArrowFunctionExpressionSyntax): void { - this.visitNode(node.callSignature); + visitNodeOrToken(this, node.callSignature); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + visitNodeOrToken(this, node.body); } public visitSimpleArrowFunctionExpression(node: SimpleArrowFunctionExpressionSyntax): void { - this.visitNode(node.parameter); + visitNodeOrToken(this, node.parameter); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + visitNodeOrToken(this, node.body); } public visitCastExpression(node: CastExpressionSyntax): void { this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitElementAccessExpression(node: ElementAccessExpressionSyntax): void { - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); + visitNodeOrToken(this, node.argumentExpression); this.visitToken(node.closeBracketToken); } public visitFunctionExpression(node: FunctionExpressionSyntax): void { this.visitToken(node.functionKeyword); + this.visitOptionalToken(node.asterixToken); this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.block); } public visitOmittedExpression(node: OmittedExpressionSyntax): void { } + public visitTemplateExpression(node: TemplateExpressionSyntax): void { + this.visitToken(node.templateStartToken); + this.visitList(node.templateClauses); + } + + public visitTemplateAccessExpression(node: TemplateAccessExpressionSyntax): void { + visitNodeOrToken(this, node.expression); + visitNodeOrToken(this, node.templateExpression); + } + + public visitYieldExpression(node: YieldExpressionSyntax): void { + this.visitToken(node.yieldKeyword); + this.visitOptionalToken(node.asterixToken); + visitNodeOrToken(this, node.expression); + } + public visitVariableDeclaration(node: VariableDeclarationSyntax): void { this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); + this.visitList(node.variableDeclarators); } public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.typeAnnotation); + visitNodeOrToken(this, node.equalsValueClause); } public visitArgumentList(node: ArgumentListSyntax): void { - this.visitOptionalNode(node.typeArgumentList); + visitNodeOrToken(this, node.typeArgumentList); this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); + this.visitList(node.arguments); this.visitToken(node.closeParenToken); } public visitParameterList(node: ParameterListSyntax): void { this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeParenToken); } public visitTypeArgumentList(node: TypeArgumentListSyntax): void { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); + this.visitList(node.typeArguments); this.visitToken(node.greaterThanToken); } public visitTypeParameterList(node: TypeParameterListSyntax): void { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); + this.visitList(node.typeParameters); this.visitToken(node.greaterThanToken); } public visitHeritageClause(node: HeritageClauseSyntax): void { this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); + this.visitList(node.typeNames); } public visitEqualsValueClause(node: EqualsValueClauseSyntax): void { this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); + visitNodeOrToken(this, node.value); } public visitCaseSwitchClause(node: CaseSwitchClauseSyntax): void { this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); this.visitToken(node.colonToken); this.visitList(node.statements); } @@ -552,43 +539,49 @@ module TypeScript { public visitElseClause(node: ElseClauseSyntax): void { this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); + visitNodeOrToken(this, node.statement); } public visitCatchClause(node: CatchClauseSyntax): void { this.visitToken(node.catchKeyword); this.visitToken(node.openParenToken); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); + visitNodeOrToken(this, node.typeAnnotation); this.visitToken(node.closeParenToken); - this.visitNode(node.block); + visitNodeOrToken(this, node.block); } public visitFinallyClause(node: FinallyClauseSyntax): void { this.visitToken(node.finallyKeyword); - this.visitNode(node.block); + visitNodeOrToken(this, node.block); + } + + public visitTemplateClause(node: TemplateClauseSyntax): void { + visitNodeOrToken(this, node.expression); + this.visitToken(node.templateMiddleOrEndToken); } public visitTypeParameter(node: TypeParameterSyntax): void { this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); + visitNodeOrToken(this, node.constraint); } public visitConstraint(node: ConstraintSyntax): void { this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.typeOrExpression); + visitNodeOrToken(this, node.typeOrExpression); } public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); + visitNodeOrToken(this, node.expression); } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + this.visitOptionalToken(node.asterixToken); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.callSignature); + visitNodeOrToken(this, node.block); } public visitParameter(node: ParameterSyntax): void { @@ -596,18 +589,24 @@ module TypeScript { this.visitList(node.modifiers); this.visitToken(node.identifier); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + visitNodeOrToken(this, node.typeAnnotation); + visitNodeOrToken(this, node.equalsValueClause); } public visitEnumElement(node: EnumElementSyntax): void { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); + visitNodeOrToken(this, node.propertyName); + visitNodeOrToken(this, node.equalsValueClause); } public visitTypeAnnotation(node: TypeAnnotationSyntax): void { this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); + visitNodeOrToken(this, node.type); + } + + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { + this.visitToken(node.openBracketToken); + visitNodeOrToken(this, node.expression); + this.visitToken(node.closeBracketToken); } public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): void { @@ -618,7 +617,7 @@ module TypeScript { } public visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): void { - this.visitNodeOrToken(node.moduleName); + visitNodeOrToken(this, node.moduleName); } } } \ No newline at end of file diff --git a/src/services/syntax/testUtilities.ts b/src/services/syntax/testUtilities.ts index 2dd0055e068..8da87eb1358 100644 --- a/src/services/syntax/testUtilities.ts +++ b/src/services/syntax/testUtilities.ts @@ -1,18 +1,18 @@ module TypeScript { function assertParent(parent: ISyntaxElement, child: ISyntaxElement) { - if (child && !TypeScript.isShared(child)) { + if (child) { return Debug.assert(parent === child.parent); } } export function nodeStructuralEquals(node1: TypeScript.ISyntaxNode, node2: TypeScript.ISyntaxNode, checkParents: boolean, text1: ISimpleText, text2: ISimpleText): boolean { if (node1 === node2) { return true; } - if (node1 === null || node2 === null) { return false; } + if (!node1 || !node2) { return false; } - Debug.assert(node1.kind() === TypeScript.SyntaxKind.SourceUnit || node1.parent); - Debug.assert(node2.kind() === TypeScript.SyntaxKind.SourceUnit || node2.parent); + Debug.assert(node1.kind === TypeScript.SyntaxKind.SourceUnit || node1.parent); + Debug.assert(node2.kind === TypeScript.SyntaxKind.SourceUnit || node2.parent); - if (node1.kind() !== node2.kind()) { return false; } + if (node1.kind !== node2.kind) { return false; } if (childCount(node1) !== childCount(node2)) { return false; } for (var i = 0, n = childCount(node1); i < n; i++) { @@ -37,12 +37,12 @@ module TypeScript { return true; } - if (node1 === null || node2 === null) { + if (!node1 || !node2) { return false; } - Debug.assert(node1.kind() === TypeScript.SyntaxKind.SourceUnit || node1.parent); - Debug.assert(node2.kind() === TypeScript.SyntaxKind.SourceUnit || node2.parent); + Debug.assert(node1.kind === TypeScript.SyntaxKind.SourceUnit || node1.parent); + Debug.assert(node2.kind === TypeScript.SyntaxKind.SourceUnit || node2.parent); if (TypeScript.isToken(node1)) { return TypeScript.isToken(node2) ? tokenStructuralEquals(node1, node2, text1, text2) : false; @@ -56,23 +56,21 @@ module TypeScript { return true; } - if (token1 === null || token2 === null) { + if (!token1 || !token2) { return false; } Debug.assert(token1.parent); Debug.assert(token2.parent); - return token1.kind() === token2.kind() && + return token1.kind === token2.kind && TypeScript.width(token1) === TypeScript.width(token2) && token1.fullWidth() === token2.fullWidth() && token1.fullStart() === token2.fullStart() && TypeScript.fullEnd(token1) === TypeScript.fullEnd(token2) && TypeScript.start(token1, text1) === TypeScript.start(token2, text2) && - TypeScript.end(token1, text1) === TypeScript.end(token2, text2) && token1.text() === token2.text() && - triviaListStructuralEquals(token1.leadingTrivia(text1), token2.leadingTrivia(text2)) && - triviaListStructuralEquals(token1.trailingTrivia(text1), token2.trailingTrivia(text2)); + triviaListStructuralEquals(token1.leadingTrivia(text1), token2.leadingTrivia(text2)); } export function triviaListStructuralEquals(triviaList1: TypeScript.ISyntaxTriviaList, triviaList2: TypeScript.ISyntaxTriviaList): boolean { @@ -102,8 +100,8 @@ module TypeScript { } function listStructuralEquals(list1: T[], list2: T[], checkParents: boolean, text1: ISimpleText, text2: ISimpleText): boolean { - Debug.assert(TypeScript.isShared(list1) || list1.parent); - Debug.assert(TypeScript.isShared(list2) || list2.parent); + Debug.assert(list1.parent); + Debug.assert(list2.parent); if (childCount(list1) !== childCount(list2)) { return false; @@ -118,32 +116,7 @@ module TypeScript { assertParent(list2, child2); } - if (!nodeOrTokenStructuralEquals(child1, child2, checkParents, text1, text2)) { - return false; - } - } - - return true; - } - - function separatedListStructuralEquals(list1: T[], list2: T[], checkParents: boolean, text1: ISimpleText, text2: ISimpleText): boolean { - Debug.assert(TypeScript.isShared(list1) || list1.parent); - Debug.assert(TypeScript.isShared(list2) || list2.parent); - - if (childCount(list1) !== childCount(list2)) { - return false; - } - - for (var i = 0, n = childCount(list1); i < n; i++) { - var element1 = childAt(list1, i); - var element2 = childAt(list2, i); - - if (checkParents) { - assertParent(list1, element1); - assertParent(list2, element2); - } - - if (!nodeOrTokenStructuralEquals(element1, element2, checkParents, text1, text2)) { + if (!elementStructuralEquals(child1, child2, checkParents, text1, text2)) { return false; } } @@ -156,14 +129,14 @@ module TypeScript { return true; } - if (element1 === null || element2 === null) { + if (!element1 || !element2) { return false; } - Debug.assert(element1.kind() === SyntaxKind.SourceUnit || element1.parent); - Debug.assert(element2.kind() === SyntaxKind.SourceUnit || element2.parent); + Debug.assert(element1.kind === SyntaxKind.SourceUnit || element1.parent); + Debug.assert(element2.kind === SyntaxKind.SourceUnit || element2.parent); - if (element2.kind() !== element2.kind()) { + if (element2.kind !== element2.kind) { return false; } @@ -175,10 +148,6 @@ module TypeScript { return false; } - if (TypeScript.end(element1) !== TypeScript.end(element2)) { - return false; - } - if (TypeScript.fullEnd(element1) !== TypeScript.fullEnd(element2)) { return false; } @@ -192,9 +161,6 @@ module TypeScript { else if (TypeScript.isList(element1)) { return listStructuralEquals(element1, element2, checkParents, text1, text2); } - else if (TypeScript.isSeparatedList(element1)) { - return separatedListStructuralEquals(element1, element2, checkParents, text1, text2); - } throw TypeScript.Errors.invalidOperation(); } diff --git a/src/services/syntax/utilities.generated.ts b/src/services/syntax/utilities.generated.ts new file mode 100644 index 00000000000..a01618fae48 --- /dev/null +++ b/src/services/syntax/utilities.generated.ts @@ -0,0 +1,4 @@ + var fixedWidthArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 8, 8, 7, 6, 2, 4, 5, 7, 3, 8, 2, 2, 10, 3, 4, 6, 6, 4, 5, 4, 3, 6, 3, 4, 5, 4, 5, 5, 4, 6, 7, 6, 5, 10, 9, 3, 7, 7, 9, 6, 6, 5, 3, 7, 11, 7, 3, 6, 7, 6, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 1, 2]; + function fixedWidthTokenLength(kind: SyntaxKind) { + return fixedWidthArray[kind]; + } diff --git a/src/services/text/characterCodes.ts b/src/services/text/characterCodes.ts index 040e0c41c6b..91d500f1749 100644 --- a/src/services/text/characterCodes.ts +++ b/src/services/text/characterCodes.ts @@ -104,6 +104,7 @@ module TypeScript { asterisk = 42, // * at = 64, // @ backslash = 92, // \ + backtick = 96, // ` bar = 124, // | caret = 94, // ^ closeBrace = 125, // } diff --git a/src/services/text/scriptSnapshot.ts b/src/services/text/scriptSnapshot.ts index 574657f6c40..4e61d131cec 100644 --- a/src/services/text/scriptSnapshot.ts +++ b/src/services/text/scriptSnapshot.ts @@ -32,7 +32,7 @@ module TypeScript { export module ScriptSnapshot { class StringScriptSnapshot implements IScriptSnapshot { - private _lineStartPositions: number[] = null; + private _lineStartPositions: number[] = undefined; constructor(private text: string) { } diff --git a/src/services/text/textFactory.ts b/src/services/text/textFactory.ts index 21d215c291e..c32aa3adfaf 100644 --- a/src/services/text/textFactory.ts +++ b/src/services/text/textFactory.ts @@ -2,7 +2,7 @@ module TypeScript.SimpleText { class SimpleStringText implements ISimpleText { - private _lineMap: LineMap = null; + private _lineMap: LineMap = undefined; constructor(private value: string) { } @@ -12,7 +12,10 @@ module TypeScript.SimpleText { } public substr(start: number, length: number): string { - return this.value.substr(start, length); + var val = this.value; + return start === 0 && length == val.length + ? val + : val.substr(start, length); } public charCodeAt(index: number): number { @@ -30,7 +33,7 @@ module TypeScript.SimpleText { // Class which wraps a host IScriptSnapshot and exposes an ISimpleText for newer compiler code. class SimpleScriptSnapshotText implements ISimpleText { - private _lineMap: LineMap = null; + private _lineMap: LineMap = undefined; constructor(public scriptSnapshot: IScriptSnapshot) { } @@ -48,7 +51,7 @@ module TypeScript.SimpleText { } public lineMap(): LineMap { - if (this._lineMap === null) { + if (!this._lineMap) { this._lineMap = new LineMap(() => this.scriptSnapshot.getLineStartPositions(), this.length()); } diff --git a/src/services/text/textSpan.ts b/src/services/text/textSpan.ts index 999070a73b4..9ecef2b95fa 100644 --- a/src/services/text/textSpan.ts +++ b/src/services/text/textSpan.ts @@ -79,7 +79,7 @@ module TypeScript { } /** - * Returns the overlap with the given span, or null if there is no overlap. + * Returns the overlap with the given span, or undefined if there is no overlap. * @param span The span to check. */ public overlap(span: TextSpan): TextSpan { @@ -90,7 +90,7 @@ module TypeScript { return TextSpan.fromBounds(overlapStart, overlapEnd); } - return null; + return undefined; } /** @@ -119,7 +119,7 @@ module TypeScript { } /** - * Returns the intersection with the given span, or null if there is no intersection. + * Returns the intersection with the given span, or undefined if there is no intersection. * @param span The span to check. */ public intersection(span: TextSpan): TextSpan { @@ -130,7 +130,7 @@ module TypeScript { return TextSpan.fromBounds(intersectStart, intersectEnd); } - return null; + return undefined; } /** diff --git a/src/services/utilities.ts b/src/services/utilities.ts index ca17b704d05..8620f8d1920 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -5,8 +5,77 @@ module ts { list: Node; } + export function getEndLinePosition(line: number, sourceFile: SourceFile): number { + Debug.assert(line >= 1); + var lineStarts = sourceFile.getLineStarts(); + + // lines returned by SourceFile.getLineAndCharacterForPosition are 1-based + var lineIndex = line - 1; + if (lineIndex === lineStarts.length - 1) { + // last line - return EOF + return sourceFile.text.length - 1; + } + else { + // current line start + var start = lineStarts[lineIndex]; + // take the start position of the next line -1 = it should be some line break + var pos = lineStarts[lineIndex + 1] - 1; + Debug.assert(isLineBreak(sourceFile.text.charCodeAt(pos))); + // walk backwards skipping line breaks, stop the the beginning of current line. + // i.e: + // + // $ <- end of line for this position should match the start position + while (start <= pos && isLineBreak(sourceFile.text.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + + export function getStartPositionOfLine(line: number, sourceFile: SourceFile): number { + Debug.assert(line >= 1); + return sourceFile.getLineStarts()[line - 1]; + } + + export function getStartLinePositionForPosition(position: number, sourceFile: SourceFile): number { + var lineStarts = sourceFile.getLineStarts(); + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + return lineStarts[line - 1]; + } + + export function rangeContainsRange(r1: TextRange, r2: TextRange): boolean { + return startEndContainsRange(r1.pos, r1.end, r2); + } + + export function startEndContainsRange(start: number, end: number, range: TextRange): boolean { + return start <= range.pos && end >= range.end; + } + + export function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean { + return range.pos <= start && range.end >= end; + } + + export function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number) { + return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); + } + + export function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number) { + var start = Math.max(start1, start2); + var end = Math.min(end1, end2); + return start < end; + } + export function findListItemInfo(node: Node): ListItemInfo { var syntaxList = findContainingList(node); + + // It is possible at this point for syntaxList to be undefined, either if + // node.parent had no list child, or if none of its list children contained + // the span of node. If this happens, return undefined. The caller should + // handle this case. + if (!syntaxList) { + return undefined; + } + var children = syntaxList.getChildren(); var index = indexOf(children, node); @@ -32,13 +101,6 @@ module ts { } }); - // syntaxList should not be undefined here. If it is, there is a problem. Find out if - // there at least is a child that is a list. - if (!syntaxList) { - Debug.assert(findChildOfKind(node.parent, SyntaxKind.SyntaxList), - "Node of kind " + SyntaxKind[node.parent.kind] + " has no list children"); - } - return syntaxList; } @@ -61,14 +123,14 @@ module ts { * position >= start and (position < end or (position === end && token is keyword or identifier)) */ export function getTouchingWord(sourceFile: SourceFile, position: number): Node { - return getTouchingToken(sourceFile, position, isWord); + return getTouchingToken(sourceFile, position, n => isWord(n.kind)); } /* Gets the token whose text has range [start, end) and position >= start * and (position < end or (position === end && token is keyword or identifier or numeric\string litera)) */ export function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node { - return getTouchingToken(sourceFile, position, isPropertyName); + return getTouchingToken(sourceFile, position, n => isPropertyName(n.kind)); } /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ @@ -95,11 +157,12 @@ module ts { var child = current.getChildAt(i); var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); if (start <= position) { - if (position < child.getEnd()) { + var end = child.getEnd(); + if (position < end || (position === end && child.kind === SyntaxKind.EndOfFileToken)) { current = child; continue outer; } - else if (includeItemAtEndPosition && child.getEnd() === position) { + else if (includeItemAtEndPosition && end === position) { var previousToken = findPrecedingToken(position, sourceFile, child); if (previousToken && includeItemAtEndPosition(previousToken)) { return previousToken; @@ -180,7 +243,7 @@ module ts { for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; if (nodeHasTokens(child)) { - if (position < child.end) { + if (position <= child.end) { if (child.getStart(sourceFile) >= position) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); @@ -194,7 +257,7 @@ module ts { } } - Debug.assert(startNode || n.kind === SyntaxKind.SourceFile); + Debug.assert(startNode !== undefined || n.kind === SyntaxKind.SourceFile); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. @@ -217,25 +280,22 @@ module ts { } function nodeHasTokens(n: Node): boolean { - if (n.kind === SyntaxKind.ExpressionStatement) { - return nodeHasTokens((n).expression); - } - - if (n.kind === SyntaxKind.EndOfFileToken || n.kind === SyntaxKind.OmittedExpression || n.kind === SyntaxKind.Missing) { + if (n.kind === SyntaxKind.Unknown) { return false; } - // SyntaxList is already realized so getChildCount should be fast and non-expensive - return n.kind !== SyntaxKind.SyntaxList || n.getChildCount() !== 0; + // If we have a token or node that has a non-zero width, it must have tokens. + // Note, that getWidth() does not take trivia into account. + return n.getWidth() !== 0; } - export function getTypeArgumentOrTypeParameterList(node: Node): NodeArray { + export function getTypeArgumentOrTypeParameterList(node: Node): NodeArray { if (node.kind === SyntaxKind.TypeReference || node.kind === SyntaxKind.CallExpression) { return (node).typeArguments; } if (isAnyFunction(node) || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.InterfaceDeclaration) { - return (node).typeParameters; + return (node).typeParameters; } return undefined; @@ -245,19 +305,19 @@ module ts { return n.kind >= SyntaxKind.FirstToken && n.kind <= SyntaxKind.LastToken; } - function isWord(n: Node): boolean { - return n.kind === SyntaxKind.Identifier || isKeyword(n.kind); + function isWord(kind: SyntaxKind): boolean { + return kind === SyntaxKind.Identifier || isKeyword(kind); } - function isPropertyName(n: Node): boolean { - return n.kind === SyntaxKind.StringLiteral || n.kind === SyntaxKind.NumericLiteral || isWord(n); + function isPropertyName(kind: SyntaxKind): boolean { + return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || isWord(kind); } - export function isComment(n: Node): boolean { - return n.kind === SyntaxKind.SingleLineCommentTrivia || n.kind === SyntaxKind.MultiLineCommentTrivia; + export function isComment(kind: SyntaxKind): boolean { + return kind === SyntaxKind.SingleLineCommentTrivia || kind === SyntaxKind.MultiLineCommentTrivia; } - export function isPunctuation(n: Node): boolean { - return SyntaxKind.FirstPunctuation <= n.kind && n.kind <= SyntaxKind.LastPunctuation; + export function isPunctuation(kind: SyntaxKind): boolean { + return SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation; } } \ No newline at end of file diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt index a3e8acd7d17..22fdeb099bc 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt @@ -6,10 +6,10 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS10 tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ==== @@ -21,13 +21,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. public get AnnotatedSetter_SetterLast() { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. public set AnnotatedSetter_SetterLast(a: number) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -39,13 +39,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. public get AnnotatedGetter_GetterLast(): string { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt index 6fca82a677f..4b6255688f8 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2429: Interface 'Bar' incorrectly extends interface 'Foo': - Types of property 'f' are incompatible: +tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. + Types of property 'f' are incompatible. Type '(key: string) => string' is not assignable to type '() => string'. @@ -10,9 +10,9 @@ tests/cases/compiler/addMoreOverloadsToBaseSignature.ts(5,11): error TS2429: Int interface Bar extends Foo { ~~~ -!!! error TS2429: Interface 'Bar' incorrectly extends interface 'Foo': -!!! error TS2429: Types of property 'f' are incompatible: -!!! error TS2429: Type '(key: string) => string' is not assignable to type '() => string'. +!!! error TS2430: Interface 'Bar' incorrectly extends interface 'Foo'. +!!! error TS2430: Types of property 'f' are incompatible. +!!! error TS2430: Type '(key: string) => string' is not assignable to type '() => string'. f(key: string): string; } \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js index f34ac61d86d..1ba54d47f1c 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js @@ -50,12 +50,12 @@ var r3 = null + b; var r4 = null + 1; var r5 = null + c; var r6 = null + 0 /* a */; -var r7 = null + E['a']; +var r7 = null + 0 /* 'a' */; var r8 = b + null; var r9 = 1 + null; var r10 = c + null; var r11 = 0 /* a */ + null; -var r12 = E['a'] + null; +var r12 = 0 /* 'a' */ + null; // null + string var r13 = null + d; var r14 = null + ''; diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js index 63e038265d6..05bca7a4c0c 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js @@ -29,4 +29,4 @@ var r4 = b + b; var r5 = 0 + a; var r6 = 0 /* a */ + 0; var r7 = 0 /* a */ + 1 /* b */; -var r8 = E['a'] + E['b']; +var r8 = 0 /* 'a' */ + 1 /* 'b' */; diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js index a6a1b2ef555..cb89d242a18 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js @@ -50,12 +50,12 @@ var r3 = undefined + b; var r4 = undefined + 1; var r5 = undefined + c; var r6 = undefined + 0 /* a */; -var r7 = undefined + E['a']; +var r7 = undefined + 0 /* 'a' */; var r8 = b + undefined; var r9 = 1 + undefined; var r10 = c + undefined; var r11 = 0 /* a */ + undefined; -var r12 = E['a'] + undefined; +var r12 = 0 /* 'a' */ + undefined; // undefined + string var r13 = undefined + d; var r14 = undefined + ''; diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index 1c49a377356..90a3672780f 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"': +tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. Property 'someClass' is missing in type 'Number'. -tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. +tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. ==== tests/cases/compiler/aliasAssignments_1.ts (2 errors) ==== @@ -8,12 +8,12 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tes var x = moduleA; x = 1; // Should be error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"': +!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. !!! error TS2322: Property 'someClass' is missing in type 'Number'. var y = 1; y = moduleA; // should be error ~ -!!! error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. ==== tests/cases/compiler/aliasAssignments_moduleA.ts (0 errors) ==== export class someClass { diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index dfbb1982ca9..7b2907681e0 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -50,6 +50,7 @@ var VisualizationModel = (function (_super) { })(Backbone.Model); exports.VisualizationModel = VisualizationModel; //// [aliasUsageInIndexerOfClass_main.js] +var moduleA = require("aliasUsageInIndexerOfClass_moduleA"); var N = (function () { function N() { this.x = moduleA; diff --git a/tests/baselines/reference/ambiguousOverload.errors.txt b/tests/baselines/reference/ambiguousOverload.errors.txt index 93d2fe848cc..936e6e71220 100644 --- a/tests/baselines/reference/ambiguousOverload.errors.txt +++ b/tests/baselines/reference/ambiguousOverload.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/ambiguousOverload.ts (2 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is var x: number = foof("s", null); var y: string = foof("s", null); ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. function foof2(bar: string, x): string; function foof2(bar: string, y): number; @@ -17,4 +17,4 @@ tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is var x2: string = foof2("s", null); var y2: number = foof2("s", null); ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSubtyping.errors.txt b/tests/baselines/reference/apparentTypeSubtyping.errors.txt index a9a97c22722..e1a53ef6a73 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.errors.txt +++ b/tests/baselines/reference/apparentTypeSubtyping.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': - Types of property 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtyping.ts(9,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. Type 'String' is not assignable to type 'string'. @@ -14,9 +14,9 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSubtypi // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'String' is not assignable to type 'string'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'String' is not assignable to type 'string'. x: String; } diff --git a/tests/baselines/reference/apparentTypeSupertype.errors.txt b/tests/baselines/reference/apparentTypeSupertype.errors.txt index 78c667541d6..7d653f34bf9 100644 --- a/tests/baselines/reference/apparentTypeSupertype.errors.txt +++ b/tests/baselines/reference/apparentTypeSupertype.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': - Types of property 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSupertype.ts(9,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. Type 'U' is not assignable to type 'string'. @@ -14,8 +14,8 @@ tests/cases/conformance/types/typeRelationships/apparentType/apparentTypeSuperty // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'string'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'string'. x: U; } \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 9d5847a77b0..812bbe15da4 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments': +tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. Property 'length' is missing in type 'Number'. @@ -7,6 +7,6 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'IArguments': +!!! error TS2322: Type 'number' is not assignable to type 'IArguments'. !!! error TS2322: Property 'length' is missing in type 'Number'. } \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index 926bf0d4316..d3a7fafed05 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -1,49 +1,46 @@ -tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1': +tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1'. Property 'IM1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1': +tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1'. Property 'IM1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]': - Type 'C3' is not assignable to type 'I1': +tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. + Type 'C3' is not assignable to type 'I1'. Property 'IM1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]': - Type 'I1' is not assignable to type 'C1': +tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. + Type 'I1' is not assignable to type 'C1'. Property 'C1M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]': - Type 'C3' is not assignable to type 'C1': +tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. + Type 'C3' is not assignable to type 'C1'. Property 'IM1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]': - Type 'C1' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. + Type 'C1' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]': - Type 'I1' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. + Type 'I1' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]': - Type 'C3' is not assignable to type 'C2': +tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. + Type 'C3' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]': - Type 'C2' is not assignable to type 'C3': - Property 'CM3M1' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]': - Type 'C1' is not assignable to type 'C3': - Property 'CM3M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]': - Type 'I1' is not assignable to type 'C3': - Property 'CM3M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. + Type 'C2' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. + Type 'C1' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. + Type 'I1' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. Property 'length' is missing in type '{ one: number; }'. -tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. Property 'length' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. Property 'length' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. Property 'length' is missing in type 'I1'. @@ -95,19 +92,19 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n var i1_error: I1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'I1': +!!! error TS2322: Type 'undefined[]' is not assignable to type 'I1'. !!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. var c1_error: C1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'C1': +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C1'. !!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. var c2_error: C2 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'C2': +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C2'. !!! error TS2322: Property 'C2M1' is missing in type 'undefined[]'. var c3_error: C3 = []; // should be an error - is ~~~~~~~~ -!!! error TS2322: Type 'undefined[]' is not assignable to type 'C3': +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C3'. !!! error TS2322: Property 'CM3M1' is missing in type 'undefined[]'. @@ -121,38 +118,38 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n arr_i1 = arr_c2; // should be ok - subtype relationship - is arr_i1 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]': -!!! error TS2322: Type 'C3' is not assignable to type 'I1': +!!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'I1'. !!! error TS2322: Property 'IM1' is missing in type 'C3'. arr_c1 = arr_c1; // should be ok - subtype relationship - is arr_c1 = arr_c2; // should be ok - subtype relationship - is arr_c1 = arr_i1; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C1': +!!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C1'. !!! error TS2322: Property 'C1M1' is missing in type 'I1'. arr_c1 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]': -!!! error TS2322: Type 'C3' is not assignable to type 'C1': +!!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'C1'. !!! error TS2322: Property 'IM1' is missing in type 'C3'. arr_c2 = arr_c2; // should be ok - subtype relationship - is arr_c2 = arr_c1; // should be an error - subtype relationship - is ~~~~~~ -!!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]': -!!! error TS2322: Type 'C1' is not assignable to type 'C2': +!!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C2'. !!! error TS2322: Property 'C2M1' is missing in type 'C1'. arr_c2 = arr_i1; // should be an error - subtype relationship - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C2': +!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C2'. !!! error TS2322: Property 'C2M1' is missing in type 'I1'. arr_c2 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]': -!!! error TS2322: Type 'C3' is not assignable to type 'C2': +!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'C2'. !!! error TS2322: Property 'C2M1' is missing in type 'C3'. // "clean up bug" occurs at this point @@ -160,42 +157,39 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n // something to do with state from the above propagating forward? arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C2' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. +!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C2' is not assignable to type 'C3'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C1' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C3'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C3': -!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C3'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => C1' is not assignable to type 'any[]': +!!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. !!! error TS2322: Property 'push' is missing in type '() => C1'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': +!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C1' is not assignable to type 'any[]': +!!! error TS2322: Type 'C1' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C2' is not assignable to type 'any[]': +!!! error TS2322: Type 'C2' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C3' is not assignable to type 'any[]': +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'I1' is not assignable to type 'any[]': +!!! error TS2322: Type 'I1' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest2.errors.txt b/tests/baselines/reference/arrayAssignmentTest2.errors.txt index c9364ab555b..a2cc6b3b954 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest2.errors.txt @@ -1,25 +1,25 @@ -tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]': - Type 'C2' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. + Type 'C2' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]': - Type 'C1' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. + Type 'C1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]': - Type 'I1' is not assignable to type 'C3': +tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. + Type 'I1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. Property 'push' is missing in type '() => any'. -tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. Property 'length' is missing in type '{ one: number; }'. -tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. Property 'length' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. Property 'length' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. Property 'length' is missing in type 'I1'. @@ -72,47 +72,47 @@ tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is n // "clean up error" occurs at this point arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C2' is not assignable to type 'C3': +!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C2' is not assignable to type 'C3'. !!! error TS2322: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'C1' is not assignable to type 'C3': +!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C3'. !!! error TS2322: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]': -!!! error TS2322: Type 'I1' is not assignable to type 'C3': +!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C3'. !!! error TS2322: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => C1' is not assignable to type 'any[]': +!!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. !!! error TS2322: Property 'push' is missing in type '() => C1'. arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => any' is not assignable to type 'any[]': +!!! error TS2322: Type '() => any' is not assignable to type 'any[]'. !!! error TS2322: Property 'push' is missing in type '() => any'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]': +!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C1' is not assignable to type 'any[]': +!!! error TS2322: Type 'C1' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C2' is not assignable to type 'any[]': +!!! error TS2322: Type 'C2' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C3' is not assignable to type 'any[]': +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'I1' is not assignable to type 'any[]': +!!! error TS2322: Type 'I1' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest4.errors.txt b/tests/baselines/reference/arrayAssignmentTest4.errors.txt index 0d346e48293..ecded3a3bfd 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2322: Type '() => any' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. Property 'push' is missing in type '() => any'. -tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is not assignable to type 'any[]': +tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. @@ -30,10 +30,10 @@ tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is n arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! error TS2322: Type '() => any' is not assignable to type 'any[]': +!!! error TS2322: Type '() => any' is not assignable to type 'any[]'. !!! error TS2322: Property 'push' is missing in type '() => any'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2322: Type 'C3' is not assignable to type 'any[]': +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index 417430b8e43..3a45cad9ad7 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]': - Type 'IToken' is not assignable to type 'IStateToken': +tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. + Type 'IToken' is not assignable to type 'IStateToken'. Property 'state' is missing in type 'IToken'. @@ -28,8 +28,8 @@ tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[ var lineTokens:ILineTokens= this.tokenize(line, state, true); var tokens:IStateToken[]= lineTokens.tokens; ~~~~~~ -!!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]': -!!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken': +!!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. +!!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken'. !!! error TS2322: Property 'state' is missing in type 'IToken'. if (tokens.length === 0) { return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) diff --git a/tests/baselines/reference/arrayCast.errors.txt b/tests/baselines/reference/arrayCast.errors.txt index 2218bbf5a75..53be1c903a3 100644 --- a/tests/baselines/reference/arrayCast.errors.txt +++ b/tests/baselines/reference/arrayCast.errors.txt @@ -1,6 +1,5 @@ -tests/cases/compiler/arrayCast.ts(3,1): error TS2353: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other: - Type '{ foo: string; }' is not assignable to type '{ id: number; }': - Property 'id' is missing in type '{ foo: string; }'. +tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other. + Type '{ foo: string; }' is not assignable to type '{ id: number; }'. ==== tests/cases/compiler/arrayCast.ts (1 errors) ==== @@ -8,9 +7,8 @@ tests/cases/compiler/arrayCast.ts(3,1): error TS2353: Neither type '{ foo: strin // has type { foo: string }[], which is not assignable to { id: number }[]. <{ id: number; }[]>[{ foo: "s" }]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other: -!!! error TS2353: Type '{ foo: string; }' is not assignable to type '{ id: number; }': -!!! error TS2353: Property 'id' is missing in type '{ foo: string; }'. +!!! error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other. +!!! error TS2352: Type '{ foo: string; }' is not assignable to type '{ id: number; }'. // Should succeed, as the {} element causes the type of the array to be {}[] <{ id: number; }[]>[{ foo: "s" }, {}]; \ No newline at end of file diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index 055c62c479b..b70b659773c 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]': +tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]'. Type 'void' is not assignable to type 'string'. -tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]': - Type 'number[]' is not assignable to type 'number[][]': - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. + Type 'number[]' is not assignable to type 'number[][]'. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -29,16 +29,16 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' var myVar: myInt; var strArray: string[] = [myVar.voidFn()]; ~~~~~~~~ -!!! error TS2322: Type 'void[]' is not assignable to type 'string[]': +!!! error TS2322: Type 'void[]' is not assignable to type 'string[]'. !!! error TS2322: Type 'void' is not assignable to type 'string'. var myArray: number[][][]; myArray = [[1, 2]]; ~~~~~~~ -!!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]': -!!! error TS2322: Type 'number[]' is not assignable to type 'number[][]': -!!! error TS2322: Type 'number' is not assignable to type 'number[]': +!!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. +!!! error TS2322: Type 'number[]' is not assignable to type 'number[][]'. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. function isEmpty(l: { length: number }) { diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index bb4867702ec..0dcff3de422 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. Property 'isArray' is missing in type 'Number'. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ==== @@ -19,7 +19,7 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. !!! error TS2322: Property 'isArray' is missing in type 'Number'. var xs4: typeof Array; ~ @@ -27,4 +27,4 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index 2f8a4f1a377..5ffe9d1ec34 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,12 +1,12 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(19,1): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2323: Type '() => number' is not assignable to type 'E'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(32,16): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(60,5): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2323: Type '() => number' is not assignable to type 'E'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): error TS2332: 'this' cannot be referenced in current location. @@ -49,7 +49,7 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e enum E { x = () => 4, // Error expected ~~~~~~~ -!!! error TS2323: Type '() => number' is not assignable to type 'E'. +!!! error TS2322: Type '() => number' is not assignable to type 'E'. y = (() => this).length // error, can't use this in enum ~~~~ !!! error TS2332: 'this' cannot be referenced in current location. @@ -100,7 +100,7 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e enum E { x = () => 4, // Error expected ~~~~~~~ -!!! error TS2323: Type '() => number' is not assignable to type 'E'. +!!! error TS2322: Type '() => number' is not assignable to type 'E'. y = (() => this).length ~~~~ !!! error TS2332: 'this' cannot be referenced in current location. diff --git a/tests/baselines/reference/assignFromBooleanInterface.errors.txt b/tests/baselines/reference/assignFromBooleanInterface.errors.txt index 48f06b7409e..4b06603a9bf 100644 --- a/tests/baselines/reference/assignFromBooleanInterface.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3,1): error TS2323: Type 'Boolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. ==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3 var a: Boolean; x = a; ~ -!!! error TS2323: Type 'Boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt index 495f8cc432d..66d55e00d86 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2323: Type 'Boolean' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2323: Type 'NotBoolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. ==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts (2 errors) ==== @@ -23,9 +23,9 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts( x = a; // expected error ~ -!!! error TS2323: Type 'Boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'. x = b; // expected error ~ -!!! error TS2323: Type 'NotBoolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface.errors.txt b/tests/baselines/reference/assignFromNumberInterface.errors.txt index 5a65c08de4a..0c8c4a5f5ac 100644 --- a/tests/baselines/reference/assignFromNumberInterface.errors.txt +++ b/tests/baselines/reference/assignFromNumberInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1): error TS2323: Type 'Number' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1): error TS2322: Type 'Number' is not assignable to type 'number'. ==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1 var a: Number; x = a; ~ -!!! error TS2323: Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface2.errors.txt b/tests/baselines/reference/assignFromNumberInterface2.errors.txt index 45a600658c2..fa53d8facdf 100644 --- a/tests/baselines/reference/assignFromNumberInterface2.errors.txt +++ b/tests/baselines/reference/assignFromNumberInterface2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(23,1): error TS2323: Type 'Number' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2323: Type 'NotNumber' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(23,1): error TS2322: Type 'Number' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2322: Type 'NotNumber' is not assignable to type 'number'. ==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts (2 errors) ==== @@ -27,9 +27,9 @@ tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24 x = a; // expected error ~ -!!! error TS2323: Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. x = b; // expected error ~ -!!! error TS2323: Type 'NotNumber' is not assignable to type 'number'. +!!! error TS2322: Type 'NotNumber' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface.errors.txt b/tests/baselines/reference/assignFromStringInterface.errors.txt index 93f28853c8a..6ec8afad120 100644 --- a/tests/baselines/reference/assignFromStringInterface.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1): error TS2323: Type 'String' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1): error TS2322: Type 'String' is not assignable to type 'string'. ==== tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1 var a: String; x = a; ~ -!!! error TS2323: Type 'String' is not assignable to type 'string'. +!!! error TS2322: Type 'String' is not assignable to type 'string'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface2.errors.txt b/tests/baselines/reference/assignFromStringInterface2.errors.txt index b34366a7ce7..2e3e518f75b 100644 --- a/tests/baselines/reference/assignFromStringInterface2.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(46,1): error TS2323: Type 'String' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2323: Type 'NotString' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(46,1): error TS2322: Type 'String' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2322: Type 'NotString' is not assignable to type 'string'. ==== tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts (2 errors) ==== @@ -50,9 +50,9 @@ tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47 x = a; // expected error ~ -!!! error TS2323: Type 'String' is not assignable to type 'string'. +!!! error TS2322: Type 'String' is not assignable to type 'string'. x = b; // expected error ~ -!!! error TS2323: Type 'NotString' is not assignable to type 'string'. +!!! error TS2322: Type 'NotString' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index 6b1403b7df1..7f2c7855a35 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignToFn.ts(8,5): error TS2323: Type 'string' is not assignable to type '(n: number) => boolean'. +tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. ==== tests/cases/compiler/assignToFn.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2323: Type 'string' is not assi x.f="hello"; ~~~ -!!! error TS2323: Type 'string' is not assignable to type '(n: number) => boolean'. +!!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 0e22bd1b391..57ce797f5b2 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }': +tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [x: string]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }': +tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. Index signature is missing in type '{ one: number; }'. @@ -10,9 +10,9 @@ tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: numbe x = y; ~ -!!! error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }': +!!! error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. !!! error TS2322: Property 'one' is missing in type '{ [x: string]: any; }'. y = x; ~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }': +!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. !!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt index 2395f2bf364..03dcee9baf3 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]': - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => number': - Type 'string | number' is not assignable to type 'number': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'. Property '0' is missing in type '{}[]'. @@ -26,13 +26,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // error numArray = numStrTuple; ~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number' is not assignable to type '() => number': -!!! error TS2322: Type 'string | number' is not assignable to type 'number': +!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. emptyObjTuple = emptyObjArray; ~~~~~~~~~~~~~ -!!! error TS2322: Type '{}[]' is not assignable to type '[{}]': +!!! error TS2322: Type '{}[]' is not assignable to type '[{}]'. !!! error TS2322: Property '0' is missing in type '{}[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 260aa868dfd..15bf1111391 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -1,24 +1,24 @@ -tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': +tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. Property 'b' is missing in type '{ a: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': +tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. Property 'b' is missing in type '{ a: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. ==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ==== var b2: { b: number;} = { a: 0 }; // error ~~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': +!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. !!! error TS2322: Property 'b' is missing in type '{ a: number; }'. b2 = { a: 0 }; // error ~~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }': +!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. !!! error TS2322: Property 'b' is missing in type '{ a: number; }'. b2 = {b: 0, a: 0 }; @@ -33,7 +33,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. !!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, @@ -41,7 +41,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. !!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. f: (n) => { return 0; }, m: 0, @@ -57,7 +57,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ -!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }': +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. !!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index a17c09988a3..2316320f480 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(4,5): error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. - Types of property 'name' are incompatible: + Types of property 'name' are incompatible. Type 'boolean' is not assignable to type 'string'. tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. Property 'id' is missing in type '{ name: string; }'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS foo({ id: 1234, name: false }); // Error, name of wrong type ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. -!!! error TS2345: Types of property 'name' are incompatible: +!!! error TS2345: Types of property 'name' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. foo({ name: "hello" }); // Error, id required but missing ~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt index e2016fb7029..6a221ef144e 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -1,26 +1,26 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -61,42 +61,42 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt index 1aed50f25f1..e67f0a930c2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -1,38 +1,38 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }': - Types of property 'f' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. + Types of property 'f' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => string'. @@ -69,19 +69,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // errors t = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type 'T': +!!! error TS2322: Type '() => number' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T': +!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }': +!!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. !!! error TS2322: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }': +!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. !!! error TS2322: Property 'f' is missing in type '(x: number) => string'. interface S2 { @@ -92,46 +92,46 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T': +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T': +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }': +!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. !!! error TS2322: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }': +!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. !!! error TS2322: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index 92bc30a7144..e00d1eea042 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,17 +1,13 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type 'Base' is not assignable to type '{ foo: number; }': - Types of property 'foo' are incompatible: - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ==== @@ -68,22 +64,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, { foo: number } and Base are incompatible ~~ -!!! error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2322: Types of property 'foo' are incompatible: +!!! error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ -!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index 2bdd0ef61a9..f89bbfa5798 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== @@ -25,19 +25,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x?: number) => 1; // ok, same number of required params a = (x: number) => 1; // error, too many required params ~ -!!! error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a; // ok a = b.a2; // ok a = b.a3; // error ~ -!!! error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a4; // error ~ -!!! error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. a = b.a5; // ok a = b.a6; // error ~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. var a2: (x?: number) => number; a2 = () => 1; // ok, same number of required params @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. var a3: (x: number) => number; a3 = () => 1; // ok, fewer required params @@ -58,7 +58,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number) => 1; // ok, same number of required params a3 = (x: number, y: number) => 1; // error, too many required params ~~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -66,7 +66,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a5; // ok a3 = b.a6; // error ~~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index 117f6cae0e9..8eec8503e70 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,29 +1,29 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'args' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'args' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'x' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'x' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'z' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. @@ -42,16 +42,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (...args: number[]) => 1; // ok, same number of required params a = (...args: string[]) => 1; // error, type mismatch ~ -!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2322: Types of parameters 'args' and 'args' are incompatible: +!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'args' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x?: number) => 1; // ok, same number of required params a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params a = (x: number) => 1; // ok, rest param corresponds to infinite number of params a = (x?: string) => 1; // error, incompatible type ~ -!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2322: Types of parameters 'x' and 'args' are incompatible: +!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'args' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. @@ -63,8 +63,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible: +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params a2 = (x: number, y?: number) => 1; // ok, same number of required params @@ -76,36 +76,36 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: string) => 1; // ok, all present params match a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: +!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'z' and 'y' are incompatible: +!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'z' and 'y' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: +!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x: number) => 1; // ok, all present params match a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ -!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible: +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt index f37aca50710..9c0c0d6a8fd 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2323: Type 'S2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2323: Type '(x: string) => void' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2323: Type 'S2' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2323: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2323: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2322: Type 'S2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ==== @@ -38,26 +38,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. t = a3; ~ -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. t = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. t = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. a = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. a = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt index 6213a2c27ce..5e8fc6dd3a4 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -1,30 +1,30 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }': - Types of property 'f' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. + Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => string'. @@ -53,19 +53,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // errors t = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type 'T': +!!! error TS2322: Type '() => number' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T': +!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }': +!!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. !!! error TS2322: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }': +!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. !!! error TS2322: Property 'f' is missing in type '(x: number) => string'. interface S2 { @@ -76,38 +76,38 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T': -!!! error TS2322: Types of property 'f' are incompatible: +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T': +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T': +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. !!! error TS2322: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Types of property 'f' are incompatible: +!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }': -!!! error TS2322: Types of property 'f' are incompatible: +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Types of property 'f' are incompatible. !!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }': +!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. !!! error TS2322: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }': +!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. !!! error TS2322: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index b88beac6099..804e31600e1 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,28 +1,24 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type 'Base' is not assignable to type '{ foo: number; }': - Types of property 'foo' are incompatible: - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. + Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. + Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. + Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. + Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. @@ -80,22 +76,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, type mismatch ~~ -!!! error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2322: Types of property 'foo' are incompatible: +!!! error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ -!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any': -!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: new (...x: T[]) => T; @@ -121,25 +113,25 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b16: new (x: (a: T) => T) => T[]; a16 = b16; // error ~~~ -!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. b16 = a16; // error ~~~ -!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error ~~~ -!!! error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. b17 = a17; // error ~~~ -!!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index 3a477e0c9ec..df56af3ee98 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2323: Type 'new (x: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2323: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== @@ -23,14 +23,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b.a2; // ok a = b.a3; // error ~ -!!! error TS2323: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. a = b.a4; // error ~ -!!! error TS2323: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. a = b.a5; // ok a = b.a6; // error ~ -!!! error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. var a2: new (x?: number) => number; a2 = b.a; // ok @@ -40,7 +40,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. var a3: new (x: number) => number; a3 = b.a; // ok @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a5; // ok a3 = b.a6; // error ~~ -!!! error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. var a4: new (x: number, y?: number) => number; a4 = b.a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt index 18d853f006f..a18da8fd8f7 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2323: Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2323: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ==== @@ -22,7 +22,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x?: T) => null; // ok, same T of required params this.a = (x: T) => null; // error, too many required params ~~~~~~ -!!! error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -33,7 +33,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T) => null; // ok, same T of required params this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ -!!! error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -77,10 +77,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme b.a = t.a2; b.a = t.a3; ~~~ -!!! error TS2323: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. b.a = t.a4; ~~~ -!!! error TS2323: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. b.a = t.a5; b.a2 = t.a; @@ -123,7 +123,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x?: T) => null; // ok, same T of required params this.a = (x: T) => null; // error, too many required params ~~~~~~ -!!! error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -134,7 +134,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T) => null; // ok, same T of required params this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ -!!! error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt index c4111661b14..0a9b50ff0b8 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt @@ -1,25 +1,23 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts (6 errors) ==== @@ -38,18 +36,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. !!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { @@ -66,28 +64,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; } a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt index fcd337ee615..b15f2f7905d 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -1,25 +1,23 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts (6 errors) ==== @@ -38,18 +36,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. !!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { @@ -66,28 +64,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; } a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt index 84b51350785..61f9e082a48 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': - Index signatures are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. + Index signatures are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -27,9 +27,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': +!!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. !!! error TS2322: Property 'bar' is missing in type 'Base'. b = a; // ok @@ -41,9 +41,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b2; // ok b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Derived'. module Generics { @@ -56,8 +56,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; }; a = b; // error ~ -!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt index 606eef809f0..0fdae0b7cfa 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -1,71 +1,57 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Derived' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }': - Types of property 'foo' are incompatible: - Type 'Derived2' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': - Types of property 'foo' are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Derived' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'. + Types of property 'foo' are incompatible. + Type 'Derived2' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. + Types of property 'foo' are incompatible. + Type 'Base' is not assignable to type 'Derived2'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts (17 errors) ==== @@ -94,91 +80,80 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; // error ~ -!!! error TS2322: Type 'T' is not assignable to type 'S': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': +!!! error TS2322: Type 'T' is not assignable to type 'S'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. !!! error TS2322: Property 'bar' is missing in type 'Derived2'. t = s; // error ~ -!!! error TS2322: Type 'S' is not assignable to type 'T': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Derived'. s = s2; // ok s = a2; // ok s2 = t2; // error ~~ -!!! error TS2322: Type 'T2' is not assignable to type 'S2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T2' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. t2 = s2; // error ~~ -!!! error TS2322: Type 'S2' is not assignable to type 'T2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. s2 = t; // error ~~ -!!! error TS2322: Type 'T' is not assignable to type 'S2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. s2 = b; // error ~~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. s2 = a2; // ok a = b; // error ~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. b = a; // error ~ -!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. a = s; // ok a = s2; // ok a = a2; // ok a2 = b2; // error ~~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. b2 = a2; // error ~~ -!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. a2 = b; // error ~~ -!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. a2 = t2; // error ~~ -!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. a2 = t; // error ~~ -!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. } module WithBase { @@ -205,9 +180,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; // ok t = s; // error ~ -!!! error TS2322: Type 'S' is not assignable to type 'T': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Base'. s = s2; // ok s = a2; // ok @@ -215,10 +190,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s2 = t2; // ok t2 = s2; // error ~~ -!!! error TS2322: Type 'S2' is not assignable to type 'T2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. s2 = t; // ok s2 = b; // ok s2 = a2; // ok @@ -226,10 +200,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. a = s; // ok a = s2; // ok a = a2; // ok @@ -237,10 +210,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b2; // ok b2 = a2; // error ~~ -!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. a2 = b; // ok a2 = t2; // ok a2 = t; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt index c63813d343d..f9f7e48c685 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C'. Property 'foo' is missing in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I'. Property 'fooo' is missing in type 'C'. @@ -19,9 +19,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'C': +!!! error TS2322: Type 'I' is not assignable to type 'C'. !!! error TS2322: Property 'foo' is missing in type 'I'. i = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'I': +!!! error TS2322: Type 'C' is not assignable to type 'I'. !!! error TS2322: Property 'fooo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt index ab9ddb553d3..c1093ab0ffe 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt @@ -1,50 +1,50 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'. Property 'foo' is private in type 'E' but not in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I'. Property 'foo' is private in type 'E' but not in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'. Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base'. Property 'foo' is private in type 'Base' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I'. Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'. Property 'foo' is private in type 'I' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D'. Property 'foo' is private in type 'Base' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D'. Property 'foo' is private in type 'I' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'D'. @@ -81,7 +81,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = d; a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; @@ -89,7 +89,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme b = d; b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'Base': +!!! error TS2322: Type 'E' is not assignable to type 'Base'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. i = a; @@ -97,7 +97,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme i = d; i = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'I': +!!! error TS2322: Type 'E' is not assignable to type 'I'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. d = a; @@ -105,24 +105,24 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme d = i; d = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'D': +!!! error TS2322: Type 'E' is not assignable to type 'D'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E': +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! error TS2322: Type 'Base' is not assignable to type 'E': +!!! error TS2322: Type 'Base' is not assignable to type 'E'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. e = i; // errror ~ -!!! error TS2322: Type 'I' is not assignable to type 'E': +!!! error TS2322: Type 'I' is not assignable to type 'E'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. e = d; // errror ~ -!!! error TS2322: Type 'D' is not assignable to type 'E': +!!! error TS2322: Type 'D' is not assignable to type 'E'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = e; @@ -155,77 +155,77 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // error ~ -!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }': +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'. !!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. a = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }': +!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }'. !!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. a = d; a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; // error ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base': +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'. !!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. b = i; b = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'Base': +!!! error TS2322: Type 'D' is not assignable to type 'Base'. !!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'Base': +!!! error TS2322: Type 'E' is not assignable to type 'Base'. !!! error TS2322: Types have separate declarations of a private property 'foo'. b = b; i = a; // error ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I': +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I'. !!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. i = b; i = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'I': +!!! error TS2322: Type 'D' is not assignable to type 'I'. !!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. i = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'I': +!!! error TS2322: Type 'E' is not assignable to type 'I'. !!! error TS2322: Types have separate declarations of a private property 'foo'. i = i; d = a; d = b; // error ~ -!!! error TS2322: Type 'Base' is not assignable to type 'D': +!!! error TS2322: Type 'Base' is not assignable to type 'D'. !!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. d = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'D': +!!! error TS2322: Type 'I' is not assignable to type 'D'. !!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. d = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'D': +!!! error TS2322: Type 'E' is not assignable to type 'D'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E': +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! error TS2322: Type 'Base' is not assignable to type 'E': +!!! error TS2322: Type 'Base' is not assignable to type 'E'. !!! error TS2322: Types have separate declarations of a private property 'foo'. e = i; // errror ~ -!!! error TS2322: Type 'I' is not assignable to type 'E': +!!! error TS2322: Type 'I' is not assignable to type 'E'. !!! error TS2322: Types have separate declarations of a private property 'foo'. e = d; // errror ~ -!!! error TS2322: Type 'D' is not assignable to type 'E': +!!! error TS2322: Type 'D' is not assignable to type 'E'. !!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = e; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt index 44577bf1c8d..b378086ca5e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C'. Property 'opt' is optional in type 'D' but required in type 'C'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'opt' is optional in type 'E' but required in type 'C'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. @@ -87,33 +87,33 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'C': +!!! error TS2322: Type 'D' is not assignable to type 'C'. !!! error TS2322: Property 'opt' is optional in type 'D' but required in type 'C'. c = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': +!!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Property 'opt' is optional in type 'E' but required in type 'C'. c = f; // ok c = a; // ok a = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. a = f; // ok a = c; // ok b = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. b = f; // ok b = a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index e1bf35ef2c2..de2751beaca 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C'. Property 'opt' is missing in type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'F'. @@ -94,43 +94,43 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type 'C': +!!! error TS2322: Type 'D' is not assignable to type 'C'. !!! error TS2322: Property 'opt' is missing in type 'D'. c = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': +!!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Property 'opt' is missing in type 'E'. c = f; // error ~ -!!! error TS2322: Type 'F' is not assignable to type 'C': +!!! error TS2322: Type 'F' is not assignable to type 'C'. !!! error TS2322: Property 'opt' is missing in type 'F'. c = a; // ok a = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is missing in type 'D'. a = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is missing in type 'E'. a = f; // error ~ -!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is missing in type 'F'. a = c; // ok b = d; // error ~ -!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is missing in type 'D'. b = e; // error ~ -!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is missing in type 'E'. b = f; // error ~ -!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }': +!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. !!! error TS2322: Property 'opt' is missing in type 'F'. b = a; // ok b = c; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt index 370355a7373..d86c73f5cf8 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -1,60 +1,60 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S'. Property ''1'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2'. Property ''1'' is missing in type 'T2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2'. Property ''1.0'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2'. Property ''1'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ '1': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ 1.: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ 1.: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. Property '1.' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T'. @@ -81,73 +81,73 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; ~ -!!! error TS2322: Type 'T' is not assignable to type 'S': +!!! error TS2322: Type 'T' is not assignable to type 'S'. !!! error TS2322: Property ''1'' is missing in type 'T'. t = s; ~ -!!! error TS2322: Type 'S' is not assignable to type 'T': +!!! error TS2322: Type 'S' is not assignable to type 'T'. !!! error TS2322: Property ''1.'' is missing in type 'S'. s = s2; // ok s = a2; ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. !!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; ~~ -!!! error TS2322: Type 'T2' is not assignable to type 'S2': +!!! error TS2322: Type 'T2' is not assignable to type 'S2'. !!! error TS2322: Property ''1'' is missing in type 'T2'. t2 = s2; ~~ -!!! error TS2322: Type 'S2' is not assignable to type 'T2': +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. !!! error TS2322: Property ''1.0'' is missing in type 'S2'. s2 = t; ~~ -!!! error TS2322: Type 'T' is not assignable to type 'S2': +!!! error TS2322: Type 'T' is not assignable to type 'S2'. !!! error TS2322: Property ''1'' is missing in type 'T'. s2 = b; ~~ -!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2': +!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. !!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. s2 = a2; ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. !!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; ~ -!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. b = a; ~ -!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }': +!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. !!! error TS2322: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. a = s; ~ -!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type 'S'. a = s2; ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type 'S2'. a = a2; ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. a2 = b2; ~~ -!!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }': +!!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. !!! error TS2322: Property ''1.0'' is missing in type '{ '1': string; }'. b2 = a2; ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. !!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a2 = b; // ok a2 = t2; // ok a2 = t; ~~ -!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': +!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. !!! error TS2322: Property ''1.0'' is missing in type 'T'. } @@ -173,7 +173,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = s2; // ok s = a2; // error ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. !!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; // ok @@ -182,52 +182,52 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s2 = b; // ok s2 = a2; // error ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. !!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; // error ~ -!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. b = a; // error ~ -!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }': +!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. !!! error TS2322: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. a = s; // error ~ -!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type 'S'. a = s2; // error ~ -!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type 'S2'. a = a2; // error ~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. a = b2; // error ~ -!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }': +!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. !!! error TS2322: Property ''1.'' is missing in type '{ 1.: string; }'. a2 = b2; // error ~~ -!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }': +!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. !!! error TS2322: Property ''1.0'' is missing in type '{ 1.: string; }'. b2 = a2; // error ~~ -!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }': +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. !!! error TS2322: Property '1.' is missing in type '{ '1.0': string; }'. a2 = b; // error ~~ -!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }': +!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. !!! error TS2322: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. a2 = t2; // error ~~ -!!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }': +!!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. !!! error TS2322: Property ''1.0'' is missing in type 'T2'. a2 = t; // error ~~ -!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }': +!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. !!! error TS2322: Property ''1.0'' is missing in type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt index 55e62ae2266..3bea0c46716 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number': +tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number': - Types of parameters 'x' and 's1' are incompatible: +tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. + Types of parameters 'x' and 's1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number': +tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -29,18 +29,18 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type g = f2; // Error ~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number': +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. g = f3; // Error ~ -!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number': -!!! error TS2322: Types of parameters 'x' and 's1' are incompatible: +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Types of parameters 'x' and 's1' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. g = f4; // Error ~ -!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number': +!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. class C { @@ -52,6 +52,6 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type d = C; // Error ~ -!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt index 630c508fc75..f002c70e90b 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -1,33 +1,29 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts (8 errors) ==== @@ -47,18 +43,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. !!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { @@ -75,10 +71,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b1; // ok b1 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. class B2 extends A { [x: string]: Derived2; // ok @@ -88,37 +83,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b2; // ok b2 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt index de88bc13bad..c322364280e 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt @@ -1,33 +1,29 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': - Index signatures are incompatible: - Type 'T' is not assignable to type 'Derived2': - Property 'baz' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. + Index signatures are incompatible. + Type 'T' is not assignable to type 'Derived2'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts (8 errors) ==== @@ -47,18 +43,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. !!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. !!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { @@ -75,10 +71,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b1; // ok b1 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. interface B2 extends A { [x: string]: Derived2; // ok @@ -88,37 +83,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b2; // ok b2 = a1; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'Base' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived': -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'T' is not assignable to type 'Derived2': -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt index 86913461d44..a31b2ef3025 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(7,8): error TS2304: Cannot find name 'A'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. + Index signatures are incompatible. Type 'string' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. Type 'T' is not assignable to type 'string'. @@ -31,13 +31,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: string]: string; } a = b; // error ~ -!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'T' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability10.errors.txt b/tests/baselines/reference/assignmentCompatability10.errors.txt index f1fe353c906..883bf1c277c 100644 --- a/tests/baselines/reference/assignmentCompatability10.errors.txt +++ b/tests/baselines/reference/assignmentCompatability10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional': +tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x4 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. !!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt index 1485c3abdba..21d49c6d3ae 100644 --- a/tests/baselines/reference/assignmentCompatability11.errors.txt +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': - Types of property 'two' are incompatible: +tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. + Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': -!!! error TS2322: Types of property 'two' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2322: Types of property 'two' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability12.errors.txt b/tests/baselines/reference/assignmentCompatability12.errors.txt index 4a0f9cc8f65..07b65bdc463 100644 --- a/tests/baselines/reference/assignmentCompatability12.errors.txt +++ b/tests/baselines/reference/assignmentCompatability12.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt index 909193c6202..ea7e62c422f 100644 --- a/tests/baselines/reference/assignmentCompatability13.errors.txt +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. !!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability14.errors.txt b/tests/baselines/reference/assignmentCompatability14.errors.txt index 897f73b8710..2ba77622f33 100644 --- a/tests/baselines/reference/assignmentCompatability14.errors.txt +++ b/tests/baselines/reference/assignmentCompatability14.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt index f92f3a7ffd7..c56719d0895 100644 --- a/tests/baselines/reference/assignmentCompatability15.errors.txt +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }': - Types of property 'two' are incompatible: +tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. + Types of property 'two' are incompatible. Type 'string' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }': -!!! error TS2322: Types of property 'two' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. +!!! error TS2322: Types of property 'two' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt index b114462c711..266d72b3232 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'any[]': +tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'any[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'any[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index f30e39de1ae..b37f39d082f 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'any[]': +tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'any[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'any[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'any[]'. !!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt index d619b4847ad..2be4a037575 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'number[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index 1c61c2bc808..ae97af6aa7e 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'number[]': +tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'number[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'number[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number[]'. !!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt index b9d966a09a5..750310ac5cc 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'string[]': +tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index 72a690c5d16..8da52fe42c6 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'string[]': +tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'string[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'string[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'string[]'. !!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt index b033522049d..f0799a92f5c 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'boolean[]': +tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index f50d2ba943e..a005eaa02d1 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }': - Types of property 'two' are incompatible: - Type 'string' is not assignable to type 'boolean[]': +tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. + Types of property 'two' are incompatible. + Type 'string' is not assignable to type 'boolean[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }': -!!! error TS2322: Types of property 'two' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type 'boolean[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. !!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt index 14cd2eb41d4..0f4a535d413 100644 --- a/tests/baselines/reference/assignmentCompatability24.errors.txt +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. +tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. ==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt index c02b876e4e0..7f7e7f73ee0 100644 --- a/tests/baselines/reference/assignmentCompatability25.errors.txt +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': - Types of property 'two' are incompatible: +tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. + Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }': -!!! error TS2322: Types of property 'two' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2322: Types of property 'two' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability26.errors.txt b/tests/baselines/reference/assignmentCompatability26.errors.txt index 253c8af2c16..a005850e49c 100644 --- a/tests/baselines/reference/assignmentCompatability26.errors.txt +++ b/tests/baselines/reference/assignmentCompatability26.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt index 3c033c8d98d..180a51b3cf0 100644 --- a/tests/baselines/reference/assignmentCompatability27.errors.txt +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. !!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability28.errors.txt b/tests/baselines/reference/assignmentCompatability28.errors.txt index ce604747051..2360d0b1e9d 100644 --- a/tests/baselines/reference/assignmentCompatability28.errors.txt +++ b/tests/baselines/reference/assignmentCompatability28.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': - Types of property 'one' are incompatible: +tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt index fe9e390b482..194ae4ab675 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'any[]': +tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'any[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'any[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt index 663d8eaa299..b025705517c 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'number[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt index 00d5dd59188..8e19905eba7 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'string[]': +tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'string[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt index c4f20881a44..6d6321f5e50 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': - Types of property 'one' are incompatible: - Type 'number' is not assignable to type 'boolean[]': +tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. + Types of property 'one' are incompatible. + Type 'number' is not assignable to type 'boolean[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }': -!!! error TS2322: Types of property 'one' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt index 27a87764b61..e2352625280 100644 --- a/tests/baselines/reference/assignmentCompatability33.errors.txt +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. +tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. ==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt index 9ac0a97011c..2dd9cba6470 100644 --- a/tests/baselines/reference/assignmentCompatability34.errors.txt +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. +tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. ==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability35.errors.txt b/tests/baselines/reference/assignmentCompatability35.errors.txt index 4ae2aaf42d8..faad78c10fc 100644 --- a/tests/baselines/reference/assignmentCompatability35.errors.txt +++ b/tests/baselines/reference/assignmentCompatability35.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }': +tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. !!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt index 013f5ae33b6..d8c43a3f363 100644 --- a/tests/baselines/reference/assignmentCompatability36.errors.txt +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }': +tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. Index signature is missing in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. !!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt index 7ce5905816b..452b72fe8ff 100644 --- a/tests/baselines/reference/assignmentCompatability37.errors.txt +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. +tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. ==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt index d23685d9f99..5f7918374c1 100644 --- a/tests/baselines/reference/assignmentCompatability38.errors.txt +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. +tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. ==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt index 3ab5cee7887..6389a9ad87f 100644 --- a/tests/baselines/reference/assignmentCompatability39.errors.txt +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic': +tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. !!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability40.errors.txt b/tests/baselines/reference/assignmentCompatability40.errors.txt index 4be86ebc805..d60f7dcdeb6 100644 --- a/tests/baselines/reference/assignmentCompatability40.errors.txt +++ b/tests/baselines/reference/assignmentCompatability40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate': +tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x5 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. !!! error TS2322: Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability41.errors.txt b/tests/baselines/reference/assignmentCompatability41.errors.txt index 018beb23358..ad0b7b7cfe3 100644 --- a/tests/baselines/reference/assignmentCompatability41.errors.txt +++ b/tests/baselines/reference/assignmentCompatability41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate': +tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x6 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. !!! error TS2322: Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability42.errors.txt b/tests/baselines/reference/assignmentCompatability42.errors.txt index de6fd79041e..e86b261e682 100644 --- a/tests/baselines/reference/assignmentCompatability42.errors.txt +++ b/tests/baselines/reference/assignmentCompatability42.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate': +tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'inte } __test2__.__val__x7 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. !!! error TS2322: Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt index 3f5fc9789b9..a1f596ef7e2 100644 --- a/tests/baselines/reference/assignmentCompatability43.errors.txt +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo': +tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'inte } __test2__.__val__obj2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo': +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. !!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index 3c6f6c72b55..e5db4f9ab96 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'String'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'Number'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable': +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. @@ -25,19 +25,19 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Applicable': +!!! error TS2322: Type 'string' is not assignable to type 'Applicable'. !!! error TS2322: Property 'apply' is missing in type 'String'. x = ['']; ~ -!!! error TS2322: Type 'string[]' is not assignable to type 'Applicable': +!!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. !!! error TS2322: Property 'apply' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Applicable': +!!! error TS2322: Type 'number' is not assignable to type 'Applicable'. !!! error TS2322: Property 'apply' is missing in type 'Number'. x = {}; ~ -!!! error TS2322: Type '{}' is not assignable to type 'Applicable': +!!! error TS2322: Type '{}' is not assignable to type 'Applicable'. !!! error TS2322: Property 'apply' is missing in type '{}'. // Should work diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index ab9b4985cc2..f3ff6f1b792 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable'. Property 'call' is missing in type 'String'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable'. Property 'call' is missing in type 'Number'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable': +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. @@ -25,19 +25,19 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Callable': +!!! error TS2322: Type 'string' is not assignable to type 'Callable'. !!! error TS2322: Property 'call' is missing in type 'String'. x = ['']; ~ -!!! error TS2322: Type 'string[]' is not assignable to type 'Callable': +!!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. !!! error TS2322: Property 'call' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Callable': +!!! error TS2322: Type 'number' is not assignable to type 'Callable'. !!! error TS2322: Property 'call' is missing in type 'Number'. x = {}; ~ -!!! error TS2322: Type '{}' is not assignable to type 'Callable': +!!! error TS2322: Type '{}' is not assignable to type 'Callable'. !!! error TS2322: Property 'call' is missing in type '{}'. // Should work diff --git a/tests/baselines/reference/assignmentStricterConstraints.errors.txt b/tests/baselines/reference/assignmentStricterConstraints.errors.txt index f5234a44fd1..bf3751dda74 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.errors.txt +++ b/tests/baselines/reference/assignmentStricterConstraints.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/assignmentStricterConstraints.ts(1,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2323: Type 'S' is not assignable to type 'T'. +tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2322: Type 'S' is not assignable to type 'T'. ==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2323: Type ' !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y ~ -!!! error TS2323: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. } var g = function (x: T, y: S): void { } diff --git a/tests/baselines/reference/assignmentToObject.errors.txt b/tests/baselines/reference/assignmentToObject.errors.txt index bfb270b71b6..aa1222bd799 100644 --- a/tests/baselines/reference/assignmentToObject.errors.txt +++ b/tests/baselines/reference/assignmentToObject.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: +tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. @@ -8,7 +8,7 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: var b: {} = a; // ok var c: Object = a; // should be error ~ -!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: +!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type 'number' is not assignable to type '() => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index c6ba4e7dfe3..2e85ee101f5 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,18 +1,18 @@ -tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: +tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. -tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function': +tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. Property 'apply' is missing in type '{}'. -tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function': - Types of property 'apply' are incompatible: +tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. + Types of property 'apply' are incompatible. Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString ~~~~~~ -!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: +!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. !!! error TS2322: Type 'number' is not assignable to type '() => string'. var goodObj: Object = { toString(x?) { @@ -22,7 +22,7 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type var errFun: Function = {}; // Error for no call signature ~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'Function': +!!! error TS2322: Type '{}' is not assignable to type 'Function'. !!! error TS2322: Property 'apply' is missing in type '{}'. function foo() { } @@ -46,6 +46,6 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type var badFundule: Function = bad; // error ~~~~~~~~~~ -!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function': -!!! error TS2322: Types of property 'apply' are incompatible: +!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function'. +!!! error TS2322: Types of property 'apply' are incompatible. !!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 070b5497121..a50ffdf72d7 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -1,29 +1,29 @@ -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': - Types of property 'x' are incompatible: +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': - Types of property 'x' are incompatible: +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': - Types of property 'x' are incompatible: +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2364: Invalid left-hand side of assignment expression. @@ -36,10 +36,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. module M { export var y: number; @@ -49,13 +49,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (M.y) = 3; // OK M.y = ''; // Error ~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M).y = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M.y) = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. M = { y: 3 }; // Error ~ @@ -79,18 +79,18 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize M2.M3 = { x: '' }; // Error ~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! error TS2322: Types of property 'x' are incompatible: +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. (M2).M3 = { x: '' }; // Error ~~~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! error TS2322: Types of property 'x' are incompatible: +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. (M2.M3) = { x: '' }; // Error ~~~~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3': -!!! error TS2322: Types of property 'x' are incompatible: +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. @@ -107,32 +107,32 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y).t = 3; // OK (y.t) = 3; // OK (y).t = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y.t) = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. y['t'] = 3; // OK (y)['t'] = 3; // OK (y['t']) = 3; // OK y['t'] = ''; // Error ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y)['t'] = ''; // Error ~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y['t']) = ''; // Error ~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } enum E { diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt index 2c165c2395c..a951a2b1a66 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }': +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. Index signature is missing in type '{}'. -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }': +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. Index signature is missing in type '() => void'. @@ -21,14 +21,14 @@ tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignatur var v1: { ~~ -!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }': +!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. !!! error TS2322: Index signature is missing in type '{}'. [n: number]: Foo } = o; // Should be allowed var v2: { ~~ -!!! error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }': +!!! error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. !!! error TS2322: Index signature is missing in type '() => void'. [n: number]: Bar } = f; // Should be allowed \ No newline at end of file diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt index f55bca8e0e2..eca303ff72c 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt +++ b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y': +tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. Named properties 'm' of types 'X' and 'Y' are not identical. @@ -12,5 +12,5 @@ tests/cases/compiler/baseTypePrivateMemberClash.ts(8,11): error TS2320: Interfac interface Z extends X, Y { } ~ -!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y': +!!! error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. !!! error TS2320: Named properties 'm' of types 'X' and 'Y' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt index a4a04af142d..c9eabafaf80 100644 --- a/tests/baselines/reference/bases.errors.txt +++ b/tests/baselines/reference/bases.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(13,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist on type 'B'. tests/cases/compiler/bases.ts(7,17): error TS2304: Cannot find name 'any'. -tests/cases/compiler/bases.ts(11,7): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'x' is missing in type 'C'. tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'. @@ -30,8 +30,8 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o class C extends B implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'C'. constructor() { ~~~~~~~~~~~~~~~ this.x: any; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js index 9cd5a63912e..710af4edfa7 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -30,11 +30,11 @@ var ENUM1; // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions -var ResultIsNumber2 = ~ENUM1["A"]; -var ResultIsNumber3 = ~(0 /* A */ + ENUM1["B"]); +var ResultIsNumber2 = ~0 /* "A" */; +var ResultIsNumber3 = ~(0 /* A */ + 1 /* "B" */); // multiple ~ operators -var ResultIsNumber4 = ~~~(ENUM1["A"] + 1 /* B */); +var ResultIsNumber4 = ~~~(0 /* "A" */ + 1 /* B */); // miss assignment operators ~ENUM1; -~ENUM1["A"]; -~0 /* A */, ~ENUM1["B"]; +~0 /* "A" */; +~0 /* A */, ~1 /* "B" */; diff --git a/tests/baselines/reference/bpSpan_const.baseline b/tests/baselines/reference/bpSpan_const.baseline new file mode 100644 index 00000000000..bee7d930955 --- /dev/null +++ b/tests/baselines/reference/bpSpan_const.baseline @@ -0,0 +1,176 @@ + +1 >const c1 = false; + + ~~~~~~~~~~~~~~~~~~ => Pos: (0 to 17) SpanInfo: {"start":0,"length":16} + >const c1 = false + >:=> (line 1, col 0) to (line 1, col 16) +-------------------------------- +2 >const c2: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (18 to 40) SpanInfo: {"start":18,"length":21} + >const c2: number = 23 + >:=> (line 2, col 0) to (line 2, col 21) +-------------------------------- +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~~ => Pos: (41 to 53) SpanInfo: {"start":41,"length":12} + >const c3 = 0 + >:=> (line 3, col 0) to (line 3, col 12) +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~~~~~~ => Pos: (54 to 70) SpanInfo: {"start":55,"length":15} + >c4 :string = "" + >:=> (line 3, col 14) to (line 3, col 29) +3 >const c3 = 0, c4 :string = "", c5 = null; + + ~~~~~~~~~~~~ => Pos: (71 to 82) SpanInfo: {"start":72,"length":9} + >c5 = null + >:=> (line 3, col 31) to (line 3, col 40) +-------------------------------- +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~~~~~~~~ => Pos: (83 to 99) SpanInfo: {"start":87,"length":12} + >const c4 = 0 + >:=> (line 4, col 4) to (line 4, col 16) +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~~~ => Pos: (100 to 111) SpanInfo: {"start":101,"length":6} + >c4 < 9 + >:=> (line 4, col 18) to (line 4, col 24) +4 >for(const c4 = 0; c4 < 9; ) { break; } + + ~~~~~~~~~~ => Pos: (112 to 121) SpanInfo: {"start":113,"length":5} + >break + >:=> (line 4, col 30) to (line 4, col 35) +-------------------------------- +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~~~~~~~~ => Pos: (122 to 138) SpanInfo: {"start":126,"length":12} + >const c5 = 0 + >:=> (line 5, col 4) to (line 5, col 16) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~ => Pos: (139 to 146) SpanInfo: {"start":140,"length":6} + >c6 = 0 + >:=> (line 5, col 18) to (line 5, col 24) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~~~~ => Pos: (147 to 159) SpanInfo: {"start":148,"length":7} + >c5 < c6 + >:=> (line 5, col 26) to (line 5, col 33) +5 >for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } + + ~~~~~~~~~~=> Pos: (160 to 169) SpanInfo: {"start":161,"length":5} + >break + >:=> (line 5, col 39) to (line 5, col 44) +-------------------------------- +6 >module M { + + ~~~~~~~~~~~ => Pos: (170 to 180) SpanInfo: {"start":170,"length":133} + >module M { + > export const cc1 = false; + > export const cc2: number = 23; + > export const cc3 = 0, cc4 :string = "", cc5 = null; + >} + >:=> (line 6, col 0) to (line 10, col 1) +-------------------------------- +7 > export const cc1 = false; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (181 to 210) SpanInfo: {"start":185,"length":24} + >export const cc1 = false + >:=> (line 7, col 4) to (line 7, col 28) +-------------------------------- +8 > export const cc2: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (211 to 245) SpanInfo: {"start":215,"length":29} + >export const cc2: number = 23 + >:=> (line 8, col 4) to (line 8, col 33) +-------------------------------- +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (246 to 270) SpanInfo: {"start":250,"length":20} + >export const cc3 = 0 + >:=> (line 9, col 4) to (line 9, col 24) +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~~~~~~ => Pos: (271 to 288) SpanInfo: {"start":272,"length":16} + >cc4 :string = "" + >:=> (line 9, col 26) to (line 9, col 42) +9 > export const cc3 = 0, cc4 :string = "", cc5 = null; + + ~~~~~~~~~~~~~=> Pos: (289 to 301) SpanInfo: {"start":290,"length":10} + >cc5 = null + >:=> (line 9, col 44) to (line 9, col 54) +-------------------------------- +10 >} + + ~~ => Pos: (302 to 303) SpanInfo: {"start":302,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) +-------------------------------- +11 >const enum E { + + ~~~~~~~~~~~~~~~ => Pos: (304 to 318) SpanInfo: {"start":304,"length":52} + >const enum E { + > A = 1, + > B = 2, + > C = A | B + >} + >:=> (line 11, col 0) to (line 15, col 1) +-------------------------------- +12 > A = 1, + + ~~~~~~~~~~~ => Pos: (319 to 329) SpanInfo: {"start":323,"length":5} + >A = 1 + >:=> (line 12, col 4) to (line 12, col 9) +-------------------------------- +13 > B = 2, + + ~~~~~~~~~~~ => Pos: (330 to 340) SpanInfo: {"start":334,"length":5} + >B = 2 + >:=> (line 13, col 4) to (line 13, col 9) +-------------------------------- +14 > C = A | B + + ~~~~~~~~~~~~~~ => Pos: (341 to 354) SpanInfo: {"start":345,"length":9} + >C = A | B + >:=> (line 14, col 4) to (line 14, col 13) +-------------------------------- +15 >} + + ~~ => Pos: (355 to 356) SpanInfo: {"start":355,"length":1} + >} + >:=> (line 15, col 0) to (line 15, col 1) +-------------------------------- +16 >const enum E2 { + + ~~~~~~~~~~~~~~~~ => Pos: (357 to 372) SpanInfo: {"start":357,"length":41} + >const enum E2 { + > A = 1, + > B, + > C + >} + >:=> (line 16, col 0) to (line 20, col 1) +-------------------------------- +17 > A = 1, + + ~~~~~~~~~~~ => Pos: (373 to 383) SpanInfo: {"start":377,"length":5} + >A = 1 + >:=> (line 17, col 4) to (line 17, col 9) +-------------------------------- +18 > B, + + ~~~~~~~ => Pos: (384 to 390) SpanInfo: {"start":388,"length":1} + >B + >:=> (line 18, col 4) to (line 18, col 5) +-------------------------------- +19 > C + + ~~~~~~ => Pos: (391 to 396) SpanInfo: {"start":395,"length":1} + >C + >:=> (line 19, col 4) to (line 19, col 5) +-------------------------------- +20 >} + ~ => Pos: (397 to 397) SpanInfo: {"start":397,"length":1} + >} + >:=> (line 20, col 0) to (line 20, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_let.baseline b/tests/baselines/reference/bpSpan_let.baseline new file mode 100644 index 00000000000..dff12280a96 --- /dev/null +++ b/tests/baselines/reference/bpSpan_let.baseline @@ -0,0 +1,94 @@ + +1 >let l1; + + ~~~~~~~~ => Pos: (0 to 7) SpanInfo: undefined +-------------------------------- +2 >let l2: number; + + ~~~~~~~~~~~~~~~~ => Pos: (8 to 23) SpanInfo: undefined +-------------------------------- +3 >let l3, l4, l5 :string, l6; + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (24 to 51) SpanInfo: undefined +-------------------------------- +4 >let l7 = false; + + ~~~~~~~~~~~~~~~~ => Pos: (52 to 67) SpanInfo: {"start":52,"length":14} + >let l7 = false + >:=> (line 4, col 0) to (line 4, col 14) +-------------------------------- +5 >let l8: number = 23; + + ~~~~~~~~~~~~~~~~~~~~~ => Pos: (68 to 88) SpanInfo: {"start":68,"length":19} + >let l8: number = 23 + >:=> (line 5, col 0) to (line 5, col 19) +-------------------------------- +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~ => Pos: (89 to 99) SpanInfo: {"start":89,"length":10} + >let l9 = 0 + >:=> (line 6, col 0) to (line 6, col 10) +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~~~~~~~~ => Pos: (100 to 117) SpanInfo: {"start":101,"length":16} + >l10 :string = "" + >:=> (line 6, col 12) to (line 6, col 28) +6 >let l9 = 0, l10 :string = "", l11 = null; + + ~~~~~~~~~~~~~ => Pos: (118 to 130) SpanInfo: {"start":119,"length":10} + >l11 = null + >:=> (line 6, col 30) to (line 6, col 40) +-------------------------------- +7 >for(let l11 in {}) { } + + ~~~~~~~~~~~~~~~~~~~~ => Pos: (131 to 150) SpanInfo: {"start":131,"length":18} + >for(let l11 in {}) + >:=> (line 7, col 0) to (line 7, col 18) +7 >for(let l11 in {}) { } + + ~~~ => Pos: (151 to 153) SpanInfo: undefined +-------------------------------- +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~~~~~~~~ => Pos: (154 to 169) SpanInfo: {"start":158,"length":11} + >let l12 = 0 + >:=> (line 8, col 4) to (line 8, col 15) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~ => Pos: (170 to 178) SpanInfo: {"start":171,"length":7} + >l12 < 9 + >:=> (line 8, col 17) to (line 8, col 24) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~~~~~~~ => Pos: (179 to 187) SpanInfo: {"start":180,"length":5} + >l12++ + >:=> (line 8, col 26) to (line 8, col 31) +8 >for(let l12 = 0; l12 < 9; l12++) { } + + ~~~ => Pos: (188 to 190) SpanInfo: undefined +-------------------------------- +9 >module M { + + ~~~~~~~~~~~ => Pos: (191 to 201) SpanInfo: {"start":191,"length":55} + >module M { + > let ll1 = "s"; + > export let ll2 = 0; + >} + >:=> (line 9, col 0) to (line 12, col 1) +-------------------------------- +10 > let ll1 = "s"; + + ~~~~~~~~~~~~~~~~~~~ => Pos: (202 to 220) SpanInfo: {"start":206,"length":13} + >let ll1 = "s" + >:=> (line 10, col 4) to (line 10, col 17) +-------------------------------- +11 > export let ll2 = 0; + + ~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (221 to 244) SpanInfo: {"start":225,"length":18} + >export let ll2 = 0 + >:=> (line 11, col 4) to (line 11, col 22) +-------------------------------- +12 >} + ~ => Pos: (245 to 245) SpanInfo: {"start":245,"length":1} + >} + >:=> (line 12, col 0) to (line 12, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/bpSpan_typealias.baseline b/tests/baselines/reference/bpSpan_typealias.baseline new file mode 100644 index 00000000000..88e60b55e47 --- /dev/null +++ b/tests/baselines/reference/bpSpan_typealias.baseline @@ -0,0 +1,78 @@ + +1 >module m2 { + + ~~~~~~~~~~~~ => Pos: (0 to 11) SpanInfo: {"start":0,"length":164} + >module m2 { + > module m { + > export class c { + > } + > } + > type a = m.c; + > export type b = m.c; + > var x: a = new m.c(); + > var y: b = new m.c(); + >} + >:=> (line 1, col 0) to (line 10, col 1) +-------------------------------- +2 > module m { + + ~~~~~~~~~~~~~~~ => Pos: (12 to 26) SpanInfo: {"start":16,"length":51} + >module m { + > export class c { + > } + > } + >:=> (line 2, col 4) to (line 5, col 5) +-------------------------------- +3 > export class c { + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (27 to 51) SpanInfo: {"start":35,"length":26} + >export class c { + > } + >:=> (line 3, col 8) to (line 4, col 9) +-------------------------------- +4 > } + + ~~~~~~~~~~ => Pos: (52 to 61) SpanInfo: {"start":60,"length":1} + >} + >:=> (line 4, col 8) to (line 4, col 9) +-------------------------------- +5 > } + + ~~~~~~ => Pos: (62 to 67) SpanInfo: {"start":66,"length":1} + >} + >:=> (line 5, col 4) to (line 5, col 5) +-------------------------------- +6 > type a = m.c; + + ~~~~~~~~~~~~~~~~~~ => Pos: (68 to 85) SpanInfo: undefined +-------------------------------- +7 > export type b = m.c; + + ~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (86 to 110) SpanInfo: undefined +-------------------------------- +8 > var x: a = new m.c(); + + ~~~~~~~~~~~~~~ => Pos: (111 to 124) SpanInfo: {"start":115,"length":20} + >var x: a = new m.c() + >:=> (line 8, col 4) to (line 8, col 24) +8 > var x: a = new m.c(); + + ~~~~~~~~~~~~ => Pos: (125 to 136) SpanInfo: {"start":126,"length":9} + >new m.c() + >:=> (line 8, col 15) to (line 8, col 24) +-------------------------------- +9 > var y: b = new m.c(); + + ~~~~~~~~~~~~~~ => Pos: (137 to 150) SpanInfo: {"start":141,"length":20} + >var y: b = new m.c() + >:=> (line 9, col 4) to (line 9, col 24) +9 > var y: b = new m.c(); + + ~~~~~~~~~~~~ => Pos: (151 to 162) SpanInfo: {"start":152,"length":9} + >new m.c() + >:=> (line 9, col 15) to (line 9, col 24) +-------------------------------- +10 >} + ~ => Pos: (163 to 163) SpanInfo: {"start":163,"length":1} + >} + >:=> (line 10, col 0) to (line 10, col 1) \ No newline at end of file diff --git a/tests/baselines/reference/callConstructAssignment.errors.txt b/tests/baselines/reference/callConstructAssignment.errors.txt index e3f850a1855..42949cf585d 100644 --- a/tests/baselines/reference/callConstructAssignment.errors.txt +++ b/tests/baselines/reference/callConstructAssignment.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2323: Type 'new () => any' is not assignable to type '() => void'. -tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2323: Type '() => void' is not assignable to type 'new () => any'. +tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2322: Type 'new () => any' is not assignable to type '() => void'. +tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => void' is not assignable to type 'new () => any'. ==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2323: Type '() => foo = bar; // error ~~~ -!!! error TS2323: Type 'new () => any' is not assignable to type '() => void'. +!!! error TS2322: Type 'new () => any' is not assignable to type '() => void'. bar = foo; // error ~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt index 9c85dad20e9..cc8599ca91f 100644 --- a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/callOverloadViaElementAccessExpression.ts(10,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/callOverloadViaElementAccessExpression.ts(10,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/callOverloadViaElementAccessExpression.ts (2 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS23 var c = new C(); var r: string = c['foo'](1); ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: number = c['foo'](''); ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt index d0e31f4a246..d6efdd66868 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type '(x: number) => string' is not assignable to type '(x: number) => number': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts(57,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type '(x: number) => string' is not assignable to type '(x: number) => number'. Type 'string' is not assignable to type 'number'. @@ -63,10 +63,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: number) => string' is not assignable to type '(x: number) => number': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: number) => string' is not assignable to type '(x: number) => number'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 51bf9695692..7e9d75b1b41 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2429: Interface 'I2' incorrectly extends interface 'A': - Types of property 'a2' are incompatible: - Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. + Types of property 'a2' are incompatible. + Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. + Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2429: Interface 'I4' incorrectly extends interface 'A': - Types of property 'a8' are incompatible: - Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. + Types of property 'a8' are incompatible. + Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. @@ -67,11 +67,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign interface I2 extends A { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a2' are incompatible: -!!! error TS2429: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]': -!!! error TS2429: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -82,15 +82,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign interface I4 extends A { ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a8' are incompatible: -!!! error TS2429: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2429: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2429: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2429: Types of property 'foo' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a8' are incompatible. +!!! error TS2430: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt index 1f018be434a..35718ca9612 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -13,7 +13,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts (16 errors) ==== @@ -91,7 +91,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith ~ !!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. b: (x?: any = '') => { } ~ !!! error TS1015: Parameter cannot have question mark and initializer. diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt index aada6c9f8a1..5fabfd0b7ad 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I': +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. Named properties 'foo' of types 'I' and 'I' are not identical. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. @@ -13,7 +13,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha interface A extends I, I { } ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. !!! error TS2320: Named properties 'foo' of types 'I' and 'I' are not identical. var x: A; diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index c3079699a80..f4efed6f1d1 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -1,19 +1,18 @@ -tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2353: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other: +tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other. Property '2' is missing in type '[number, string]'. -tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2353: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other: +tests/cases/conformance/types/tuple/castingTuple.ts(16,21): error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other. Property '2' is missing in type '[C, D]'. -tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other: - Types of property '1' are incompatible: +tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other. + Types of property '1' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other: - Types of property '0' are incompatible: - Type 'C' is not assignable to type 'A': - Property 'a' is missing in type 'C'. +tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other. + Types of property '0' are incompatible. + Type 'C' is not assignable to type 'A'. tests/cases/conformance/types/tuple/castingTuple.ts(26,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. -tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other: - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => number': - Type 'string | number' is not assignable to type 'number': +tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot find name 't4'. @@ -33,14 +32,14 @@ tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot var emptyObjTuple = <[{}, {}]>numStrTuple; var numStrBoolTuple = <[number, string, boolean]>numStrTuple; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other: -!!! error TS2353: Property '2' is missing in type '[number, string]'. +!!! error TS2352: Neither type '[number, string]' nor type '[number, string, boolean]' is assignable to the other. +!!! error TS2352: Property '2' is missing in type '[number, string]'. var classCDTuple: [C, D] = [new C(), new D()]; var interfaceIITuple = <[I, I]>classCDTuple; var classCDATuple = <[C, D, A]>classCDTuple; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other: -!!! error TS2353: Property '2' is missing in type '[C, D]'. +!!! error TS2352: Neither type '[C, D]' nor type '[C, D, A]' is assignable to the other. +!!! error TS2352: Property '2' is missing in type '[C, D]'. var eleFromCDA1 = classCDATuple[2]; // A var eleFromCDA2 = classCDATuple[5]; // {} var t10: [E1, E2] = [E1.one, E2.one]; @@ -50,24 +49,23 @@ tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot // error var t3 = <[number, number]>numStrTuple; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other: -!!! error TS2353: Types of property '1' are incompatible: -!!! error TS2353: Type 'string' is not assignable to type 'number'. +!!! error TS2352: Neither type '[number, string]' nor type '[number, number]' is assignable to the other. +!!! error TS2352: Types of property '1' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. var t9 = <[A, I]>classCDTuple; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other: -!!! error TS2353: Types of property '0' are incompatible: -!!! error TS2353: Type 'C' is not assignable to type 'A': -!!! error TS2353: Property 'a' is missing in type 'C'. +!!! error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other. +!!! error TS2352: Types of property '0' are incompatible. +!!! error TS2352: Type 'C' is not assignable to type 'A'. var array1 = numStrTuple; ~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other: -!!! error TS2353: Types of property 'pop' are incompatible: -!!! error TS2353: Type '() => string | number' is not assignable to type '() => number': -!!! error TS2353: Type 'string | number' is not assignable to type 'number': -!!! error TS2353: Type 'string' is not assignable to type 'number'. +!!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other. +!!! error TS2352: Types of property 'pop' are incompatible. +!!! error TS2352: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2352: Type 'string | number' is not assignable to type 'number'. +!!! error TS2352: Type 'string' is not assignable to type 'number'. t4[2] = 10; ~~ !!! error TS2304: Cannot find name 't4'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt index 29555d10dcb..3fa654c62cc 100644 --- a/tests/baselines/reference/chainedAssignment1.errors.txt +++ b/tests/baselines/reference/chainedAssignment1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X': +tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y': +tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not assignable to type 'Y'. +tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not assignable to type 'Y'. ==== tests/cases/compiler/chainedAssignment1.ts (3 errors) ==== @@ -28,11 +28,11 @@ tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not var c3 = new Z(); c1 = c2 = c3; // a bug made this not report the same error as below ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'X': +!!! error TS2322: Type 'Z' is not assignable to type 'X'. !!! error TS2322: Property 'a' is missing in type 'Z'. ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'Y': +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. !!! error TS2322: Property 'a' is missing in type 'Z'. c2 = c3; // Error TS111: Cannot convert Z to Y ~~ -!!! error TS2323: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt index 758c3e2a332..8a64a35cbc0 100644 --- a/tests/baselines/reference/chainedAssignment3.errors.txt +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B': +tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B'. Property 'value' is missing in type 'A'. -tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not assignable to type 'B'. +tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not assignable to type 'B'. ==== tests/cases/compiler/chainedAssignment3.ts (2 errors) ==== @@ -23,11 +23,11 @@ tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not // error cases b = a = new A(); ~ -!!! error TS2322: Type 'A' is not assignable to type 'B': +!!! error TS2322: Type 'A' is not assignable to type 'B'. !!! error TS2322: Property 'value' is missing in type 'A'. a = b = new A(); ~ -!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignmentChecking.errors.txt b/tests/baselines/reference/chainedAssignmentChecking.errors.txt index 3748995e4f0..ac3bade0aae 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.errors.txt +++ b/tests/baselines/reference/chainedAssignmentChecking.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X': +tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y': +tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. Property 'a' is missing in type 'Z'. @@ -27,9 +27,9 @@ tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' c1 = c2 = c3; // Should be error ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'X': +!!! error TS2322: Type 'Z' is not assignable to type 'X'. !!! error TS2322: Property 'a' is missing in type 'Z'. ~~ -!!! error TS2322: Type 'Z' is not assignable to type 'Y': +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. !!! error TS2322: Property 'a' is missing in type 'Z'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 26df8a15ca0..e307cc9be89 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(7,43): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,29): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts (5 errors) ==== @@ -43,16 +43,16 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete // Should get an error that we are assigning a string to a number (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Staying at T or S should keep the constraint. // Get an error when we assign a string to a number in both cases (new Chain2(i)).then(ii => t).then(tt => t).then(tt => t).then(tt => t).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. return null; } diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.js b/tests/baselines/reference/checkInfiniteExpansionTermination.js new file mode 100644 index 00000000000..ed52ea6b419 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.js @@ -0,0 +1,25 @@ +//// [checkInfiniteExpansionTermination.ts] +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { + n: IObservable; // Needed, must be T[] +} + +// Needed +interface ISubject extends IObservable { } + +interface Foo { x } +interface Bar { y } + +var values: IObservable; +var values2: ISubject; +values = values2; + + +//// [checkInfiniteExpansionTermination.js] +// Regression test for #1002 +// Before fix this code would cause infinite loop +var values; +var values2; +values = values2; diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.types b/tests/baselines/reference/checkInfiniteExpansionTermination.types new file mode 100644 index 00000000000..bd4858126dd --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.types @@ -0,0 +1,44 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : IObservable +>T : T + + n: IObservable; // Needed, must be T[] +>n : IObservable +>IObservable : IObservable +>T : T +} + +// Needed +interface ISubject extends IObservable { } +>ISubject : ISubject +>T : T +>IObservable : IObservable +>T : T + +interface Foo { x } +>Foo : Foo +>x : any + +interface Bar { y } +>Bar : Bar +>y : any + +var values: IObservable; +>values : IObservable +>IObservable : IObservable +>Foo : Foo + +var values2: ISubject; +>values2 : ISubject +>ISubject : ISubject +>Bar : Bar + +values = values2; +>values = values2 : ISubject +>values : IObservable +>values2 : ISubject + diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.js b/tests/baselines/reference/checkInfiniteExpansionTermination2.js new file mode 100644 index 00000000000..6175b34e522 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.js @@ -0,0 +1,27 @@ +//// [checkInfiniteExpansionTermination2.ts] +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { + n: IObservable; +} +interface ISubject extends IObservable { } + +declare function combineLatest(x: IObservable[]): void; +declare function combineLatest(): void; + +function fn() { + var values: ISubject[] = []; + // Hang when using , but not + combineLatest(values); +} + + +//// [checkInfiniteExpansionTermination2.js] +// Regression test for #1002 +// Before fix this code would cause infinite loop +function fn() { + var values = []; + // Hang when using , but not + combineLatest(values); +} diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.types b/tests/baselines/reference/checkInfiniteExpansionTermination2.types new file mode 100644 index 00000000000..fc81e1c9304 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.types @@ -0,0 +1,46 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination2.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : IObservable +>T : T + + n: IObservable; +>n : IObservable +>IObservable : IObservable +>T : T +} +interface ISubject extends IObservable { } +>ISubject : ISubject +>T : T +>IObservable : IObservable +>T : T + +declare function combineLatest(x: IObservable[]): void; +>combineLatest : { (x: IObservable[]): void; (): void; } +>TOther : TOther +>x : IObservable[] +>IObservable : IObservable +>TOther : TOther + +declare function combineLatest(): void; +>combineLatest : { (x: IObservable[]): void; (): void; } + +function fn() { +>fn : () => void +>T : T + + var values: ISubject[] = []; +>values : ISubject[] +>ISubject : ISubject +>[] : undefined[] + + // Hang when using , but not + combineLatest(values); +>combineLatest(values) : void +>combineLatest : { (x: IObservable[]): void; (): void; } +>T : T +>values : ISubject[] +} + diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt index cff696696b7..ea3927b51d1 100644 --- a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2421: Class 'D2' incorrectly implements interface 'I': +tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7): error TS2420: Class 'D2' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. @@ -14,8 +14,8 @@ tests/cases/compiler/classExtendsInterfaceThatExtendsClassWithPrivates1.ts(10,7) class D2 implements I { ~~ -!!! error TS2421: Class 'D2' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D2' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x } private x = 3; other(x: any) { return x } diff --git a/tests/baselines/reference/classImplementsClass2.errors.txt b/tests/baselines/reference/classImplementsClass2.errors.txt index f1fabd8a975..49eeed75fe0 100644 --- a/tests/baselines/reference/classImplementsClass2.errors.txt +++ b/tests/baselines/reference/classImplementsClass2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2421: Class 'C' incorrectly implements interface 'A': +tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Property 'foo' is missing in type 'C'. -tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is not assignable to type 'C2': +tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is not assignable to type 'C2'. Property 'foo' is missing in type 'C'. @@ -8,8 +8,8 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is n class A { foo(): number { return 1; } } class C implements A {} // error ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'A': -!!! error TS2421: Property 'foo' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Property 'foo' is missing in type 'C'. class C2 extends A { foo() { @@ -22,5 +22,5 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is n c = c2; c2 = c; ~~ -!!! error TS2322: Type 'C' is not assignable to type 'C2': +!!! error TS2322: Type 'C' is not assignable to type 'C2'. !!! error TS2322: Property 'foo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass4.errors.txt b/tests/baselines/reference/classImplementsClass4.errors.txt index 7539cb1a752..ecc9d6d8582 100644 --- a/tests/baselines/reference/classImplementsClass4.errors.txt +++ b/tests/baselines/reference/classImplementsClass4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A': +tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Property 'x' is missing in type 'C'. -tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is not assignable to type 'C2': +tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is not assignable to type 'C2'. Property 'x' is missing in type 'C'. @@ -11,8 +11,8 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is n } class C implements A { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'A': -!!! error TS2421: Property 'x' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is missing in type 'C'. foo() { return 1; } @@ -25,5 +25,5 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is n c = c2; c2 = c; ~~ -!!! error TS2322: Type 'C' is not assignable to type 'C2': +!!! error TS2322: Type 'C' is not assignable to type 'C2'. !!! error TS2322: Property 'x' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass5.errors.txt b/tests/baselines/reference/classImplementsClass5.errors.txt index 6328e595e13..076120fdbaf 100644 --- a/tests/baselines/reference/classImplementsClass5.errors.txt +++ b/tests/baselines/reference/classImplementsClass5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2421: Class 'C' incorrectly implements interface 'A': +tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C': +tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2': +tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2'. Types have separate declarations of a private property 'x'. @@ -13,8 +13,8 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n } class C implements A { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'A': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'C' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x = 1; foo() { return 1; @@ -27,9 +27,9 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is n var c2: C2; c = c2; ~ -!!! error TS2322: Type 'C2' is not assignable to type 'C': +!!! error TS2322: Type 'C2' is not assignable to type 'C'. !!! error TS2322: Types have separate declarations of a private property 'x'. c2 = c; ~~ -!!! error TS2322: Type 'C' is not assignable to type 'C2': +!!! error TS2322: Type 'C' is not assignable to type 'C2'. !!! error TS2322: Types have separate declarations of a private property 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt index 7ba816475fb..88176d95026 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>': - Types of property 'foo' are incompatible: - Type '{ bar?: string; }' is not assignable to type '{ bar: string; }': +tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classIsSubtypeOfBaseType.ts(11,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'. + Types of property 'foo' are incompatible. + Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. @@ -17,10 +17,10 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla class Derived2 extends Base<{ bar: string; }> { ~~~~~~~~ -!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }': -!!! error TS2416: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base<{ bar: string; }>'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. +!!! error TS2415: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. foo: { bar?: string; // error } diff --git a/tests/baselines/reference/classMemberInitializerScoping.errors.txt b/tests/baselines/reference/classMemberInitializerScoping.errors.txt index 7df3c0518b6..dddc7a82a3f 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.errors.txt +++ b/tests/baselines/reference/classMemberInitializerScoping.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/classMemberInitializerScoping.ts(3,17): error TS2301: Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. -tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/classMemberInitializerScoping.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2323: Type ' constructor(aaa) { this.y = ''; // was: error, cannot assign string to number ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index 48d7165adcd..c845defa5b8 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2323: Type 'typeof B' is not assignable to type 'typeof A'. -tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2323: Type 'typeof B' is not assignable to type 'new (x: string) => A'. +tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. +tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== @@ -20,8 +20,8 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2323: Type 'typeof var r1: typeof A = B; // error ~~ -!!! error TS2323: Type 'typeof B' is not assignable to type 'typeof A'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. var r2: new (x: string) => A = B; // error ~~ -!!! error TS2323: Type 'typeof B' is not assignable to type 'new (x: string) => A'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/classUpdateTests.errors.txt b/tests/baselines/reference/classUpdateTests.errors.txt index 4548560df15..6bfd7518855 100644 --- a/tests/baselines/reference/classUpdateTests.errors.txt +++ b/tests/baselines/reference/classUpdateTests.errors.txt @@ -9,9 +9,9 @@ tests/cases/compiler/classUpdateTests.ts(43,18): error TS2335: 'super' can only tests/cases/compiler/classUpdateTests.ts(46,17): error TS2311: A class may only extend another class. tests/cases/compiler/classUpdateTests.ts(47,18): error TS2335: 'super' can only be referenced in a derived class. tests/cases/compiler/classUpdateTests.ts(57,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. -tests/cases/compiler/classUpdateTests.ts(63,7): error TS2416: Class 'L' incorrectly extends base class 'G': +tests/cases/compiler/classUpdateTests.ts(63,7): error TS2415: Class 'L' incorrectly extends base class 'G'. Property 'p1' is private in type 'L' but not in type 'G'. -tests/cases/compiler/classUpdateTests.ts(69,7): error TS2416: Class 'M' incorrectly extends base class 'G': +tests/cases/compiler/classUpdateTests.ts(69,7): error TS2415: Class 'M' incorrectly extends base class 'G'. Property 'p1' is private in type 'M' but not in type 'G'. tests/cases/compiler/classUpdateTests.ts(70,2): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties. tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'. @@ -96,8 +96,8 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do class L extends G { ~ -!!! error TS2416: Class 'L' incorrectly extends base class 'G': -!!! error TS2416: Property 'p1' is private in type 'L' but not in type 'G'. +!!! error TS2415: Class 'L' incorrectly extends base class 'G'. +!!! error TS2415: Property 'p1' is private in type 'L' but not in type 'G'. constructor(private p1:number) { super(); // NO ERROR } @@ -105,8 +105,8 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do class M extends G { ~ -!!! error TS2416: Class 'M' incorrectly extends base class 'G': -!!! error TS2416: Property 'p1' is private in type 'M' but not in type 'G'. +!!! error TS2415: Class 'M' incorrectly extends base class 'G'. +!!! error TS2415: Property 'p1' is private in type 'M' but not in type 'G'. constructor(private p1:number) { // ERROR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var i = 0; diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt index 5463a3b21ee..37eb63547ed 100644 --- a/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt +++ b/tests/baselines/reference/classWithMultipleBaseClasses.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2421: Class 'D' incorrectly implements interface 'I': +tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2420: Class 'D' incorrectly implements interface 'I'. Property 'foo' is missing in type 'D'. @@ -22,8 +22,8 @@ tests/cases/compiler/classWithMultipleBaseClasses.ts(18,7): error TS2421: Class class D implements I, J { ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'I': -!!! error TS2421: Property 'foo' is missing in type 'D'. +!!! error TS2420: Class 'D' incorrectly implements interface 'I'. +!!! error TS2420: Property 'foo' is missing in type 'D'. baz() { } bat() { } } diff --git a/tests/baselines/reference/cloduleAndTypeParameters.types b/tests/baselines/reference/cloduleAndTypeParameters.types index 493aaa2d395..ad43bc90f2f 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.types +++ b/tests/baselines/reference/cloduleAndTypeParameters.types @@ -2,7 +2,7 @@ class Foo { >Foo : Foo >T : T ->Foo : Foo +>Foo : unknown >Bar : Foo.Bar constructor() { diff --git a/tests/baselines/reference/clodulesDerivedClasses.errors.txt b/tests/baselines/reference/clodulesDerivedClasses.errors.txt index e4ce78e1875..1753f6051bd 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.errors.txt +++ b/tests/baselines/reference/clodulesDerivedClasses.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2418: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape': - Types of property 'Utils' are incompatible: - Type 'typeof Utils' is not assignable to type 'typeof Utils': +tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. + Types of property 'Utils' are incompatible. + Type 'typeof Utils' is not assignable to type 'typeof Utils'. Property 'convert' is missing in type 'typeof Utils'. @@ -15,10 +15,10 @@ tests/cases/compiler/clodulesDerivedClasses.ts(9,7): error TS2418: Class static class Path extends Shape { ~~~~ -!!! error TS2418: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape': -!!! error TS2418: Types of property 'Utils' are incompatible: -!!! error TS2418: Type 'typeof Utils' is not assignable to type 'typeof Utils': -!!! error TS2418: Property 'convert' is missing in type 'typeof Utils'. +!!! error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. +!!! error TS2417: Types of property 'Utils' are incompatible. +!!! error TS2417: Type 'typeof Utils' is not assignable to type 'typeof Utils'. +!!! error TS2417: Property 'convert' is missing in type 'typeof Utils'. name: string; } diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt index 5d0d67067e5..ecf7e5ed1dc 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2323: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2323: Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2323: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2323: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts (6 errors) ==== @@ -18,22 +18,22 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignment //Expect errors when the results type is different form the second operand resultIsBoolean = (BOOLEAN, STRING); ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. resultIsBoolean = (BOOLEAN, NUMBER); ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. resultIsNumber = (NUMBER, BOOLEAN); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. resultIsNumber = (NUMBER, STRING); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. resultIsString = (STRING, BOOLEAN); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. resultIsString = (STRING, NUMBER); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt index 75cd76e407e..32e8464a195 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2323: Type 'T2' is not assignable to type 'T1'. +tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'. ==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOpera } var resultIsString: number = foo(1, "123"); //error here ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. //TypeParameters function foo1() { @@ -18,5 +18,5 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOpera var y: T2; var result: T1 = (x, y); //error here ~~~~~~ -!!! error TS2323: Type 'T2' is not assignable to type 'T1'. +!!! error TS2322: Type 'T2' is not assignable to type 'T1'. } \ No newline at end of file diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt index 2055bbc2b34..535e4eb1a30 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2323: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2323: Type 'string' is not assignable to type 'E'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }': +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }'. Property 'a' is missing in type 'String'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2323: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2322: Type 'string' is not assignable to type 'void'. ==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts (5 errors) ==== @@ -13,25 +13,25 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen var x1: boolean; x1 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. var x2: number; x2 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var x3: E; x3 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type 'string' is not assignable to type 'E'. var x4: {a: string}; x4 += ''; ~~ -!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }': +!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }'. !!! error TS2322: Property 'a' is missing in type 'String'. var x5: void; x5 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt index 30703c7169e..0e291986785 100644 --- a/tests/baselines/reference/conditionalExpression1.errors.txt +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean': +tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'. Type 'string' is not assignable to type 'boolean'. ==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ==== var x: boolean = (true ? 1 : ""); // should be an error ~ -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean': +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. !!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt index b1dd23fc3e3..954e8af856f 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A': - Type 'B' is not assignable to type 'A': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A'. + Type 'B' is not assignable to type 'A'. Property 'propertyA' is missing in type 'B'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B': - Type 'A' is not assignable to type 'B': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B'. + Type 'A' is not assignable to type 'B'. Property 'propertyB' is missing in type 'A'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number': - Type '(n: X) => string' is not assignable to type '(t: X) => number': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. + Type '(n: X) => string' is not assignable to type '(t: X) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string': - Type '(m: X) => number' is not assignable to type '(t: X) => string': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. + Type '(m: X) => number' is not assignable to type '(t: X) => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean': - Type '(m: X) => number' is not assignable to type '(t: X) => boolean': +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. + Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. Type 'number' is not assignable to type 'boolean'. @@ -32,27 +32,27 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou //Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target var result2: A = true ? a : b; ~~~~~~~ -!!! error TS2322: Type 'A | B' is not assignable to type 'A': -!!! error TS2322: Type 'B' is not assignable to type 'A': +!!! error TS2322: Type 'A | B' is not assignable to type 'A'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. !!! error TS2322: Property 'propertyA' is missing in type 'B'. var result3: B = true ? a : b; ~~~~~~~ -!!! error TS2322: Type 'A | B' is not assignable to type 'B': -!!! error TS2322: Type 'A' is not assignable to type 'B': +!!! error TS2322: Type 'A | B' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. !!! error TS2322: Property 'propertyB' is missing in type 'A'. var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number': -!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number': +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. +!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string': -!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string': +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. +!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean': -!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean': +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. +!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. !!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt index dfd87465894..58fdcb4c7ae 100644 --- a/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt +++ b/tests/baselines/reference/conflictingMemberTypesInBases.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D': +tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'. Named properties 'm' of types 'B' and 'D' are not identical. @@ -16,7 +16,7 @@ tests/cases/compiler/conflictingMemberTypesInBases.ts(12,11): error TS2320: Inte interface E extends B { } // Error here for extending B and D ~ -!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D': +!!! error TS2320: Interface 'E' cannot simultaneously extend types 'B' and 'D'. !!! error TS2320: Named properties 'm' of types 'B' and 'D' are not identical. interface E extends D { } // No duplicate error here \ No newline at end of file diff --git a/tests/baselines/reference/constEnumDeclarations.js b/tests/baselines/reference/constEnumDeclarations.js new file mode 100644 index 00000000000..1cbacb13bbd --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.js @@ -0,0 +1,28 @@ +//// [constEnumDeclarations.ts] + +const enum E { + A = 1, + B = 2, + C = A | B +} + +const enum E2 { + A = 1, + B, + C +} + +//// [constEnumDeclarations.js] + + +//// [constEnumDeclarations.d.ts] +declare const enum E { + A = 1, + B = 2, + C = 3, +} +declare const enum E2 { + A = 1, + B = 2, + C = 3, +} diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types new file mode 100644 index 00000000000..9dc87eadef7 --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -0,0 +1,30 @@ +=== tests/cases/compiler/constEnumDeclarations.ts === + +const enum E { +>E : E + + A = 1, +>A : E + + B = 2, +>B : E + + C = A | B +>C : E +>A | B : number +>A : E +>B : E +} + +const enum E2 { +>E2 : E2 + + A = 1, +>A : E2 + + B, +>B : E2 + + C +>C : E2 +} diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt new file mode 100644 index 00000000000..541f814af98 --- /dev/null +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -0,0 +1,85 @@ +tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(12,9): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(14,9): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(15,10): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(22,13): error TS4085: Index expression arguments in 'const' enums must be of type 'string'. +tests/cases/compiler/constEnumErrors.ts(24,13): error TS4085: Index expression arguments in 'const' enums must be of type 'string'. +tests/cases/compiler/constEnumErrors.ts(26,9): error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/compiler/constEnumErrors.ts(27,10): error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/compiler/constEnumErrors.ts(32,5): error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/compiler/constEnumErrors.ts(40,9): error TS4086: 'const' enum member initializer was evaluated to a non-finite value. +tests/cases/compiler/constEnumErrors.ts(41,9): error TS4086: 'const' enum member initializer was evaluated to a non-finite value. +tests/cases/compiler/constEnumErrors.ts(42,9): error TS4087: 'const' enum member initializer was evaluated to disallowed value 'NaN'. + + +==== tests/cases/compiler/constEnumErrors.ts (13 errors) ==== + const enum E { + ~ +!!! error TS2300: Duplicate identifier 'E'. + A + } + + module E { + ~ +!!! error TS2300: Duplicate identifier 'E'. + var x = 1; + } + + const enum E1 { + // illegal case + // forward reference to the element of the same enum + X = Y, + ~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + // forward reference to the element of the same enum + Y = E1.Z, + ~~~~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + Y1 = E1["Z"] + ~~~~~~~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + } + + const enum E2 { + A + } + + var y0 = E2[1] + ~ +!!! error TS4085: Index expression arguments in 'const' enums must be of type 'string'. + var name = "A"; + var y1 = E2[name]; + ~~~~ +!!! error TS4085: Index expression arguments in 'const' enums must be of type 'string'. + + var x = E2; + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + var y = [E2]; + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + + function foo(t: any): void { + } + + foo(E2); + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + + const enum NaNOrInfinity { + A = 9007199254740992, + B = A * A, + C = B * B, + D = C * C, + E = D * D, + F = E * E, // overflow + ~~~~~ +!!! error TS4086: 'const' enum member initializer was evaluated to a non-finite value. + G = 1 / 0, // overflow + ~~~~~ +!!! error TS4086: 'const' enum member initializer was evaluated to a non-finite value. + H = 0 / 0 // NaN + ~~~~~ +!!! error TS4087: 'const' enum member initializer was evaluated to disallowed value 'NaN'. + } \ No newline at end of file diff --git a/tests/baselines/reference/constEnumExternalModule.js b/tests/baselines/reference/constEnumExternalModule.js new file mode 100644 index 00000000000..4054ba788cb --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/constEnumExternalModule.ts] //// + +//// [m1.ts] +const enum E { + V = 100 +} + +export = E +//// [m2.ts] +import A = require('m1') +var v = A.V; + +//// [m1.js] +define(["require", "exports"], function (require, exports) { +}); +//// [m2.js] +define(["require", "exports"], function (require, exports) { + var v = 100 /* V */; +}); diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types new file mode 100644 index 00000000000..9c7b43a24d4 --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/m2.ts === +import A = require('m1') +>A : typeof A + +var v = A.V; +>v : A +>A.V : A +>A : typeof A +>V : A + +=== tests/cases/compiler/m1.ts === +const enum E { +>E : E + + V = 100 +>V : E +} + +export = E +>E : E + diff --git a/tests/baselines/reference/constEnums.js b/tests/baselines/reference/constEnums.js new file mode 100644 index 00000000000..4f85cc59d0e --- /dev/null +++ b/tests/baselines/reference/constEnums.js @@ -0,0 +1,223 @@ +//// [constEnums.ts] +const enum Enum1 { + A0 = 100, +} + +const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], +} + + +module A { + export module B { + export module C { + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } +} + +module A { + export module B { + export module C { + export const enum E { + V3 = A.B.C.E["V2"] & 200, + } + } + } +} + +module A1 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + } +} + +module A2 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export module C { + var x = 1 + } + } +} + +import I = A.B.C.E; +import I1 = A1.B; +import I2 = A2.B; + +function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } +} + +function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } +} + +function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } +} + + +function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1.U: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } +} + +function bar(e: A.B.C.E): number { + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } +} + +//// [constEnums.js] +var A2; +(function (A2) { + var B; + (function (B) { + // module C will be classified as value + var C; + (function (C) { + var x = 1; + })(C = B.C || (B.C = {})); + })(B = A2.B || (A2.B = {})); +})(A2 || (A2 = {})); +var I2 = A2.B; +function foo0(e) { + if (e === 1 /* V1 */) { + } + else if (e === 101 /* V2 */) { + } +} +function foo1(e) { + if (e === 10 /* V1 */) { + } + else if (e === 110 /* V2 */) { + } +} +function foo2(e) { + if (e === 10 /* V1 */) { + } + else if (e === 110 /* V2 */) { + } +} +function foo(x) { + switch (x) { + case 0 /* A */: + case 1 /* B */: + case 10 /* C */: + case 1 /* D */: + case 1 /* E */: + case 1 /* F */: + case 1 /* G */: + case -2 /* H */: + case 0 /* I */: + case 0 /* J */: + case -6 /* K */: + case -2 /* L */: + case 2 /* M */: + case 2 /* N */: + case 0 /* O */: + case 0 /* P */: + case -1 /* Q */: + case 0 /* R */: + case 0 /* S */: + case 11 /* "T" */: + case 11 /* U */: + case 11 /* V */: + case 11 /* W */: + case 100 /* W1 */: + case 100 /* W2 */: + case 100 /* W3 */: + case 11 /* W4 */: + break; + } +} +function bar(e) { + switch (e) { + case 1 /* V1 */: return 1; + case 101 /* V2 */: return 1; + case 64 /* V3 */: return 1; + } +} diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types new file mode 100644 index 00000000000..396b2e1c32b --- /dev/null +++ b/tests/baselines/reference/constEnums.types @@ -0,0 +1,556 @@ +=== tests/cases/compiler/constEnums.ts === +const enum Enum1 { +>Enum1 : Enum1 + + A0 = 100, +>A0 : Enum1 +} + +const enum Enum1 { +>Enum1 : Enum1 + + // correct cases + A, +>A : Enum1 + + B, +>B : Enum1 + + C = 10, +>C : Enum1 + + D = A | B, +>D : Enum1 +>A | B : number +>A : Enum1 +>B : Enum1 + + E = A | 1, +>E : Enum1 +>A | 1 : number +>A : Enum1 + + F = 1 | A, +>F : Enum1 +>1 | A : number +>A : Enum1 + + G = (1 & 1), +>G : Enum1 +>(1 & 1) : number +>1 & 1 : number + + H = ~(A | B), +>H : Enum1 +>~(A | B) : number +>(A | B) : number +>A | B : number +>A : Enum1 +>B : Enum1 + + I = A >>> 1, +>I : Enum1 +>A >>> 1 : number +>A : Enum1 + + J = 1 & A, +>J : Enum1 +>1 & A : number +>A : Enum1 + + K = ~(1 | 5), +>K : Enum1 +>~(1 | 5) : number +>(1 | 5) : number +>1 | 5 : number + + L = ~D, +>L : Enum1 +>~D : number +>D : Enum1 + + M = E << B, +>M : Enum1 +>E << B : number +>E : Enum1 +>B : Enum1 + + N = E << 1, +>N : Enum1 +>E << 1 : number +>E : Enum1 + + O = E >> B, +>O : Enum1 +>E >> B : number +>E : Enum1 +>B : Enum1 + + P = E >> 1, +>P : Enum1 +>E >> 1 : number +>E : Enum1 + + Q = -D, +>Q : Enum1 +>-D : number +>D : Enum1 + + R = C & 5, +>R : Enum1 +>C & 5 : number +>C : Enum1 + + S = 5 & C, +>S : Enum1 +>5 & C : number +>C : Enum1 + + T = C | D, +>T : Enum1 +>C | D : number +>C : Enum1 +>D : Enum1 + + U = C | 1, +>U : Enum1 +>C | 1 : number +>C : Enum1 + + V = 10 | D, +>V : Enum1 +>10 | D : number +>D : Enum1 + + W = Enum1.V, +>W : Enum1 +>Enum1.V : Enum1 +>Enum1 : typeof Enum1 +>V : Enum1 + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, +>W1 : Enum1 +>A0 : Enum1 + + W2 = Enum1.A0, +>W2 : Enum1 +>Enum1.A0 : Enum1 +>Enum1 : typeof Enum1 +>A0 : Enum1 + + W3 = Enum1["A0"], +>W3 : Enum1 +>Enum1["A0"] : Enum1 +>Enum1 : typeof Enum1 + + W4 = Enum1["W"], +>W4 : Enum1 +>Enum1["W"] : Enum1 +>Enum1 : typeof Enum1 +} + + +module A { +>A : typeof A + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 1, +>V1 : E + + V2 = A.B.C.E.V1 | 100 +>V2 : E +>A.B.C.E.V1 | 100 : number +>A.B.C.E.V1 : E +>A.B.C.E : typeof E +>A.B.C : typeof C +>A.B : typeof B +>A : typeof A +>B : typeof B +>C : typeof C +>E : typeof E +>V1 : E + } + } + } +} + +module A { +>A : typeof A + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V3 = A.B.C.E["V2"] & 200, +>V3 : E +>A.B.C.E["V2"] & 200 : number +>A.B.C.E["V2"] : E +>A.B.C.E : typeof E +>A.B.C : typeof C +>A.B : typeof B +>A : typeof A +>B : typeof B +>C : typeof C +>E : typeof E + } + } + } +} + +module A1 { +>A1 : typeof A1 + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 10, +>V1 : E + + V2 = 110, +>V2 : E + } + } + } +} + +module A2 { +>A2 : typeof A2 + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 10, +>V1 : E + + V2 = 110, +>V2 : E + } + } + // module C will be classified as value + export module C { +>C : typeof C + + var x = 1 +>x : number + } + } +} + +import I = A.B.C.E; +>I : typeof I +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : I + +import I1 = A1.B; +>I1 : typeof I1 +>A1 : typeof A1 +>B : typeof I1 + +import I2 = A2.B; +>I2 : typeof I2 +>A2 : typeof A2 +>B : typeof I2 + +function foo0(e: I): void { +>foo0 : (e: I) => void +>e : I +>I : I + + if (e === I.V1) { +>e === I.V1 : boolean +>e : I +>I.V1 : I +>I : typeof I +>V1 : I + } + else if (e === I.V2) { +>e === I.V2 : boolean +>e : I +>I.V2 : I +>I : typeof I +>V2 : I + } +} + +function foo1(e: I1.C.E): void { +>foo1 : (e: I1.C.E) => void +>e : I1.C.E +>I1 : unknown +>C : unknown +>E : I1.C.E + + if (e === I1.C.E.V1) { +>e === I1.C.E.V1 : boolean +>e : I1.C.E +>I1.C.E.V1 : I1.C.E +>I1.C.E : typeof I1.C.E +>I1.C : typeof I1.C +>I1 : typeof I1 +>C : typeof I1.C +>E : typeof I1.C.E +>V1 : I1.C.E + } + else if (e === I1.C.E.V2) { +>e === I1.C.E.V2 : boolean +>e : I1.C.E +>I1.C.E.V2 : I1.C.E +>I1.C.E : typeof I1.C.E +>I1.C : typeof I1.C +>I1 : typeof I1 +>C : typeof I1.C +>E : typeof I1.C.E +>V2 : I1.C.E + } +} + +function foo2(e: I2.C.E): void { +>foo2 : (e: I2.C.E) => void +>e : I2.C.E +>I2 : unknown +>C : unknown +>E : I2.C.E + + if (e === I2.C.E.V1) { +>e === I2.C.E.V1 : boolean +>e : I2.C.E +>I2.C.E.V1 : I2.C.E +>I2.C.E : typeof I2.C.E +>I2.C : typeof I2.C +>I2 : typeof I2 +>C : typeof I2.C +>E : typeof I2.C.E +>V1 : I2.C.E + } + else if (e === I2.C.E.V2) { +>e === I2.C.E.V2 : boolean +>e : I2.C.E +>I2.C.E.V2 : I2.C.E +>I2.C.E : typeof I2.C.E +>I2.C : typeof I2.C +>I2 : typeof I2 +>C : typeof I2.C +>E : typeof I2.C.E +>V2 : I2.C.E + } +} + + +function foo(x: Enum1) { +>foo : (x: Enum1) => void +>x : Enum1 +>Enum1 : Enum1 + + switch (x) { +>x : Enum1 + + case Enum1.A: +>Enum1.A : Enum1 +>Enum1 : typeof Enum1 +>A : Enum1 + + case Enum1.B: +>Enum1.B : Enum1 +>Enum1 : typeof Enum1 +>B : Enum1 + + case Enum1.C: +>Enum1.C : Enum1 +>Enum1 : typeof Enum1 +>C : Enum1 + + case Enum1.D: +>Enum1.D : Enum1 +>Enum1 : typeof Enum1 +>D : Enum1 + + case Enum1.E: +>Enum1.E : Enum1 +>Enum1 : typeof Enum1 +>E : Enum1 + + case Enum1.F: +>Enum1.F : Enum1 +>Enum1 : typeof Enum1 +>F : Enum1 + + case Enum1.G: +>Enum1.G : Enum1 +>Enum1 : typeof Enum1 +>G : Enum1 + + case Enum1.H: +>Enum1.H : Enum1 +>Enum1 : typeof Enum1 +>H : Enum1 + + case Enum1.I: +>Enum1.I : Enum1 +>Enum1 : typeof Enum1 +>I : Enum1 + + case Enum1.J: +>Enum1.J : Enum1 +>Enum1 : typeof Enum1 +>J : Enum1 + + case Enum1.K: +>Enum1.K : Enum1 +>Enum1 : typeof Enum1 +>K : Enum1 + + case Enum1.L: +>Enum1.L : Enum1 +>Enum1 : typeof Enum1 +>L : Enum1 + + case Enum1.M: +>Enum1.M : Enum1 +>Enum1 : typeof Enum1 +>M : Enum1 + + case Enum1.N: +>Enum1.N : Enum1 +>Enum1 : typeof Enum1 +>N : Enum1 + + case Enum1.O: +>Enum1.O : Enum1 +>Enum1 : typeof Enum1 +>O : Enum1 + + case Enum1.P: +>Enum1.P : Enum1 +>Enum1 : typeof Enum1 +>P : Enum1 + + case Enum1.Q: +>Enum1.Q : Enum1 +>Enum1 : typeof Enum1 +>Q : Enum1 + + case Enum1.R: +>Enum1.R : Enum1 +>Enum1 : typeof Enum1 +>R : Enum1 + + case Enum1.S: +>Enum1.S : Enum1 +>Enum1 : typeof Enum1 +>S : Enum1 + + case Enum1["T"]: +>Enum1["T"] : Enum1 +>Enum1 : typeof Enum1 + + case Enum1.U: +>Enum1.U : Enum1 +>Enum1 : typeof Enum1 +>U : Enum1 + + case Enum1.V: +>Enum1.V : Enum1 +>Enum1 : typeof Enum1 +>V : Enum1 + + case Enum1.W: +>Enum1.W : Enum1 +>Enum1 : typeof Enum1 +>W : Enum1 + + case Enum1.W1: +>Enum1.W1 : Enum1 +>Enum1 : typeof Enum1 +>W1 : Enum1 + + case Enum1.W2: +>Enum1.W2 : Enum1 +>Enum1 : typeof Enum1 +>W2 : Enum1 + + case Enum1.W3: +>Enum1.W3 : Enum1 +>Enum1 : typeof Enum1 +>W3 : Enum1 + + case Enum1.W4: +>Enum1.W4 : Enum1 +>Enum1 : typeof Enum1 +>W4 : Enum1 + + break; + } +} + +function bar(e: A.B.C.E): number { +>bar : (e: I) => number +>e : I +>A : unknown +>B : unknown +>C : unknown +>E : I + + switch (e) { +>e : I + + case A.B.C.E.V1: return 1; +>A.B.C.E.V1 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V1 : I + + case A.B.C.E.V2: return 1; +>A.B.C.E.V2 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V2 : I + + case A.B.C.E.V3: return 1; +>A.B.C.E.V3 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V3 : I + } +} diff --git a/tests/baselines/reference/constraints0.errors.txt b/tests/baselines/reference/constraints0.errors.txt index ac16118149b..217a7408fbd 100644 --- a/tests/baselines/reference/constraints0.errors.txt +++ b/tests/baselines/reference/constraints0.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constraints0.ts(14,9): error TS2343: Type 'B' does not satisfy the constraint 'A': +tests/cases/compiler/constraints0.ts(14,9): error TS2344: Type 'B' does not satisfy the constraint 'A'. Property 'a' is missing in type 'B'. @@ -18,7 +18,7 @@ tests/cases/compiler/constraints0.ts(14,9): error TS2343: Type 'B' does not sati var v1: C; // should work var v2: C; // should not work ~~~~ -!!! error TS2343: Type 'B' does not satisfy the constraint 'A': -!!! error TS2343: Property 'a' is missing in type 'B'. +!!! error TS2344: Type 'B' does not satisfy the constraint 'A'. +!!! error TS2344: Property 'a' is missing in type 'B'. var y = v1.x.a; // 'a' should be of type 'number' \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt index 373bd49f92d..51278fc3f44 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance.ts(61,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. Type 'string' is not assignable to type 'number'. @@ -67,10 +67,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: number) => string' is not assignable to type 'new (x: number) => number'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: number) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 4a2425cf3ac..8d6273804f7 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2429: Interface 'I2' incorrectly extends interface 'A': - Types of property 'a2' are incompatible: - Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. + Types of property 'a2' are incompatible. + Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. + Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2429: Interface 'I4' incorrectly extends interface 'A': - Types of property 'a8' are incompatible: - Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': - Types of parameters 'y' and 'y' are incompatible: - Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': - Types of parameters 'arg2' and 'arg2' are incompatible: - Type '{ foo: number; }' is not assignable to type 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2430: Interface 'I4' incorrectly extends interface 'A'. + Types of property 'a8' are incompatible. + Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. + Types of parameters 'y' and 'y' are incompatible. + Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. @@ -57,11 +57,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc interface I2 extends A { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a2' are incompatible: -!!! error TS2429: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]': -!!! error TS2429: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. a2: new (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic } @@ -72,15 +72,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc interface I4 extends A { ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'a8' are incompatible: -!!! error TS2429: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived': -!!! error TS2429: Types of parameters 'arg2' and 'arg2' are incompatible: -!!! error TS2429: Type '{ foo: number; }' is not assignable to type 'Base': -!!! error TS2429: Types of property 'foo' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a8' are incompatible. +!!! error TS2430: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/constructorAsType.errors.txt b/tests/baselines/reference/constructorAsType.errors.txt index ca17d41623d..b0d30295cde 100644 --- a/tests/baselines/reference/constructorAsType.errors.txt +++ b/tests/baselines/reference/constructorAsType.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/constructorAsType.ts(1,5): error TS2323: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. +tests/cases/compiler/constructorAsType.ts(1,5): error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. ==== tests/cases/compiler/constructorAsType.ts (1 errors) ==== var Person:new () => {name: string;} = function () {return {name:"joe"};}; ~~~~~~ -!!! error TS2323: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. +!!! error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. var Person2:{new() : {name:string;};}; diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt index c241aa8096d..2fb24c0d5d8 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2323: Type 'number' is not assignable to type 'T'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2323: Type 'Date' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2322: Type 'Date' is not assignable to type 'T'. ==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts (4 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x); constructor(public x: string = 1) { // error ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var y = x; } } @@ -18,9 +18,9 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x: T, y: U); constructor(x: T = 1, public y: U = x) { // error ~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var z = x; } } @@ -29,7 +29,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x); constructor(x: T = new Date()) { // error ~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. var y = x; } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt index 8bb04c59554..87af1b85f2d 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(8,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. -tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(16,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. @@ -17,7 +17,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterS constructor(x: string) { x = 2; // error, x is string ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } } diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index bd1aa155661..875d7b5e20a 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]': - Types of property 'pop' are incompatible: - Type '() => string | number | boolean' is not assignable to type '() => string | number': - Type 'string | number | boolean' is not assignable to type 'string | number': - Type 'boolean' is not assignable to type 'string | number': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => string | number'. + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(8,1): error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]': - Types of property '0' are incompatible: - Type '{}' is not assignable to type '{ a: string; }': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(8,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. + Types of property '0' are incompatible. + Type '{}' is not assignable to type '{ a: string; }'. Property 'a' is missing in type '{}'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. Property '2' is missing in type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]': - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => string': - Type 'string | number' is not assignable to type 'string': +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => string'. + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -23,11 +23,11 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS23 var numStrTuple: [number, string] = [5, "hello"]; var numStrTuple2: [number, string] = [5, "foo", true]; ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number': -!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number': -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number': +!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. !!! error TS2322: Type 'boolean' is not assignable to type 'number'. var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; @@ -35,24 +35,24 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS23 numStrTuple = numStrTuple2; numStrTuple = numStrBoolTuple; ~~~~~~~~~~~ -!!! error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. // error objNumTuple = [ {}, 5]; ~~~~~~~~~~~ -!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]': -!!! error TS2322: Types of property '0' are incompatible: -!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }': +!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }'. !!! error TS2322: Property 'a' is missing in type '{}'. numStrBoolTuple = numStrTuple; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]': +!!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. !!! error TS2322: Property '2' is missing in type '[number, string]'. var strStrTuple: [string, string] = ["foo", "bar", 5]; ~~~~~~~~~~~ -!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number' is not assignable to type '() => string': -!!! error TS2322: Type 'string | number' is not assignable to type 'string': +!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js new file mode 100644 index 00000000000..2e21235ea0a --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js @@ -0,0 +1,86 @@ +//// [contextualTypeWithUnionTypeCallSignatures.ts] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { + foo: string; +} +interface IWithCallSignatures { + (a: number): string; +} +interface IWithCallSignatures2 { + (a: number): number; +} +interface IWithCallSignatures3 { + (b: string): number; +} +interface IWithCallSignatures4 { + (a: number): string; + (a: string, b: number): number; +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); + +//// [contextualTypeWithUnionTypeCallSignatures.js] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +// With no call signature | callSignatures +var x = function (a) { return a.toString(); }; +// With call signatures with different return type +var x2 = function (a) { return a.toString(); }; // Like iWithCallSignatures +var x2 = function (a) { return a; }; // Like iWithCallSignatures2 +// With call signatures of mismatching parameter type +var x3 = function (a /*here a should be any*/) { return a.toString(); }; +// With call signature count mismatch +var x4 = function (a //When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { + foo: string; +} +interface IWithCallSignatures { + (a: number): string; +} +interface IWithCallSignatures2 { + (a: number): number; +} +interface IWithCallSignatures3 { + (b: string): number; +} +interface IWithCallSignatures4 { + (a: number): string; + (a: string, b: number): number; +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => + ) { return a.toString(); }; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types new file mode 100644 index 00000000000..02dfecf5c08 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types @@ -0,0 +1,99 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { +>IWithNoCallSignatures : IWithNoCallSignatures + + foo: string; +>foo : string +} +interface IWithCallSignatures { +>IWithCallSignatures : IWithCallSignatures + + (a: number): string; +>a : number +} +interface IWithCallSignatures2 { +>IWithCallSignatures2 : IWithCallSignatures2 + + (a: number): number; +>a : number +} +interface IWithCallSignatures3 { +>IWithCallSignatures3 : IWithCallSignatures3 + + (b: string): number; +>b : string +} +interface IWithCallSignatures4 { +>IWithCallSignatures4 : IWithCallSignatures4 + + (a: number): string; +>a : number + + (a: string, b: number): number; +>a : string +>b : number +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); +>x : IWithNoCallSignatures | IWithCallSignatures +>IWithNoCallSignatures : IWithNoCallSignatures +>IWithCallSignatures : IWithCallSignatures +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +>x2 : IWithCallSignatures | IWithCallSignatures2 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures2 : IWithCallSignatures2 +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 +>x2 : IWithCallSignatures | IWithCallSignatures2 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures2 : IWithCallSignatures2 +>a => a : (a: number) => number +>a : number +>a : number + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); +>x3 : IWithCallSignatures | IWithCallSignatures3 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures3 : IWithCallSignatures3 +>a => /*here a should be any*/ a.toString() : (a: any) => any +>a : any +>a.toString() : any +>a.toString : any +>a : any +>toString : any + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); +>x4 : IWithCallSignatures | IWithCallSignatures4 +>IWithCallSignatures : IWithCallSignatures +>IWithCallSignatures4 : IWithCallSignatures4 +>a => /*here a should be any*/ a.toString() : (a: any) => any +>a : any +>a.toString() : any +>a.toString : any +>a : any +>toString : any + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js new file mode 100644 index 00000000000..2c07f461424 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js @@ -0,0 +1,80 @@ +//// [contextualTypeWithUnionTypeIndexSignatures.ts] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface SomeType { + (a: number): number; +} +interface SomeType2 { + (a: number): string; +} + +interface IWithNoStringIndexSignature { + foo: string; +} +interface IWithNoNumberIndexSignature { + 0: string; +} +interface IWithStringIndexSignature1 { + [a: string]: SomeType; +} +interface IWithStringIndexSignature2 { + [a: string]: SomeType2; +} +interface IWithNumberIndexSignature1 { + [a: number]: SomeType; +} +interface IWithNumberIndexSignature2 { + [a: number]: SomeType2; +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number + + +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number + +//// [contextualTypeWithUnionTypeIndexSignatures.js] +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x = { z: function (a) { return a; } }; // a should be number +var x = { foo: function (a) { return a; } }; // a should be any +var x = { foo: "hello" }; +var x2 = { z: function (a) { return a.toString(); } }; // a should be number +var x2 = { z: function (a) { return a; } }; // a should be number +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3 = { 1: function (a) { return a; } }; // a should be number +var x3 = { 0: function (a) { return a; } }; // a should be any +var x3 = { 0: "hello" }; +var x4 = { 1: function (a) { return a.toString(); } }; // a should be number +var x4 = { 1: function (a) { return a; } }; // a should be number diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types new file mode 100644 index 00000000000..8a91fe18698 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -0,0 +1,166 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface SomeType { +>SomeType : SomeType + + (a: number): number; +>a : number +} +interface SomeType2 { +>SomeType2 : SomeType2 + + (a: number): string; +>a : number +} + +interface IWithNoStringIndexSignature { +>IWithNoStringIndexSignature : IWithNoStringIndexSignature + + foo: string; +>foo : string +} +interface IWithNoNumberIndexSignature { +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature + + 0: string; +} +interface IWithStringIndexSignature1 { +>IWithStringIndexSignature1 : IWithStringIndexSignature1 + + [a: string]: SomeType; +>a : string +>SomeType : SomeType +} +interface IWithStringIndexSignature2 { +>IWithStringIndexSignature2 : IWithStringIndexSignature2 + + [a: string]: SomeType2; +>a : string +>SomeType2 : SomeType2 +} +interface IWithNumberIndexSignature1 { +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 + + [a: number]: SomeType; +>a : number +>SomeType : SomeType +} +interface IWithNumberIndexSignature2 { +>IWithNumberIndexSignature2 : IWithNumberIndexSignature2 + + [a: number]: SomeType2; +>a : number +>SomeType2 : SomeType2 +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +>x : IWithNoStringIndexSignature | IWithStringIndexSignature1 +>IWithNoStringIndexSignature : IWithNoStringIndexSignature +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>{ z: a => a } : { [x: string]: (a: number) => number; z: (a: number) => number; } +>z : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +>x : IWithNoStringIndexSignature | IWithStringIndexSignature1 +>IWithNoStringIndexSignature : IWithNoStringIndexSignature +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>{ foo: a => a } : { [x: string]: (a: any) => any; foo: (a: any) => any; } +>foo : (a: any) => any +>a => a : (a: any) => any +>a : any +>a : any + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +>x : IWithNoStringIndexSignature | IWithStringIndexSignature1 +>IWithNoStringIndexSignature : IWithNoStringIndexSignature +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>{ foo: "hello" } : { [x: string]: string; foo: string; } +>foo : string + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +>x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>IWithStringIndexSignature2 : IWithStringIndexSignature2 +>{ z: a => a.toString() } : { [x: string]: (a: number) => string; z: (a: number) => string; } +>z : (a: number) => string +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number +>x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 +>IWithStringIndexSignature1 : IWithStringIndexSignature1 +>IWithStringIndexSignature2 : IWithStringIndexSignature2 +>{ z: a => a } : { [x: string]: (a: number) => number; z: (a: number) => number; } +>z : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +>x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>{ 1: a => a } : { [x: number]: (a: number) => number; 1: (a: number) => number; } +>a => a : (a: number) => number +>a : number +>a : number + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +>x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>{ 0: a => a } : { [x: number]: (a: any) => any; 0: (a: any) => any; } +>a => a : (a: any) => any +>a : any +>a : any + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +>x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 +>IWithNoNumberIndexSignature : IWithNoNumberIndexSignature +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>{ 0: "hello" } : { [x: number]: string; 0: string; } + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +>x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>IWithNumberIndexSignature2 : IWithNumberIndexSignature2 +>{ 1: a => a.toString() } : { [x: number]: (a: number) => string; 1: (a: number) => string; } +>a => a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number +>x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 +>IWithNumberIndexSignature1 : IWithNumberIndexSignature1 +>IWithNumberIndexSignature2 : IWithNumberIndexSignature2 +>{ 1: a => a } : { [x: number]: (a: number) => number; 1: (a: number) => number; } +>a => a : (a: number) => number +>a : number +>a : number + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js new file mode 100644 index 00000000000..b04c804ad7e --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js @@ -0,0 +1,207 @@ +//// [contextualTypeWithUnionTypeMembers.ts] +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface I1 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI1(a: string): string; + propertyOnlyInI1: string; +} +interface I2 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI2(a: string): string; + propertyOnlyInI2: string; +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +var i2: I2; +var i1Ori2: I1 | I2 = i1; +var i1Ori2: I1 | I2 = i2; +var i1Ori2: I1 | I2 = { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", +}; +var i1Ori2: I1 | I2 = { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + }, + { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }, { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }]; + +interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; + commonPropertyDifferentType: string; +} +interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; + commonPropertyDifferentType: number; +} +var i11: I11; +var i21: I21; +var i11Ori21: I11 | I21 = i11; +var i11Ori21: I11 | I21 = i21; +var i11Ori21: I11 | I21 = { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", +}; +var i11Ori21: I11 | I21 = { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", + }, { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, + }]; + +//// [contextualTypeWithUnionTypeMembers.js] +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1; +var i2; +var i1Ori2 = i1; +var i1Ori2 = i2; +var i1Ori2 = { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello" +}; +var i1Ori2 = { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}; +var i1Ori2 = { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello", + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}; +var arrayI1OrI2 = [i1, i2, { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello" +}, { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}, { + commonPropertyType: "hello", + commonMethodType: function (a) { return a; }, + commonMethodWithTypeParameter: function (a) { return a; }, + methodOnlyInI1: function (a) { return a; }, + propertyOnlyInI1: "Hello", + methodOnlyInI2: function (a) { return a; }, + propertyOnlyInI2: "Hello" +}]; +var i11; +var i21; +var i11Ori21 = i11; +var i11Ori21 = i21; +var i11Ori21 = { + // Like i1 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello" +}; +var i11Ori21 = { + // Like i2 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10 +}; +var arrayOrI11OrI21 = [i11, i21, i11 || i21, { + // Like i1 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello" +}, { + // Like i2 + commonMethodDifferentReturnType: function (a, b) { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10 +}]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types new file mode 100644 index 00000000000..522d4a4a555 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -0,0 +1,438 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface I1 { +>I1 : I1 +>T : T + + commonMethodType(a: string): string; +>commonMethodType : (a: string) => string +>a : string + + commonPropertyType: string; +>commonPropertyType : string + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : (a: T) => T +>a : T +>T : T +>T : T + + methodOnlyInI1(a: string): string; +>methodOnlyInI1 : (a: string) => string +>a : string + + propertyOnlyInI1: string; +>propertyOnlyInI1 : string +} +interface I2 { +>I2 : I2 +>T : T + + commonMethodType(a: string): string; +>commonMethodType : (a: string) => string +>a : string + + commonPropertyType: string; +>commonPropertyType : string + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : (a: T) => T +>a : T +>T : T +>T : T + + methodOnlyInI2(a: string): string; +>methodOnlyInI2 : (a: string) => string +>a : string + + propertyOnlyInI2: string; +>propertyOnlyInI2 : string +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +>i1 : I1 +>I1 : I1 + +var i2: I2; +>i2 : I2 +>I2 : I2 + +var i1Ori2: I1 | I2 = i1; +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>i1 : I1 + +var i1Ori2: I1 | I2 = i2; +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>i2 : I2 + +var i1Ori2: I1 | I2 = { // Like i1 +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + +}; +var i1Ori2: I1 | I2 = { // Like i2 +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both +>i1Ori2 : I1 | I2 +>I1 : I1 +>I2 : I2 +>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 +>arrayI1OrI2 : (I1 | I2)[] +>Array : T[] +>I1 : I1 +>I2 : I2 +>[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1 | I2)[] +>i1 : I1 +>i2 : I2 +>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + + }, + { // Like i2 +>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + + }, { // Like i1 and i2 both +>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } + + commonPropertyType: "hello", +>commonPropertyType : string + + commonMethodType: a=> a, +>commonMethodType : (a: string) => string +>a=> a : (a: string) => string +>a : string +>a : string + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : (a: number) => number +>a => a : (a: number) => number +>a : number +>a : number + + methodOnlyInI1: a => a, +>methodOnlyInI1 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : string + + methodOnlyInI2: a => a, +>methodOnlyInI2 : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : string + + }]; + +interface I11 { +>I11 : I11 + + commonMethodDifferentReturnType(a: string, b: number): string; +>commonMethodDifferentReturnType : (a: string, b: number) => string +>a : string +>b : number + + commonPropertyDifferentType: string; +>commonPropertyDifferentType : string +} +interface I21 { +>I21 : I21 + + commonMethodDifferentReturnType(a: string, b: number): number; +>commonMethodDifferentReturnType : (a: string, b: number) => number +>a : string +>b : number + + commonPropertyDifferentType: number; +>commonPropertyDifferentType : number +} +var i11: I11; +>i11 : I11 +>I11 : I11 + +var i21: I21; +>i21 : I21 +>I21 : I21 + +var i11Ori21: I11 | I21 = i11; +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>i11 : I11 + +var i11Ori21: I11 | I21 = i21; +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>i21 : I21 + +var i11Ori21: I11 | I21 = { +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => string +>(a, b) => { var z = a.charAt(b); return z; } : (a: string, b: number) => string +>a : string +>b : number + + var z = a.charAt(b); +>z : string +>a.charAt(b) : string +>a.charAt : (pos: number) => string +>a : string +>charAt : (pos: number) => string +>b : number + + return z; +>z : string + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : string + +}; +var i11Ori21: I11 | I21 = { +>i11Ori21 : I11 | I21 +>I11 : I11 +>I21 : I21 +>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10,} : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } + + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => number +>(a, b) => { var z = a.charCodeAt(b); return z; } : (a: string, b: number) => number +>a : string +>b : number + + var z = a.charCodeAt(b); +>z : number +>a.charCodeAt(b) : number +>a.charCodeAt : (index: number) => number +>a : string +>charCodeAt : (index: number) => number +>b : number + + return z; +>z : number + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : number + +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { +>arrayOrI11OrI21 : (I11 | I21)[] +>Array : T[] +>I11 : I11 +>I21 : I21 +>[i11, i21, i11 || i21, { // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", }, { // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, }] : (I11 | I21)[] +>i11 : I11 +>i21 : I21 +>i11 || i21 : I11 | I21 +>i11 : I11 +>i21 : I21 +>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => string +>(a, b) => { var z = a.charAt(b); return z; } : (a: string, b: number) => string +>a : string +>b : number + + var z = a.charAt(b); +>z : string +>a.charAt(b) : string +>a.charAt : (pos: number) => string +>a : string +>charAt : (pos: number) => string +>b : number + + return z; +>z : string + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : string + + }, { +>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } + + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : (a: string, b: number) => number +>(a, b) => { var z = a.charCodeAt(b); return z; } : (a: string, b: number) => number +>a : string +>b : number + + var z = a.charCodeAt(b); +>z : number +>a.charCodeAt(b) : number +>a.charCodeAt : (index: number) => number +>a : string +>charCodeAt : (index: number) => number +>b : number + + return z; +>z : number + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : number + + }]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt new file mode 100644 index 00000000000..8be323f9af4 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -0,0 +1,130 @@ +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(14,5): error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; } | { prop: number; }'. + Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(20,5): error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. + Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(21,5): error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. + Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(25,5): error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. + Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; anotherP1: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(29,5): error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. + Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: number; anotherP1: number; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(57,5): error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I11 | I21'. + Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. + Types of property 'commonMethodDifferentReturnType' are incompatible. + Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. + Type 'string | number' is not assignable to type 'number'. + Type 'string' is not assignable to type 'number'. + + +==== tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts (6 errors) ==== + var str: string; + var num: number; + var strOrNumber: string | number = str || num; + var objStr: { prop: string }; + var objNum: { prop: number }; + var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum; + var objStrOrNum2: { prop: string | number } = objStr || objNum; + // Below is error because : + // Spec says: + // S is a union type and each constituent type of S is assignable to T. + // T is a union type and S is assignable to at least one constituent type of T. + // In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. + // Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number + var objStrOrNum3: { prop: string } | { prop: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; } | { prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber + }; + var objStrOrNum4: { prop: string | number } = { + prop: strOrNumber + }; + var objStrOrNum5: { prop: string; anotherP: string; } | { prop: number } = { prop: strOrNumber }; + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + var objStrOrNum6: { prop: string; anotherP: string; } | { prop: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber, + anotherP: str + }; + var objStrOrNum7: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; anotherP1: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber, + anotherP: str + }; + var objStrOrNum8: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: number; anotherP1: number; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + prop: strOrNumber, + anotherP: str, + anotherP1: num + }; + interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; + } + interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; + } + var i11: I11; + var i21: I21; + var i11Ori21: I11 | I21 = i11; + var i11Ori21: I11 | I21 = i21; + var i11Ori21: I11 | I21 = { // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + }; + var i11Ori21: I11 | I21 = { // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + }; + var strOrNumber: string | number; + var i11Ori21: I11 | I21 = { // Like i1 and i2 both + ~~~~~~~~ +!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I11 | I21'. +!!! error TS2322: Type '{ commonMethodDifferentReturnType: (a: string, b: number) => string | number; }' is not assignable to type 'I21'. +!!! error TS2322: Types of property 'commonMethodDifferentReturnType' are incompatible. +!!! error TS2322: Type '(a: string, b: number) => string | number' is not assignable to type '(a: string, b: number) => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + commonMethodDifferentReturnType: (a, b) => strOrNumber, + }; \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js new file mode 100644 index 00000000000..dc8f07823b6 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js @@ -0,0 +1,115 @@ +//// [contextualTypeWithUnionTypeObjectLiteral.ts] +var str: string; +var num: number; +var strOrNumber: string | number = str || num; +var objStr: { prop: string }; +var objNum: { prop: number }; +var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum; +var objStrOrNum2: { prop: string | number } = objStr || objNum; +// Below is error because : +// Spec says: +// S is a union type and each constituent type of S is assignable to T. +// T is a union type and S is assignable to at least one constituent type of T. +// In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. +// Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number +var objStrOrNum3: { prop: string } | { prop: number } = { + prop: strOrNumber +}; +var objStrOrNum4: { prop: string | number } = { + prop: strOrNumber +}; +var objStrOrNum5: { prop: string; anotherP: string; } | { prop: number } = { prop: strOrNumber }; +var objStrOrNum6: { prop: string; anotherP: string; } | { prop: number } = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum7: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum8: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + prop: strOrNumber, + anotherP: str, + anotherP1: num +}; +interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; +} +interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; +} +var i11: I11; +var i21: I21; +var i11Ori21: I11 | I21 = i11; +var i11Ori21: I11 | I21 = i21; +var i11Ori21: I11 | I21 = { // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, +}; +var i11Ori21: I11 | I21 = { // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, +}; +var strOrNumber: string | number; +var i11Ori21: I11 | I21 = { // Like i1 and i2 both + commonMethodDifferentReturnType: (a, b) => strOrNumber, +}; + +//// [contextualTypeWithUnionTypeObjectLiteral.js] +var str; +var num; +var strOrNumber = str || num; +var objStr; +var objNum; +var objStrOrNum1 = objStr || objNum; +var objStrOrNum2 = objStr || objNum; +// Below is error because : +// Spec says: +// S is a union type and each constituent type of S is assignable to T. +// T is a union type and S is assignable to at least one constituent type of T. +// In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. +// Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number +var objStrOrNum3 = { + prop: strOrNumber +}; +var objStrOrNum4 = { + prop: strOrNumber +}; +var objStrOrNum5 = { prop: strOrNumber }; +var objStrOrNum6 = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum7 = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum8 = { + prop: strOrNumber, + anotherP: str, + anotherP1: num +}; +var i11; +var i21; +var i11Ori21 = i11; +var i11Ori21 = i21; +var i11Ori21 = { + commonMethodDifferentReturnType: function (a, b) { + var z = a.charAt(b); + return z; + } +}; +var i11Ori21 = { + commonMethodDifferentReturnType: function (a, b) { + var z = a.charCodeAt(b); + return z; + } +}; +var strOrNumber; +var i11Ori21 = { + commonMethodDifferentReturnType: function (a, b) { return strOrNumber; } +}; diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt index ed6e50c1dbd..3dce1018e3e 100644 --- a/tests/baselines/reference/contextualTyping.errors.txt +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient. tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'. tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'. -tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'. +tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. ==== tests/cases/compiler/contextualTyping.ts (4 errors) ==== @@ -242,5 +242,5 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not interface B extends A { } var x: B = { }; ~ -!!! error TS2322: Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping11.errors.txt b/tests/baselines/reference/contextualTyping11.errors.txt index dca509faa30..a7879725814 100644 --- a/tests/baselines/reference/contextualTyping11.errors.txt +++ b/tests/baselines/reference/contextualTyping11.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/contextualTyping11.ts(1,13): error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]': - Type 'foo' is not assignable to type '{ id: number; }': +tests/cases/compiler/contextualTyping11.ts(1,13): error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]'. + Type 'foo' is not assignable to type '{ id: number; }'. Property 'id' is missing in type 'foo'. ==== tests/cases/compiler/contextualTyping11.ts (1 errors) ==== class foo { public bar:{id:number;}[] = [({})]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]': -!!! error TS2322: Type 'foo' is not assignable to type '{ id: number; }': +!!! error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'foo' is not assignable to type '{ id: number; }'. !!! error TS2322: Property 'id' is missing in type 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index c6ca82d87ac..d40192c6240 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]': - Type 'number | { id: number; }' is not assignable to type '{ id: number; }': - Type 'number' is not assignable to type '{ id: number; }': +tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. + Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. + Type 'number' is not assignable to type '{ id: number; }'. Property 'id' is missing in type 'Number'. ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; ~~~ -!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]': -!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }': -!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }': +!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. !!! error TS2322: Property 'id' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index 2f7f24f9cac..a172600e1c5 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number': - Types of parameters 'a' and 'a' are incompatible: +tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. + Types of parameters 'a' and 'a' are incompatible. Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; ~~~ -!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number': -!!! error TS2322: Types of parameters 'a' and 'a' are incompatible: +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. !!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping30.errors.txt b/tests/baselines/reference/contextualTyping30.errors.txt index f7a9eeead35..eda30769ac8 100644 --- a/tests/baselines/reference/contextualTyping30.errors.txt +++ b/tests/baselines/reference/contextualTyping30.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. @@ -7,5 +7,5 @@ tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type function foo(param:number[]){}; foo([1, "a"]); ~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt index 4aafb6d9645..4ed0787bde3 100644 --- a/tests/baselines/reference/contextualTyping33.errors.txt +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. - Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }': + Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. @@ -7,5 +7,5 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. -!!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }': +!!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. !!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping39.errors.txt b/tests/baselines/reference/contextualTyping39.errors.txt index bba7954c73a..e43624fbead 100644 --- a/tests/baselines/reference/contextualTyping39.errors.txt +++ b/tests/baselines/reference/contextualTyping39.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping39.ts(1,11): error TS2353: Neither type '() => string' nor type '() => number' is assignable to the other: +tests/cases/compiler/contextualTyping39.ts(1,11): error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping39.ts (1 errors) ==== var foo = <{ (): number; }> function() { return "err"; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '() => string' nor type '() => number' is assignable to the other: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '() => string' nor type '() => number' is assignable to the other. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping41.errors.txt b/tests/baselines/reference/contextualTyping41.errors.txt index 03859c4820e..1ed6da1b782 100644 --- a/tests/baselines/reference/contextualTyping41.errors.txt +++ b/tests/baselines/reference/contextualTyping41.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping41.ts(1,11): error TS2353: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other: +tests/cases/compiler/contextualTyping41.ts(1,11): error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping41.ts (1 errors) ==== var foo = <{():number; (i:number):number; }> (function(){return "err";}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '() => string' nor type '{ (): number; (i: number): number; }' is assignable to the other. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping5.errors.txt b/tests/baselines/reference/contextualTyping5.errors.txt index ad89eb5a71b..5105f67190c 100644 --- a/tests/baselines/reference/contextualTyping5.errors.txt +++ b/tests/baselines/reference/contextualTyping5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping5.ts(1,13): error TS2322: Type '{}' is not assignable to type '{ id: number; }': +tests/cases/compiler/contextualTyping5.ts(1,13): error TS2322: Type '{}' is not assignable to type '{ id: number; }'. Property 'id' is missing in type '{}'. ==== tests/cases/compiler/contextualTyping5.ts (1 errors) ==== class foo { public bar:{id:number;} = { }; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{}' is not assignable to type '{ id: number; }': +!!! error TS2322: Type '{}' is not assignable to type '{ id: number; }'. !!! error TS2322: Property 'id' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt index 92b74829e55..26b06abf782 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I': - Index signatures are incompatible: - Type 'number | Date' is not assignable to type 'Date': - Type 'number' is not assignable to type 'Date': +tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I'. + Index signatures are incompatible. + Type 'number | Date' is not assignable to type 'Date'. + Type 'number' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. @@ -12,10 +12,10 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ var x3: I = [new Date(), 1]; ~~ -!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'number | Date' is not assignable to type 'Date': -!!! error TS2322: Type 'number' is not assignable to type 'Date': +!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number | Date' is not assignable to type 'Date'. +!!! error TS2322: Type 'number' is not assignable to type 'Date'. !!! error TS2322: Property 'toDateString' is missing in type 'Number'. var r2 = x3[1]; r2.getDate(); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 3bcfb557048..08fe22c08e0 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void': - Type '(b: number) => void' is not assignable to type '(a: A) => void': - Types of parameters 'b' and 'a' are incompatible: - Type 'number' is not assignable to type 'A': +tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. + Type '(b: number) => void' is not assignable to type '(a: A) => void'. + Types of parameters 'b' and 'a' are incompatible. + Type 'number' is not assignable to type 'A'. Property 'foo' is missing in type 'Number'. @@ -18,9 +18,9 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; ~~ -!!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void': -!!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void': -!!! error TS2322: Types of parameters 'b' and 'a' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'A': +!!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. +!!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'. +!!! error TS2322: Types of parameters 'b' and 'a' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'A'. !!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt index e512f2a4b55..b388d1b0e4a 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }': +tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{ x: string; }'. tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. @@ -9,7 +9,7 @@ tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Ar obj1 = {}; // Ok obj1 = obj2; // Error - indexer doesn't match ~~~~ -!!! error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }': +!!! error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. !!! error TS2322: Index signature is missing in type '{ x: string; }'. function f(x: { [s: string]: string }) { } diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt index a524fd3be31..b668468eac3 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -1,5 +1,6 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(2,22): error TS2339: Property 'foo' does not exist on type 'string'. -tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. ==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (2 errors) ==== @@ -8,5 +9,6 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,10): error TS ~~~ !!! error TS2339: Property 'foo' does not exist on type 'string'. var r9 = f10('', () => (a => a.foo), 1); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt b/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt index 369d10e88c2..b64c255c867 100644 --- a/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt +++ b/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/contextuallyTypingRestParameters.ts(3,9): error TS2323: Type 'string[]' is not assignable to type 'string'. -tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2323: Type 'string[]' is not assignable to type 'string'. +tests/cases/compiler/contextuallyTypingRestParameters.ts(3,9): error TS2322: Type 'string[]' is not assignable to type 'string'. +tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2322: Type 'string[]' is not assignable to type 'string'. ==== tests/cases/compiler/contextuallyTypingRestParameters.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2323: Typ var t = y; var x2: string = t; // This should be error ~~ -!!! error TS2323: Type 'string[]' is not assignable to type 'string'. +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. var x3: string[] = t; // No error var y2: string = y; // This should be error ~~ -!!! error TS2323: Type 'string[]' is not assignable to type 'string'. +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. var y3: string[] = y; // No error }; \ No newline at end of file diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt index 15a1c7913bb..717d76309a5 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(5,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D': +tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. @@ -16,6 +16,6 @@ tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): e } var a: D = foo("hi", []); ~ -!!! error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D': +!!! error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. !!! error TS2322: Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. \ No newline at end of file diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.js b/tests/baselines/reference/declFilePrivateMethodOverloads.js new file mode 100644 index 00000000000..d6b2320b904 --- /dev/null +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.js @@ -0,0 +1,54 @@ +//// [declFilePrivateMethodOverloads.ts] + +interface IContext { + someMethod(); +} +class c1 { + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); + private overloadWithArityDifference(context): void { + // Function here + } +} +declare class c2 { + private overload1(context, fn); + + private overload2(context); + private overload2(context, fn); +} + +//// [declFilePrivateMethodOverloads.js] +var c1 = (function () { + function c1() { + } + c1.prototype._forEachBindingContext = function (context, fn) { + // Function here + }; + c1.prototype.overloadWithArityDifference = function (context) { + // Function here + }; + return c1; +})(); + + +//// [declFilePrivateMethodOverloads.d.ts] +interface IContext { + someMethod(): any; +} +declare class c1 { + private _forEachBindingContext(bindingContext, fn); + private _forEachBindingContext(bindingContextArray, fn); + private overloadWithArityDifference(bindingContext); + private overloadWithArityDifference(bindingContextArray, fn); +} +declare class c2 { + private overload1(context, fn); + private overload2(context); + private overload2(context, fn); +} diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.types b/tests/baselines/reference/declFilePrivateMethodOverloads.types new file mode 100644 index 00000000000..9989fea31f0 --- /dev/null +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.types @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declFilePrivateMethodOverloads.ts === + +interface IContext { +>IContext : IContext + + someMethod(); +>someMethod : () => any +} +class c1 { +>c1 : c1 + + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : { (bindingContext: IContext, fn: (bindingContext: IContext) => void): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContext : IContext +>IContext : IContext +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : { (bindingContext: IContext, fn: (bindingContext: IContext) => void): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContextArray : IContext[] +>Array : T[] +>IContext : IContext +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { +>_forEachBindingContext : { (bindingContext: IContext, fn: (bindingContext: IContext) => void): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>context : any +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); +>overloadWithArityDifference : { (bindingContext: IContext): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContext : IContext +>IContext : IContext + + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>overloadWithArityDifference : { (bindingContext: IContext): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>bindingContextArray : IContext[] +>Array : T[] +>IContext : IContext +>fn : (bindingContext: IContext) => void +>bindingContext : IContext +>IContext : IContext + + private overloadWithArityDifference(context): void { +>overloadWithArityDifference : { (bindingContext: IContext): any; (bindingContextArray: IContext[], fn: (bindingContext: IContext) => void): any; } +>context : any + + // Function here + } +} +declare class c2 { +>c2 : c2 + + private overload1(context, fn); +>overload1 : (context: any, fn: any) => any +>context : any +>fn : any + + private overload2(context); +>overload2 : { (context: any): any; (context: any, fn: any): any; } +>context : any + + private overload2(context, fn); +>overload2 : { (context: any): any; (context: any, fn: any): any; } +>context : any +>fn : any +} diff --git a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt index 10b2d8ec118..d6944e0e033 100644 --- a/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt +++ b/tests/baselines/reference/declareClassInterfaceImplementation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2421: Class 'Buffer' incorrectly implements interface 'IBuffer': +tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2420: Class 'Buffer' incorrectly implements interface 'IBuffer'. Index signature is missing in type 'Buffer'. @@ -9,8 +9,8 @@ tests/cases/compiler/declareClassInterfaceImplementation.ts(5,15): error TS2421: declare class Buffer implements IBuffer { ~~~~~~ -!!! error TS2421: Class 'Buffer' incorrectly implements interface 'IBuffer': -!!! error TS2421: Index signature is missing in type 'Buffer'. +!!! error TS2420: Class 'Buffer' incorrectly implements interface 'IBuffer'. +!!! error TS2420: Index signature is missing in type 'Buffer'. } \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.js b/tests/baselines/reference/decrementOperatorWithEnumType.js index 13947a6a948..15247ea4225 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.js +++ b/tests/baselines/reference/decrementOperatorWithEnumType.js @@ -22,8 +22,8 @@ var ENUM1; })(ENUM1 || (ENUM1 = {})); ; // expression -var ResultIsNumber1 = --ENUM1["A"]; +var ResultIsNumber1 = --0 /* "A" */; var ResultIsNumber2 = 0 /* A */--; // miss assignment operator ---ENUM1["A"]; +--0 /* "A" */; ENUM1[A]--; diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index ff1f29a695d..156fdcc4c7a 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Neither type 'string' nor type 'number' is assignable to the other. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Neither type 'string' nor type 'number' is assignable to the other. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'. @@ -17,17 +17,17 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. s = f(); ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // Type check the default argument with the type annotation var f2 = function (a: string = 3) { return a; }; // Should error, but be of type (a: string) => string; ~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. s = f2(''); s = f2(); n = f2(); ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Contextually type the default arg with the type annotation var f3 = function (a: (s: string) => any = (s) => s) { }; @@ -37,7 +37,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C // Type check using the function's contextual type var f4: (a: number) => void = function (a = "") { }; ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Contextually type the default arg using the function's contextual type var f5: (a: (s: string) => any) => void = function (a = s => s) { }; diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt index 21296783f28..5000ae05cc3 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(2,6): error TS2339: Property 'length' does not exist on type '{}'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(5,6): error TS2339: Property 'length' does not exist on type 'Object'. -tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ==== @@ -16,8 +17,9 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2346: Sup function concat(x: T, y: T): T { return null; } var result = concat(1, ""); // error - ~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var elementCount = result.length; function concat2(x: T, y: U) { return null; } diff --git a/tests/baselines/reference/deleteOperator1.errors.txt b/tests/baselines/reference/deleteOperator1.errors.txt index 095d4c37100..964bdec9ea2 100644 --- a/tests/baselines/reference/deleteOperator1.errors.txt +++ b/tests/baselines/reference/deleteOperator1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/deleteOperator1.ts(4,5): error TS2323: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/deleteOperator1.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'number'. ==== tests/cases/compiler/deleteOperator1.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/deleteOperator1.ts(4,5): error TS2323: Type 'boolean' is no var y: any = delete a; var z: number = delete a; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.js b/tests/baselines/reference/deleteOperatorWithEnumType.js index e694790091c..b87ab8298a7 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.js +++ b/tests/baselines/reference/deleteOperatorWithEnumType.js @@ -39,11 +39,11 @@ var ENUM1; var ResultIsBoolean1 = delete ENUM; var ResultIsBoolean2 = delete ENUM1; // enum type expressions -var ResultIsBoolean3 = delete ENUM1["A"]; -var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); +var ResultIsBoolean3 = delete 0 /* "A" */; +var ResultIsBoolean4 = delete (ENUM[0] + 1 /* "B" */); // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; -var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); +var ResultIsBoolean6 = delete delete delete (ENUM[0] + 1 /* "B" */); // miss assignment operators delete ENUM; delete ENUM1; diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt index 994dead5904..f8e237a83ce 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(10,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': - Types of property 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(10,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. + Types of property 'x' are incompatible. Type '() => number' is not assignable to type 'number'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFunctionOverridesBaseClassAccessor.ts(11,5): error TS2426: Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. @@ -22,9 +22,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassFun // error class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type '() => number' is not assignable to type 'number'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type '() => number' is not assignable to type 'number'. x() { ~ !!! error TS2426: Class 'Base' defines instance member accessor 'x', but extended class 'Derived' defines it as instance member function. diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt index ce9ec20406c..dd5a75362d1 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2416: Class 'DerivedClass' incorrectly extends base class 'BaseClass': +tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2415: Class 'DerivedClass' incorrectly extends base class 'BaseClass'. Types have separate declarations of a private property '_init'. @@ -12,8 +12,8 @@ tests/cases/compiler/derivedClassOverridesPrivateFunction1.ts(8,7): error TS2416 } class DerivedClass extends BaseClass { ~~~~~~~~~~~~ -!!! error TS2416: Class 'DerivedClass' incorrectly extends base class 'BaseClass': -!!! error TS2416: Types have separate declarations of a private property '_init'. +!!! error TS2415: Class 'DerivedClass' incorrectly extends base class 'BaseClass'. +!!! error TS2415: Types have separate declarations of a private property '_init'. constructor() { super(); } diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt index 9e83faa9b4a..400d7d0d346 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesPrivates.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(5,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(5,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(13,7): error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesPrivates.ts(13,7): error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. Types have separate declarations of a private property 'y'. @@ -11,8 +11,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Types have separate declarations of a private property 'x'. private x: { foo: string; bar: string; }; // error } @@ -22,7 +22,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve class Derived2 extends Base2 { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': -!!! error TS2418: Types have separate declarations of a private property 'y'. +!!! error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. +!!! error TS2417: Types have separate declarations of a private property 'y'. private static y: { foo: string; bar: string; }; // error } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt index 7dddd4d76f8..a9762ce03ec 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.errors.txt @@ -1,22 +1,22 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(23,7): error TS2416: Class 'Derived1' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(23,7): error TS2415: Class 'Derived1' incorrectly extends base class 'Base'. Property 'a' is protected in type 'Derived1' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(28,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(28,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Base'. Property 'b' is protected in type 'Derived2' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(33,7): error TS2416: Class 'Derived3' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(33,7): error TS2415: Class 'Derived3' incorrectly extends base class 'Base'. Property 'c' is protected in type 'Derived3' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,7): error TS2416: Class 'Derived4' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(38,7): error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. Property 'c' is protected in type 'Derived4' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(43,7): error TS2416: Class 'Derived5' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(43,7): error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. Property 'd' is protected in type 'Derived5' but public in type 'Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(48,7): error TS2418: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(48,7): error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(53,7): error TS2418: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(53,7): error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'. Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(58,7): error TS2418: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(58,7): error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'. Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,7): error TS2418: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(63,7): error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(68,7): error TS2418: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers3.ts(68,7): error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. @@ -45,80 +45,80 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve // decrease visibility of all public members to protected class Derived1 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived1' incorrectly extends base class 'Base': -!!! error TS2416: Property 'a' is protected in type 'Derived1' but public in type 'Base'. +!!! error TS2415: Class 'Derived1' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'a' is protected in type 'Derived1' but public in type 'Base'. protected a: typeof x; constructor(a: typeof x) { super(a); } } class Derived2 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Base': -!!! error TS2416: Property 'b' is protected in type 'Derived2' but public in type 'Base'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'b' is protected in type 'Derived2' but public in type 'Base'. protected b(a: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived3 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived3' incorrectly extends base class 'Base': -!!! error TS2416: Property 'c' is protected in type 'Derived3' but public in type 'Base'. +!!! error TS2415: Class 'Derived3' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'c' is protected in type 'Derived3' but public in type 'Base'. protected get c() { return x; } constructor(a: typeof x) { super(a); } } class Derived4 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived4' incorrectly extends base class 'Base': -!!! error TS2416: Property 'c' is protected in type 'Derived4' but public in type 'Base'. +!!! error TS2415: Class 'Derived4' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'c' is protected in type 'Derived4' but public in type 'Base'. protected set c(v: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived5 extends Base { ~~~~~~~~ -!!! error TS2416: Class 'Derived5' incorrectly extends base class 'Base': -!!! error TS2416: Property 'd' is protected in type 'Derived5' but public in type 'Base'. +!!! error TS2415: Class 'Derived5' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'd' is protected in type 'Derived5' but public in type 'Base'. protected d: (a: typeof x) => void ; constructor(a: typeof x) { super(a); } } class Derived6 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived6' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'r' is protected in type 'typeof Derived6' but public in type 'typeof Base'. protected static r: typeof x; constructor(a: typeof x) { super(a); } } class Derived7 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived7' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 's' is protected in type 'typeof Derived7' but public in type 'typeof Base'. protected static s(a: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived8 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived8' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 't' is protected in type 'typeof Derived8' but public in type 'typeof Base'. protected static get t() { return x; } constructor(a: typeof x) { super(a); } } class Derived9 extends Base { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived9' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 't' is protected in type 'typeof Derived9' but public in type 'typeof Base'. protected static set t(v: typeof x) { } constructor(a: typeof x) { super(a); } } class Derived10 extends Base { ~~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived10' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'u' is protected in type 'typeof Derived10' but public in type 'typeof Base'. protected static u: (a: typeof x) => void ; constructor(a: typeof x) { super(a); } } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt index f22c656f3c7..064e2e8d43c 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers4.ts(12,7): error TS2416: Class 'Derived2' incorrectly extends base class 'Derived1': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers4.ts(12,7): error TS2415: Class 'Derived2' incorrectly extends base class 'Derived1'. Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. @@ -16,7 +16,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOve class Derived2 extends Derived1 { ~~~~~~~~ -!!! error TS2416: Class 'Derived2' incorrectly extends base class 'Derived1': -!!! error TS2416: Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. +!!! error TS2415: Class 'Derived2' incorrectly extends base class 'Derived1'. +!!! error TS2415: Property 'a' is protected in type 'Derived2' but public in type 'Derived1'. protected a: typeof x; // Error, parent was public } \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity.errors.txt b/tests/baselines/reference/derivedClassTransitivity.errors.txt index 0915f921fe1..c6b620beb18 100644 --- a/tests/baselines/reference/derivedClassTransitivity.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x?: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x?: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity2.errors.txt b/tests/baselines/reference/derivedClassTransitivity2.errors.txt index db89f608d16..a8d2003c876 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. + Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1, 1); var r2 = e.foo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity3.errors.txt b/tests/baselines/reference/derivedClassTransitivity3.errors.txt index 09b5cbe0dfd..9d301255dfd 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void': -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible: +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. var r = c.foo('', ''); var r2 = e.foo('', 1); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity4.errors.txt b/tests/baselines/reference/derivedClassTransitivity4.errors.txt index 5950eddf6be..c1a80e0a1d7 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'foo' are incompatible: - Type '(x?: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'foo' are incompatible. + Type '(x?: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(19,9): error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. @@ -26,10 +26,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); ~~~~~ diff --git a/tests/baselines/reference/derivedClassWithAny.errors.txt b/tests/baselines/reference/derivedClassWithAny.errors.txt index d7f0665a9e5..aa91979706b 100644 --- a/tests/baselines/reference/derivedClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedClassWithAny.errors.txt @@ -4,8 +4,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(27,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(38,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -80,8 +80,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit c = d; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'x' are incompatible: +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt index aebe32f7fbf..60054fa47dc 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts(13,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingProtectedInstance.ts(13,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Property 'x' is private in type 'Derived' but not in type 'Base'. @@ -17,8 +17,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // error, not a subtype class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Property 'x' is private in type 'Derived' but not in type 'Base'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'. private x: string; private fn(): string { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt index f85e3be4b5a..bbe47bb9544 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2416: Class 'Derived' incorrectly extends base class 'Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'. Property 'x' is private in type 'Derived' but not in type 'Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(22,14): error TS2339: Property 'x' does not exist on type 'typeof Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(23,18): error TS2339: Property 'x' does not exist on type 'typeof Derived'. @@ -32,8 +32,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // error, not a subtype class Derived extends Base { ~~~~~~~ -!!! error TS2416: Class 'Derived' incorrectly extends base class 'Base': -!!! error TS2416: Property 'x' is private in type 'Derived' but not in type 'Base'. +!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'. +!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'. private x: string; private fn(): string { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt index a6aa878e54c..2697585cb20 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts(13,7): error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingProtectedStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. @@ -17,8 +17,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // should be error class Derived extends Base { ~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. private static x: string; private static fn(): string { return ''; diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt index a792c8ebff0..cfdf1381282 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(8,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'x' is private and only accessible within class 'Derived'. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'fn' is private and only accessible within class 'Derived'. @@ -29,8 +29,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit // should be error class Derived extends Base { ~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base': -!!! error TS2418: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. +!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'. +!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'. private static x: string; private static fn(): string { return ''; diff --git a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt index ef0c9851ad7..ab28ccc9c8d 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt @@ -2,10 +2,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,25): error TS2323: Type 'string' is not assignable to type 'T'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,16): error TS2323: Type 'string' is not assignable to type 'T'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2322: Type 'E' is not assignable to type 'C': - Types of property 'x' are incompatible: +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,25): error TS2322: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,16): error TS2322: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2322: Type 'E' is not assignable to type 'C'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -49,11 +49,11 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. foo(): T { return ''; // error ~~ -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } } @@ -64,7 +64,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC c = d; c = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'C': -!!! error TS2322: Types of property 'x' are incompatible: +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt index e1c43f1bb36..ae8fbe2ff5d 100644 --- a/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt +++ b/tests/baselines/reference/derivedInterfaceCallSignature.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2429: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath': - Types of property 'x' are incompatible: +tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. + Types of property 'x' are incompatible. Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. @@ -16,9 +16,9 @@ tests/cases/compiler/derivedInterfaceCallSignature.ts(11,11): error TS2429: Inte interface D3SvgArea extends D3SvgPath { ~~~~~~~~~ -!!! error TS2429: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. +!!! error TS2430: Interface 'D3SvgArea' incorrectly extends interface 'D3SvgPath'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '(x: (data: any, index?: number) => number) => D3SvgArea' is not assignable to type '() => (data: any, index?: number) => number'. x(x: (data: any, index?: number) => number): D3SvgArea; y(y: (data: any, index?: number) => number): D3SvgArea; y0(): (data: any, index?: number) => number; diff --git a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt index 643979a8ef8..71fe36660c4 100644 --- a/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt +++ b/tests/baselines/reference/derivedTypeIncompatibleSignatures.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(21,11): error TS2429: Interface 'F' incorrectly extends interface 'E': - Index signatures are incompatible: +tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(21,11): error TS2430: Interface 'F' incorrectly extends interface 'E'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2429: Interface 'H' incorrectly extends interface 'G': - Index signatures are incompatible: +tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2430: Interface 'H' incorrectly extends interface 'G'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -29,9 +29,9 @@ tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2429: interface F extends E { ~ -!!! error TS2429: Interface 'F' incorrectly extends interface 'E': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'F' incorrectly extends interface 'E'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. [a: string]: number; // Number is not a subtype of string. Should error. } @@ -41,8 +41,8 @@ tests/cases/compiler/derivedTypeIncompatibleSignatures.ts(29,11): error TS2429: interface H extends G { ~ -!!! error TS2429: Interface 'H' incorrectly extends interface 'G': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'H' incorrectly extends interface 'G'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. [a: number]: number; // Should error for the same reason } \ No newline at end of file diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt new file mode 100644 index 00000000000..b9890e925c4 --- /dev/null +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt @@ -0,0 +1,72 @@ +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(4,6): error TS2456: Type alias 'T0' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(6,6): error TS2456: Type alias 'T0_2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(11,6): error TS2456: Type alias 'T1' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(14,6): error TS2456: Type alias 'T2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(16,6): error TS2456: Type alias 'T2_1' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(19,6): error TS2456: Type alias 'T3' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(22,6): error TS2456: Type alias 'T4' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(26,6): error TS2456: Type alias 'T5' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(30,6): error TS2456: Type alias 'T7' circularly references itself. + + +==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (9 errors) ==== + // It is an error for the type specified in a type alias to depend on that type alias + + // A type alias directly depends on the type it aliases. + type T0 = T0 + ~~ +!!! error TS2456: Type alias 'T0' circularly references itself. + type T0_1 = T0_2 + type T0_2 = T0_3 + ~~~~ +!!! error TS2456: Type alias 'T0_2' circularly references itself. + type T0_3 = T0_1 + + // A type reference directly depends on the referenced type and each of the type arguments, if any. + interface I {} + type T1 = I + ~~ +!!! error TS2456: Type alias 'T1' circularly references itself. + + // A union type directly depends on each of the constituent types. + type T2 = T2 | string + ~~ +!!! error TS2456: Type alias 'T2' circularly references itself. + class C {} + type T2_1 = T2_1[] | number + ~~~~ +!!! error TS2456: Type alias 'T2_1' circularly references itself. + + // An array type directly depends on its element type. + type T3 = T3[] + ~~ +!!! error TS2456: Type alias 'T3' circularly references itself. + + // A tuple type directly depends on each of its element types. + type T4 = [number, T4] + ~~ +!!! error TS2456: Type alias 'T4' circularly references itself. + + // A type query directly depends on the type of the referenced entity. + var x: T5[] = [] + type T5 = typeof x + ~~ +!!! error TS2456: Type alias 'T5' circularly references itself. + + class C1 {} + type T6 = T7 | number + type T7 = typeof yy + ~~ +!!! error TS2456: Type alias 'T7' circularly references itself. + var yy: [string, T8[]]; + type T8 = C + + // legal cases + type T9 = () => T9 + type T10 = { x: T10 } | { new(v: T10): string } + type T11 = T12[] + type T12 = [T13, string] + type T13 = typeof zz + var zz: { x: T11 } + + \ No newline at end of file diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.js b/tests/baselines/reference/directDependenceBetweenTypeAliases.js new file mode 100644 index 00000000000..370e33483fc --- /dev/null +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.js @@ -0,0 +1,60 @@ +//// [directDependenceBetweenTypeAliases.ts] +// It is an error for the type specified in a type alias to depend on that type alias + +// A type alias directly depends on the type it aliases. +type T0 = T0 +type T0_1 = T0_2 +type T0_2 = T0_3 +type T0_3 = T0_1 + +// A type reference directly depends on the referenced type and each of the type arguments, if any. +interface I {} +type T1 = I + +// A union type directly depends on each of the constituent types. +type T2 = T2 | string +class C {} +type T2_1 = T2_1[] | number + +// An array type directly depends on its element type. +type T3 = T3[] + +// A tuple type directly depends on each of its element types. +type T4 = [number, T4] + +// A type query directly depends on the type of the referenced entity. +var x: T5[] = [] +type T5 = typeof x + +class C1 {} +type T6 = T7 | number +type T7 = typeof yy +var yy: [string, T8[]]; +type T8 = C + +// legal cases +type T9 = () => T9 +type T10 = { x: T10 } | { new(v: T10): string } +type T11 = T12[] +type T12 = [T13, string] +type T13 = typeof zz +var zz: { x: T11 } + + + +//// [directDependenceBetweenTypeAliases.js] +// It is an error for the type specified in a type alias to depend on that type alias +var C = (function () { + function C() { + } + return C; +})(); +// A type query directly depends on the type of the referenced entity. +var x = []; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var yy; +var zz; diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index be90535f14c..cd2402161c3 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -2,14 +2,14 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,5): error TS1098: Typ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1005: '(' expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }': +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. Property 'x' is missing in type 'Number'. ==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (5 errors) ==== var f: { ~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. !!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- diff --git a/tests/baselines/reference/elidingImportNames.js b/tests/baselines/reference/elidingImportNames.js new file mode 100644 index 00000000000..3c61789a1a7 --- /dev/null +++ b/tests/baselines/reference/elidingImportNames.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/elidingImportNames.ts] //// + +//// [elidingImportNames_test.ts] + +import a = require('elidingImportNames_main'); // alias used in typeof +var b = a; +var x: typeof a; +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +var b2 = a2; + + +//// [elidingImportNames_main.ts] +export var main = 10; + +//// [elidingImportNames_main1.ts] +export var main = 10; + +//// [elidingImportNames_main.js] +exports.main = 10; +//// [elidingImportNames_main1.js] +exports.main = 10; +//// [elidingImportNames_test.js] +var a = require('elidingImportNames_main'); // alias used in typeof +var b = a; +var x; +var a2 = require('elidingImportNames_main1'); // alias not used in typeof +var b2 = a2; diff --git a/tests/baselines/reference/elidingImportNames.types b/tests/baselines/reference/elidingImportNames.types new file mode 100644 index 00000000000..ad93c72860b --- /dev/null +++ b/tests/baselines/reference/elidingImportNames.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/elidingImportNames_test.ts === + +import a = require('elidingImportNames_main'); // alias used in typeof +>a : typeof a + +var b = a; +>b : typeof a +>a : typeof a + +var x: typeof a; +>x : typeof a +>a : typeof a + +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +>a2 : typeof a2 + +var b2 = a2; +>b2 : typeof a2 +>a2 : typeof a2 + + +=== tests/cases/compiler/elidingImportNames_main.ts === +export var main = 10; +>main : number + +=== tests/cases/compiler/elidingImportNames_main1.ts === +export var main = 10; +>main : number + diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 018cd119b05..4a060ac3456 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -1,31 +1,31 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(9,1): error TS2323: Type 'F' is not assignable to type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(10,1): error TS2323: Type 'E' is not assignable to type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2323: Type 'E' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2323: Type 'E' is not assignable to type 'boolean'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(9,1): error TS2322: Type 'F' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(10,1): error TS2322: Type 'E' is not assignable to type 'F'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2322: Type 'E' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2322: Type 'E' is not assignable to type 'boolean'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2323: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2323: Type 'E' is not assignable to type '() => {}'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'. Property 'apply' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2323: Type 'E' is not assignable to type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2323: Type 'E' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String': +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. Property 'charAt' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2323: Type 'E' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2323: Type 'E' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2323: Type 'E' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(51,13): error TS2323: Type 'E' is not assignable to type 'A'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2323: Type 'E' is not assignable to type 'B'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(51,13): error TS2322: Type 'E' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts (21 errors) ==== @@ -39,10 +39,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi e = f; ~ -!!! error TS2323: Type 'F' is not assignable to type 'E'. +!!! error TS2322: Type 'F' is not assignable to type 'E'. f = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'F'. +!!! error TS2322: Type 'E' is not assignable to type 'F'. e = 1; // ok f = 1; // ok var x: number = e; // ok @@ -63,53 +63,53 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var b: number = e; // ok var c: string = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'string'. +!!! error TS2322: Type 'E' is not assignable to type 'string'. var d: boolean = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'boolean'. +!!! error TS2322: Type 'E' is not assignable to type 'boolean'. var ee: Date = e; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'Date': +!!! error TS2322: Type 'E' is not assignable to type 'Date'. !!! error TS2322: Property 'toDateString' is missing in type 'Number'. var f: any = e; // ok var g: void = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. var h: Object = e; var i: {} = e; var j: () => {} = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '() => {}'. +!!! error TS2322: Type 'E' is not assignable to type '() => {}'. var k: Function = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'Function': +!!! error TS2322: Type 'E' is not assignable to type 'Function'. !!! error TS2322: Property 'apply' is missing in type 'Number'. var l: (x: number) => string = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '(x: number) => string'. +!!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'. ac = e; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'C': +!!! error TS2322: Type 'E' is not assignable to type 'C'. !!! error TS2322: Property 'foo' is missing in type 'Number'. ai = e; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'I': +!!! error TS2322: Type 'E' is not assignable to type 'I'. !!! error TS2322: Property 'foo' is missing in type 'Number'. var m: number[] = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'number[]': +!!! error TS2322: Type 'E' is not assignable to type 'number[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. var n: { foo: string } = e; ~ -!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }': +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. !!! error TS2322: Property 'foo' is missing in type 'Number'. var o: (x: T) => T = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type 'E' is not assignable to type '(x: T) => T'. var p: Number = e; var q: String = e; ~ -!!! error TS2322: Type 'E' is not assignable to type 'String': +!!! error TS2322: Type 'E' is not assignable to type 'String'. !!! error TS2322: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { @@ -117,18 +117,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'T'. +!!! error TS2322: Type 'E' is not assignable to type 'T'. y = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'U'. +!!! error TS2322: Type 'E' is not assignable to type 'U'. z = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'V'. +!!! error TS2322: Type 'E' is not assignable to type 'V'. var a: A = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'A'. +!!! error TS2322: Type 'E' is not assignable to type 'A'. var b: B = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'B'. +!!! error TS2322: Type 'E' is not assignable to type 'B'. } } \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 4048ac104c6..3cddaf45966 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2323: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W': +tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. Property 'D' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2323: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic': +tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. Property 'a' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== @@ -35,24 +35,24 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' var y: typeof W = W; var z: number = W; // error ~ -!!! error TS2323: Type 'typeof W' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof W' is not assignable to type 'number'. var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W': +!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. !!! error TS2322: Property 'D' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic': +!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. !!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 52890bcecc7..d87d6acf6a0 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2323: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W': +tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. Property 'a' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2323: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic': +tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. Property 'a' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== @@ -34,24 +34,24 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' var y: typeof W = W; var z: number = W; // error ~ -!!! error TS2323: Type 'typeof W' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof W' is not assignable to type 'number'. var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W': +!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. !!! error TS2322: Property 'a' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic': +!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. !!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt index 4f930ef2ab9..ca13ceba4ae 100644 --- a/tests/baselines/reference/enumErrors.errors.txt +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -2,13 +2,13 @@ tests/cases/conformance/enums/enumErrors.ts(2,6): error TS2431: Enum name cannot tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot be 'number' tests/cases/conformance/enums/enumErrors.ts(4,6): error TS2431: Enum name cannot be 'string' tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot be 'boolean' -tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2323: Type 'Number' is not assignable to type 'E5'. -tests/cases/conformance/enums/enumErrors.ts(20,9): error TS2323: Type 'E9' is not assignable to type 'E10'. -tests/cases/conformance/enums/enumErrors.ts(21,9): error TS2323: Type 'E9' is not assignable to type 'E10'. -tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2323: Type 'string' is not assignable to type 'E11'. -tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2323: Type 'Date' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'. +tests/cases/conformance/enums/enumErrors.ts(20,9): error TS2322: Type 'E9' is not assignable to type 'E10'. +tests/cases/conformance/enums/enumErrors.ts(21,9): error TS2322: Type 'E9' is not assignable to type 'E10'. +tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'string' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'. -tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2323: Type '{}' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'. ==== tests/cases/conformance/enums/enumErrors.ts (11 errors) ==== @@ -30,7 +30,7 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2323: Type '{}' is no enum E5 { C = new Number(30) ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Number' is not assignable to type 'E5'. +!!! error TS2322: Type 'Number' is not assignable to type 'E5'. } enum E9 { @@ -43,25 +43,25 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2323: Type '{}' is no enum E10 { A = E9.A, ~~~~ -!!! error TS2323: Type 'E9' is not assignable to type 'E10'. +!!! error TS2322: Type 'E9' is not assignable to type 'E10'. B = E9.B ~~~~ -!!! error TS2323: Type 'E9' is not assignable to type 'E10'. +!!! error TS2322: Type 'E9' is not assignable to type 'E10'. } // Enum with computed member intializer of other types enum E11 { A = '', ~~ -!!! error TS2323: Type 'string' is not assignable to type 'E11'. +!!! error TS2322: Type 'string' is not assignable to type 'E11'. B = new Date(), ~~~~~~~~~~ -!!! error TS2323: Type 'Date' is not assignable to type 'E11'. +!!! error TS2322: Type 'Date' is not assignable to type 'E11'. C = window, ~~~~~~ !!! error TS2304: Cannot find name 'window'. D = {} ~~ -!!! error TS2323: Type '{}' is not assignable to type 'E11'. +!!! error TS2322: Type '{}' is not assignable to type 'E11'. } \ No newline at end of file diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt index c832230f343..5b66a377307 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean': +tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'. Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. @@ -6,7 +6,7 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: ==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ==== var n1: () => boolean = function () { }; // expect an error here ~~ -!!! error TS2322: Type '() => void' is not assignable to type '() => boolean': +!!! error TS2322: Type '() => void' is not assignable to type '() => boolean'. !!! error TS2322: Type 'void' is not assignable to type 'boolean'. var n2: () => boolean = function ():boolean { }; // expect an error here ~~~~~~~ diff --git a/tests/baselines/reference/errorWithTruncatedType.errors.txt b/tests/baselines/reference/errorWithTruncatedType.errors.txt index f16dce347a5..f073f7c50a4 100644 --- a/tests/baselines/reference/errorWithTruncatedType.errors.txt +++ b/tests/baselines/reference/errorWithTruncatedType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2323: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. +tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. ==== tests/cases/compiler/errorWithTruncatedType.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2323: Type '{ prop // String representation of type of 'x' should be truncated in error message var s: string = x; ~ -!!! error TS2323: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. +!!! error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.js b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.js new file mode 100644 index 00000000000..e2a8471be0a --- /dev/null +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.js @@ -0,0 +1,93 @@ +//// [escapedReservedCompilerNamedIdentifier.ts] +// double underscores +var __proto__ = 10; +var o = { + "__proto__": 0 +}; +var b = o["__proto__"]; +var o1 = { + __proto__: 0 +}; +var b1 = o1["__proto__"]; +// Triple underscores +var ___proto__ = 10; +var o2 = { + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +var o3 = { + ___proto__: 0 +}; +var b3 = o3["___proto__"]; +// One underscore +var _proto__ = 10; +var o4 = { + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +var o5 = { + _proto__: 0 +}; +var b5 = o5["_proto__"]; + +//// [escapedReservedCompilerNamedIdentifier.js] +// double underscores +var __proto__ = 10; +var o = { + "__proto__": 0 +}; +var b = o["__proto__"]; +var o1 = { + __proto__: 0 +}; +var b1 = o1["__proto__"]; +// Triple underscores +var ___proto__ = 10; +var o2 = { + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +var o3 = { + ___proto__: 0 +}; +var b3 = o3["___proto__"]; +// One underscore +var _proto__ = 10; +var o4 = { + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +var o5 = { + _proto__: 0 +}; +var b5 = o5["_proto__"]; + + +//// [escapedReservedCompilerNamedIdentifier.d.ts] +declare var __proto__: number; +declare var o: { + "__proto__": number; +}; +declare var b: number; +declare var o1: { + __proto__: number; +}; +declare var b1: number; +declare var ___proto__: number; +declare var o2: { + "___proto__": number; +}; +declare var b2: number; +declare var o3: { + ___proto__: number; +}; +declare var b3: number; +declare var _proto__: number; +declare var o4: { + "_proto__": number; +}; +declare var b4: number; +declare var o5: { + _proto__: number; +}; +declare var b5: number; diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types new file mode 100644 index 00000000000..f54c7b80757 --- /dev/null +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts === +// double underscores +var __proto__ = 10; +>__proto__ : number + +var o = { +>o : { "__proto__": number; } +>{ "__proto__": 0} : { "__proto__": number; } + + "__proto__": 0 +}; +var b = o["__proto__"]; +>b : number +>o["__proto__"] : number +>o : { "__proto__": number; } + +var o1 = { +>o1 : { __proto__: number; } +>{ __proto__: 0} : { __proto__: number; } + + __proto__: 0 +>__proto__ : number + +}; +var b1 = o1["__proto__"]; +>b1 : number +>o1["__proto__"] : number +>o1 : { __proto__: number; } + +// Triple underscores +var ___proto__ = 10; +>___proto__ : number + +var o2 = { +>o2 : { "___proto__": number; } +>{ "___proto__": 0} : { "___proto__": number; } + + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +>b2 : number +>o2["___proto__"] : number +>o2 : { "___proto__": number; } + +var o3 = { +>o3 : { ___proto__: number; } +>{ ___proto__: 0} : { ___proto__: number; } + + ___proto__: 0 +>___proto__ : number + +}; +var b3 = o3["___proto__"]; +>b3 : number +>o3["___proto__"] : number +>o3 : { ___proto__: number; } + +// One underscore +var _proto__ = 10; +>_proto__ : number + +var o4 = { +>o4 : { "_proto__": number; } +>{ "_proto__": 0} : { "_proto__": number; } + + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +>b4 : number +>o4["_proto__"] : number +>o4 : { "_proto__": number; } + +var o5 = { +>o5 : { _proto__: number; } +>{ _proto__: 0} : { _proto__: number; } + + _proto__: 0 +>_proto__ : number + +}; +var b5 = o5["_proto__"]; +>b5 : number +>o5["_proto__"] : number +>o5 : { _proto__: number; } + diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 5dbce43970f..4ebb93b10a7 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,36 +1,35 @@ -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2322: Type 'D<{}>' is not assignable to type 'C': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2322: Type 'D<{}>' is not assignable to type 'C'. Property 'id' is missing in type 'D<{}>'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D'. Property 'source' is missing in type 'C'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2322: Type '{ id: string; }' is not assignable to type 'I': - Types of property 'id' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2322: Type '{ id: string; }' is not assignable to type 'I'. + Types of property 'id' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }': - Types of property 'id' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }'. + Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M': - Types of property 'A' are incompatible: - Type 'typeof A' is not assignable to type 'typeof A': - Type 'A' is not assignable to type 'A': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. + Types of property 'A' are incompatible. + Type 'typeof A' is not assignable to type 'typeof A'. + Type 'A' is not assignable to type 'A'. Property 'name' is missing in type 'A'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'A' is not assignable to type 'A': - Property 'name' is missing in type 'A'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string': +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'A' is not assignable to type 'A'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. Type 'boolean' is not assignable to type 'string'. @@ -70,71 +69,70 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aNumber: number = 'this is a string'; ~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aString: string = 9.9; ~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aDate: Date = 9.9; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'Date': +!!! error TS2322: Type 'number' is not assignable to type 'Date'. !!! error TS2322: Property 'toDateString' is missing in type 'Number'. var aVoid: void = 9.9; ~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. var anInterface: I = new D(); ~~~~~~~~~~~ -!!! error TS2322: Type 'D<{}>' is not assignable to type 'I': +!!! error TS2322: Type 'D<{}>' is not assignable to type 'I'. !!! error TS2322: Property 'id' is missing in type 'D<{}>'. var aClass: C = new D(); ~~~~~~ -!!! error TS2322: Type 'D<{}>' is not assignable to type 'C': +!!! error TS2322: Type 'D<{}>' is not assignable to type 'C'. !!! error TS2322: Property 'id' is missing in type 'D<{}>'. var aGenericClass: D = new C(); ~~~~~~~~~~~~~ -!!! error TS2322: Type 'C' is not assignable to type 'D': +!!! error TS2322: Type 'C' is not assignable to type 'D'. !!! error TS2322: Property 'source' is missing in type 'C'. var anObjectLiteral: I = { id: 'a string' }; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ id: string; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'id' are incompatible: +!!! error TS2322: Type '{ id: string; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'id' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var anOtherObjectLiteral: { id: string } = new C(); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'C' is not assignable to type '{ id: string; }': -!!! error TS2322: Types of property 'id' are incompatible: +!!! error TS2322: Type 'C' is not assignable to type '{ id: string; }'. +!!! error TS2322: Types of property 'id' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. var aFunction: typeof F = F2; ~~~~~~~~~ -!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. var anOtherFunction: (x: string) => number = F2; ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. var aLambda: typeof F = (x) => 'a string'; ~~~~~~~ -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number': +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. var aModule: typeof M = N; ~~~~~~~ -!!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M': -!!! error TS2322: Types of property 'A' are incompatible: -!!! error TS2322: Type 'typeof A' is not assignable to type 'typeof A': -!!! error TS2322: Type 'A' is not assignable to type 'A': +!!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. +!!! error TS2322: Types of property 'A' are incompatible. +!!! error TS2322: Type 'typeof A' is not assignable to type 'typeof A'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. !!! error TS2322: Property 'name' is missing in type 'A'. var aClassInModule: M.A = new N.A(); ~~~~~~~~~~~~~~ -!!! error TS2322: Type 'A' is not assignable to type 'A': -!!! error TS2322: Property 'name' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. var aFunctionInModule: typeof M.F2 = F2; ~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string': +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. !!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignClassAndModule.types b/tests/baselines/reference/exportAssignClassAndModule.types index 0118e6fa812..dc4a19f345c 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.types +++ b/tests/baselines/reference/exportAssignClassAndModule.types @@ -5,7 +5,7 @@ import Foo = require('exportAssignClassAndModule_0'); var z: Foo.Bar; >z : Foo.Bar ->Foo : Foo +>Foo : unknown >Bar : Foo.Bar var zz: Foo; @@ -23,7 +23,7 @@ class Foo { x: Foo.Bar; >x : Foo.Bar ->Foo : Foo +>Foo : unknown >Bar : Foo.Bar } module Foo { diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index 57ed5742b2a..5d3afc2731a 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -11,7 +11,7 @@ interface server { >server : server (): server.Server; ->server : server +>server : unknown >Server : server.Server startTime: Date; diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt index 83fededbcbc..a44c95377dc 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2421: Class 'D' incorrectly implements interface 'C': - Types of property 'bar' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2420: Class 'D' incorrectly implements interface 'C'. + Types of property 'bar' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/extendAndImplementTheSameBaseType2.ts (3 errors) ==== @@ -15,20 +15,20 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2323: } class D extends C implements C { ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'C': -!!! error TS2421: Types of property 'bar' are incompatible: -!!! error TS2421: Type '() => string' is not assignable to type '() => number': -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'D' incorrectly implements interface 'C'. +!!! error TS2420: Types of property 'bar' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. baz() { } } var d: D = new D(); var r: string = d.foo; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: number = d.foo; var r3: string = d.bar(); var r4: number = d.bar(); ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray.errors.txt b/tests/baselines/reference/extendGenericArray.errors.txt index 9a427267f1f..a524d522190 100644 --- a/tests/baselines/reference/extendGenericArray.errors.txt +++ b/tests/baselines/reference/extendGenericArray.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/extendGenericArray.ts(6,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendGenericArray.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/extendGenericArray.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/extendGenericArray.ts(6,5): error TS2323: Type 'string' is var arr: string[] = []; var x: number = arr.foo(); ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray2.errors.txt b/tests/baselines/reference/extendGenericArray2.errors.txt index f411207b225..169020fc1b2 100644 --- a/tests/baselines/reference/extendGenericArray2.errors.txt +++ b/tests/baselines/reference/extendGenericArray2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/extendGenericArray2.ts (1 errors) ==== @@ -11,4 +11,4 @@ tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2323: Type 'string' is var arr: string[] = []; var y: number = arr.x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt index d9416eb4c25..3666c89a0ed 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt @@ -1,8 +1,10 @@ -tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts (1 errors) ==== function bar(item1: T, item2: T) { } bar(1, ""); // Should be ok - ~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionAssignment.errors.txt b/tests/baselines/reference/functionAssignment.errors.txt index c588d7fdc43..19fd0897f98 100644 --- a/tests/baselines/reference/functionAssignment.errors.txt +++ b/tests/baselines/reference/functionAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionAssignment.ts(22,5): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'length' does not exist on type 'number'. @@ -26,7 +26,7 @@ tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'lengt var n = ''; n = 4; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); function f3(a: { a: number; b: number; }) { } diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index cf23d39c108..f965a4eb9e1 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }': - Types of property 'a' are incompatible: + Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'boolean'. @@ -11,7 +11,7 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of typ var x = foo([{a:'bar'}]); ~~~~~~~~~~~ !!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }': -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads41.errors.txt b/tests/baselines/reference/functionOverloads41.errors.txt index 47b1e031133..77f8149c822 100644 --- a/tests/baselines/reference/functionOverloads41.errors.txt +++ b/tests/baselines/reference/functionOverloads41.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionOverloads41.ts(4,13): error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{}' is not assignable to type '{ a: boolean; }': + Type '{}' is not assignable to type '{ a: boolean; }'. Property 'a' is missing in type '{}'. @@ -10,6 +10,6 @@ tests/cases/compiler/functionOverloads41.ts(4,13): error TS2345: Argument of typ var x = foo([{}]); ~~~~ !!! error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{}' is not assignable to type '{ a: boolean; }': +!!! error TS2345: Type '{}' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Property 'a' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt index f731a2e7bba..86c4728dda2 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc': - Types of parameters 'delimiter' and 'eventEmitter' are incompatible: +tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. + Types of parameters 'delimiter' and 'eventEmitter' are incompatible. Type 'string' is not assignable to type 'number'. @@ -15,7 +15,7 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: var c: ParserFunc = parsers.raw; // ok! var d: ParserFunc = parsers.readline; // not ok ~ -!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc': -!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible: +!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. +!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var e: ParserFunc = parsers.readline(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index 321a03f5470..699841f8870 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/fuzzy.ts(13,18): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'alsoWorks' is missing in type 'C'. -tests/cases/compiler/fuzzy.ts(21,20): error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R': - Types of property 'oneI' are incompatible: +tests/cases/compiler/fuzzy.ts(21,20): error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. + Types of property 'oneI' are incompatible. Type 'C' is not assignable to type 'I'. -tests/cases/compiler/fuzzy.ts(25,20): error TS2353: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other: +tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. Property 'anything' is missing in type '{ oneI: C; }'. @@ -22,8 +22,8 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2353: Neither type '{ oneI: C; }' export class C implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'alsoWorks' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'alsoWorks' is missing in type 'C'. constructor(public x:number) { } works():R { @@ -33,16 +33,16 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2353: Neither type '{ oneI: C; }' doesntWork():R { return { anything:1, oneI:this }; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R': -!!! error TS2322: Types of property 'oneI' are incompatible: +!!! error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. +!!! error TS2322: Types of property 'oneI' are incompatible. !!! error TS2322: Type 'C' is not assignable to type 'I'. } worksToo():R { return ({ oneI: this }); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other: -!!! error TS2353: Property 'anything' is missing in type '{ oneI: C; }'. +!!! error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. +!!! error TS2352: Property 'anything' is missing in type '{ oneI: C; }'. } } } diff --git a/tests/baselines/reference/genericArrayAssignment1.errors.txt b/tests/baselines/reference/genericArrayAssignment1.errors.txt index c0ffc6e1901..a0a6b020542 100644 --- a/tests/baselines/reference/genericArrayAssignment1.errors.txt +++ b/tests/baselines/reference/genericArrayAssignment1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number[]' is not assignable to type 'string[]': +tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. @@ -8,5 +8,5 @@ tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number s = n; ~ -!!! error TS2322: Type 'number[]' is not assignable to type 'string[]': +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayExtenstions.errors.txt b/tests/baselines/reference/genericArrayExtenstions.errors.txt index d5ba57ddb55..e3004eb2838 100644 --- a/tests/baselines/reference/genericArrayExtenstions.errors.txt +++ b/tests/baselines/reference/genericArrayExtenstions.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2421: Class 'ObservableArray' incorrectly implements interface 'T[]': +tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. Property 'length' is missing in type 'ObservableArray'. @@ -8,8 +8,8 @@ tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2421: Class 'Obse ~~~~~~~~~~~~~~~ !!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~~~~~~~~~~ -!!! error TS2421: Class 'ObservableArray' incorrectly implements interface 'T[]': -!!! error TS2421: Property 'length' is missing in type 'ObservableArray'. +!!! error TS2420: Class 'ObservableArray' incorrectly implements interface 'T[]'. +!!! error TS2420: Property 'length' is missing in type 'ObservableArray'. concat(...items: U[]): T[]; concat(...items: T[]): T[]; } diff --git a/tests/baselines/reference/genericArrayMethods1.errors.txt b/tests/baselines/reference/genericArrayMethods1.errors.txt index 9b037155e33..b5e766c54c4 100644 --- a/tests/baselines/reference/genericArrayMethods1.errors.txt +++ b/tests/baselines/reference/genericArrayMethods1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2322: Type 'number[]' is not assignable to type 'string[]': +tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericArrayMethods1.ts (1 errors) ==== var x:string[] = [0,1].slice(0); // this should be an error ~ -!!! error TS2322: Type 'number[]' is not assignable to type 'string[]': +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt index 8fea5ddfa72..f335319cafd 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -1,31 +1,19 @@ -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: - Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K' is not assignable to type 'I': - Types of property 'x' are incompatible: - Type 'A' is not assignable to type 'Comparable': - Types of property 'compareTo' are incompatible: - Type '(other: number) => number' is not assignable to type '(other: string) => number': - Types of parameters 'other' and 'other' are incompatible: +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. + Types of property 'compareTo' are incompatible. + Type '(other: number) => number' is not assignable to type '(other: string) => number'. + Types of parameters 'other' and 'other' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K' is not assignable to type 'I'. + Types of property 'x' are incompatible. + Type 'A' is not assignable to type 'Comparable'. ==== tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts (4 errors) ==== @@ -42,41 +30,29 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS23 var z = { x: new A() }; var a1: I = { x: new A() }; ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Types of property 'compareTo' are incompatible. +!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. var a2: I = function (): { x: A } { ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. var z = { x: new A() }; return z; } (); var a3: I = z; ~~ -!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. var a4: I = >z; ~~ -!!! error TS2322: Type 'K' is not assignable to type 'I': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'Comparable': -!!! error TS2322: Types of property 'compareTo' are incompatible: -!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number': -!!! error TS2322: Types of parameters 'other' and 'other' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'K' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt index 36a22868333..093c4bed545 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt @@ -1,10 +1,13 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,18): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => number'. - Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,23): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => number'. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,10): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,15): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts (5 errors) ==== @@ -34,25 +37,28 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r7 = foo3(1, (a: Z) => '', ''); // string var r8 = foo3(1, function (a) { return '' }, 1); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3(1, (a) => '', ''); // string function other(t: T, u: U) { var r10 = foo2(1, (x: T) => ''); // error - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = foo2(1, (x) => ''); // string var r11 = foo3(1, (x: T) => '', ''); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = foo3(1, (x: T) => '', 1); // error - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = foo3(1, function (a) { return '' }, 1); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt index 083d197bbb4..3a397a66eba 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt @@ -1,5 +1,7 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts (2 errors) ==== @@ -32,8 +34,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun } var r4 = foo2(1, i2); // error - ~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any var r6 = foo2('', i2); // string @@ -45,6 +48,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r7 = foo3(null, i, ''); // any var r7b = foo3(null, a, ''); // any var r8 = foo3(1, i2, 1); // error - ~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3('', i2, ''); // string \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt index d5084fbee40..75ae76b1dbc 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(10,14): error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. - Types of property 'cb' are incompatible: + Types of property 'cb' are incompatible. Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. - Types of property 'cb' are incompatible: + Types of property 'cb' are incompatible. Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. @@ -19,12 +19,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r2 = foo({ cb: (x: T, y: T) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ cb: (x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: (t: {}) => string; }'. -!!! error TS2345: Types of property 'cb' are incompatible: +!!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type '(x: T, y: T) => string' is not assignable to type '(t: {}) => string'. var r3 = foo({ cb: (x: string, y: number) => '' }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ cb: (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: (t: string) => string; }'. -!!! error TS2345: Types of property 'cb' are incompatible: +!!! error TS2345: Types of property 'cb' are incompatible. !!! error TS2345: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'. function foo2(arg: { cb: (t: T, t2: T) => U }) { diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt index 43bad8f6a1d..2d5ad21959e 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.errors.txt @@ -1,5 +1,7 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(18,10): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(19,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts(19,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments.ts (2 errors) ==== @@ -21,11 +23,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var b: { x: number; z?: number; }; var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof a - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. function other(x: T) { var r6 = foo((a: T) => a, (b: T) => b); // T => T diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index 55318f268bd..a8ee6ac6ca9 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(10,29): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(10,29): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. @@ -21,8 +22,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen } var r1: (x: {}) => {} = foo((x: number) => 1, (x: string) => ''); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. function other2(x: T) { var r7 = foo((a: T) => a, (b: T) => b); // T => T diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt index 0a42d940625..574cc5ca50d 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.errors.txt @@ -1,5 +1,7 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,11): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(32,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts(33,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments3.ts (2 errors) ==== @@ -35,8 +37,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen var x: (a: string) => boolean; var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '(y: string) => string' is not a valid type argument because it is not a supertype of candidate '(a: string) => boolean'. var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '(n: Object) => number' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt index c14db877073..2efcd043d78 100644 --- a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt +++ b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.errors.txt @@ -1,5 +1,7 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(12,9): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(13,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(12,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts(13,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNonSymmetricSubtypes.ts (2 errors) ==== @@ -15,11 +17,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithNon var b: { x: number; z?: number; }; var r = foo(a, b); // { x: number; y?: number; }; - ~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; y?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; z?: number; }'. var r2 = foo(b, a); // { x: number; z?: number; }; - ~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z?: number; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y?: number; }'. var x: { x: number; }; var y: { x?: number; }; diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt index 856f35a57f6..eb45586442d 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts (1 errors) ==== @@ -7,8 +8,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj } var r = foo({ bar: 1, baz: '' }); // error - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var r2 = foo({ bar: 1, baz: 1 }); // T = number var r3 = foo({ bar: foo, baz: foo }); // T = typeof foo var r4 = foo({ bar: 1, baz: '' }); // T = Object \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt index 4ac64500bd1..f389a0a6cae 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt @@ -1,41 +1,43 @@ -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(2,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(3,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(4,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. - Types of property 'y' are incompatible: + Types of property 'y' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(5,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. - Types of property 'x' are incompatible: + Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(6,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. - Types of property 'x' are incompatible: + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. - Types of property 'y' are incompatible: + Types of property 'y' are incompatible. Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts (5 errors) ==== function foo(n: { x: T; y: T }, m: T) { return m; } - var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. // these are all errors + var x = foo({ x: 3, y: "" }, 4); + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var x2 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. -!!! error TS2345: Types of property 'y' are incompatible: +!!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x3 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. -!!! error TS2345: Types of property 'x' are incompatible: +!!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var x4 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. -!!! error TS2345: Types of property 'x' are incompatible: +!!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x5 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. -!!! error TS2345: Types of property 'y' are incompatible: +!!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js index 293a54e425f..c289ce3de14 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js @@ -1,7 +1,7 @@ //// [genericCallWithObjectLiteralArguments1.ts] function foo(n: { x: T; y: T }, m: T) { return m; } -var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors +var x = foo({ x: 3, y: "" }, 4); var x2 = foo({ x: 3, y: "" }, 4); var x3 = foo({ x: 3, y: "" }, 4); var x4 = foo({ x: "", y: 4 }, ""); @@ -11,8 +11,8 @@ var x5 = foo({ x: "", y: 4 }, ""); function foo(n, m) { return m; } -var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors +var x = foo({ x: 3, y: "" }, 4); var x2 = foo({ x: 3, y: "" }, 4); var x3 = foo({ x: 3, y: "" }, 4); var x4 = foo({ x: "", y: 4 }, ""); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt index dce9562a8f5..97b09a7d43f 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts(20,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts(20,9): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs.ts (1 errors) ==== @@ -22,6 +23,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var c1 = new X(); var d1 = new X(); var r = foo(c1, d1); // error - ~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'C' is not a valid type argument because it is not a supertype of candidate 'D'. var r2 = foo(c1, c1); // ok \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt index 9cb190ddecd..02b38ddeb74 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(20,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -20,9 +21,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj return r; } - var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other + ~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. function f2(a: U) { ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -39,7 +41,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj return y(null); } - // all ok - T gets fixed too early, but then defaults to Base and everything works out + // all ok - second argument is processed before x is fixed var r4 = f3(x => x, new Base()); var r5 = f3(x => x, new Derived()); var r6 = f3(x => x, null); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 3d37dace7ae..b9c722f80be 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -16,7 +16,7 @@ function f(a: { x: T; y: T }) { return r; } -var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base +var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other function f2(a: U) { var r: T; @@ -31,7 +31,7 @@ function f3(y: (a: T) => T, x: T) { return y(null); } -// all ok - T gets fixed too early, but then defaults to Base and everything works out +// all ok - second argument is processed before x is fixed var r4 = f3(x => x, new Base()); var r5 = f3(x => x, new Derived()); var r6 = f3(x => x, null); @@ -68,7 +68,7 @@ function f(a) { var r; return r; } -var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base +var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other function f2(a) { var r; return r; @@ -78,7 +78,7 @@ var r3 = f2({ x: new Derived(), y: new Derived2() }); // ok function f3(y, x) { return y(null); } -// all ok - T gets fixed too early, but then defaults to Base and everything works out +// all ok - second argument is processed before x is fixed var r4 = f3(function (x) { return x; }, new Base()); var r5 = f3(function (x) { return x; }, new Derived()); var r6 = f3(function (x) { return x; }, null); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt index ec1f654863f..2a7bfd696cc 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(15,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(18,9): error TS2413: Numeric index type 'T' is not assignable to string index type 'Object'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(23,9): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts (3 errors) ==== @@ -32,5 +32,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var e = r2['1']; var u: U = r2[1]; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt index 45a64e62e5e..e9fae450377 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2323: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,37): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,37): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2323: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,50): error TS2323: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,50): error TS2322: Type 'V' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (11 errors) ==== @@ -18,28 +18,28 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericC function foo2(x: T = undefined) { return x; } // ok function foo3(x: T = 1) { } // error ~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. function foo4(x: T, y: U = x) { } // error ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. function foo5(x: U, y: T = x) { } // ok ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. function foo6(x: T, y: U, z: V = y) { } // error ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. function foo7(x: V, y: U = x) { } // should be ok ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. \ No newline at end of file +!!! error TS2322: Type 'V' is not assignable to type 'U'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt index 3ddb094970a..2a0807bf6b9 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts(36,14): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts(36,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'number'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts (1 errors) ==== @@ -38,8 +39,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOve } var r8 = foo6(a); // error - ~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'number'. var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index abfe5087131..bcf580320e5 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]': - Types of property 'pop' are incompatible: - Type '() => string | number | boolean' is not assignable to type '() => string | number': - Type 'string | number | boolean' is not assignable to type 'string | number': - Type 'boolean' is not assignable to type 'string | number': +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. + Types of property 'pop' are incompatible. + Type '() => string | number | boolean' is not assignable to type '() => string | number'. + Type 'string | number | boolean' is not assignable to type 'string | number'. + Type 'boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number': +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. Type '{ a: string; }' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]': - Types of property '0' are incompatible: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. + Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]': - Types of property '0' are incompatible: +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. + Types of property '0' are incompatible. Type '{}' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]': +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. Property '1' is missing in type '[{}]'. @@ -30,16 +30,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup var e2 = i1.tuple1[1]; // number i1.tuple1 = ["foo", 5, false, true]; ~~~~~~~~~ -!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number': -!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number': -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number': +!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. !!! error TS2322: Type 'boolean' is not assignable to type 'number'. var e3 = i1.tuple1[2]; // {} i1.tuple1[3] = { a: "string" }; ~~~~~~~~~~~~ -!!! error TS2322: Type '{ a: string; }' is not assignable to type 'string | number': +!!! error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. !!! error TS2322: Type '{ a: string; }' is not assignable to type 'number'. var e4 = i1.tuple1[3]; // {} i2.tuple1 = ["foo", 5]; @@ -50,16 +50,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup // error i1.tuple1 = [5, "foo"]; ~~~~~~~~~ -!!! error TS2322: Type '[number, string]' is not assignable to type '[string, number]': -!!! error TS2322: Types of property '0' are incompatible: +!!! error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property '0' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. i1.tuple1 = [{}, {}]; ~~~~~~~~~ -!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]': -!!! error TS2322: Types of property '0' are incompatible: +!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property '0' are incompatible. !!! error TS2322: Type '{}' is not assignable to type 'string'. i2.tuple1 = [{}]; ~~~~~~~~~ -!!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]': +!!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. !!! error TS2322: Property '1' is missing in type '[{}]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt index 30ed4bc431f..149a20e92a5 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt @@ -1,8 +1,11 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,30): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => number'. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,19): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts (4 errors) ==== @@ -63,19 +66,22 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu function other(t: T, u: U) { var r10 = c.foo2(1, (x: T) => ''); // error - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = c.foo2(1, (x) => ''); // string var r11 = c3.foo3(1, (x: T) => '', ''); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = c3.foo3(1, (x: T) => '', 1); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = c3.foo3(1, function (a) { return '' }, 1); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => number'. -!!! error TS2345: Type 'string' is not assignable to type 'number'. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes.errors.txt b/tests/baselines/reference/genericCloneReturnTypes.errors.txt index 37de816704c..0e54ebc02cf 100644 --- a/tests/baselines/reference/genericCloneReturnTypes.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar': +tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar'. Type 'string' is not assignable to type 'number'. @@ -29,5 +29,5 @@ tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar': +!!! error TS2322: Type 'Bar' is not assignable to type 'Bar'. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt index 0d8131871fe..1ac5a862075 100644 --- a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyList' is not assignable to type 'MyList': +tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyList' is not assignable to type 'MyList'. Type 'string' is not assignable to type 'number'. @@ -19,5 +19,5 @@ tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyLi var c: MyList = a.clone(); // bug was there was an error on this line var d: MyList = a.clone(); // error ~ -!!! error TS2322: Type 'MyList' is not assignable to type 'MyList': +!!! error TS2322: Type 'MyList' is not assignable to type 'MyList'. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint2.errors.txt b/tests/baselines/reference/genericConstraint2.errors.txt index e8635f24cee..3ab29b585d8 100644 --- a/tests/baselines/reference/genericConstraint2.errors.txt +++ b/tests/baselines/reference/genericConstraint2.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/genericConstraint2.ts(5,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/genericConstraint2.ts(11,7): error TS2421: Class 'ComparableString' incorrectly implements interface 'Comparable': - Property 'comparer' is missing in type 'ComparableString'. -tests/cases/compiler/genericConstraint2.ts(21,17): error TS2343: Type 'ComparableString' does not satisfy the constraint 'Comparable': +tests/cases/compiler/genericConstraint2.ts(11,7): error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. Property 'comparer' is missing in type 'ComparableString'. +tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. ==== tests/cases/compiler/genericConstraint2.ts (3 errors) ==== @@ -20,8 +19,8 @@ tests/cases/compiler/genericConstraint2.ts(21,17): error TS2343: Type 'Comparabl class ComparableString implements Comparable{ ~~~~~~~~~~~~~~~~ -!!! error TS2421: Class 'ComparableString' incorrectly implements interface 'Comparable': -!!! error TS2421: Property 'comparer' is missing in type 'ComparableString'. +!!! error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. +!!! error TS2420: Property 'comparer' is missing in type 'ComparableString'. constructor(public currentValue: string) { } localeCompare(other) { @@ -33,5 +32,4 @@ tests/cases/compiler/genericConstraint2.ts(21,17): error TS2343: Type 'Comparabl var b = new ComparableString("b"); var c = compare(a, b); ~~~~~~~~~~~~~~~~ -!!! error TS2343: Type 'ComparableString' does not satisfy the constraint 'Comparable': -!!! error TS2343: Property 'comparer' is missing in type 'ComparableString'. \ No newline at end of file +!!! error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt index 4602e5eb494..ade053d9344 100644 --- a/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt +++ b/tests/baselines/reference/genericConstraintSatisfaction1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericConstraintSatisfaction1.ts(6,5): error TS2345: Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. - Types of property 's' are incompatible: + Types of property 's' are incompatible. Type 'number' is not assignable to type 'string'. @@ -12,6 +12,6 @@ tests/cases/compiler/genericConstraintSatisfaction1.ts(6,5): error TS2345: Argum x.f({s: 1}) ~~~~~~ !!! error TS2345: Argument of type '{ s: number; }' is not assignable to parameter of type '{ s: string; }'. -!!! error TS2345: Types of property 's' are incompatible: +!!! error TS2345: Types of property 's' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt index e08cc405426..4ae63b6fc8e 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A': - Types of property 'x' are incompatible: +tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -16,7 +16,7 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS232 var y: B; x = y; // error ~ -!!! error TS2322: Type 'B' is not assignable to type 'A': -!!! error TS2322: Types of property 'x' are incompatible: +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt index bcb406447a4..38818b59863 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>': - Types of property 'x' are incompatible: - Type 'string' is not assignable to type '{ length: number; foo: number; }': +tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type '{ length: number; foo: number; }'. Property 'foo' is missing in type 'String'. @@ -17,8 +17,8 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS23 var y: B; x = y; // error ~ -!!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }': +!!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }'. !!! error TS2322: Property 'foo' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter.errors.txt b/tests/baselines/reference/genericGetter.errors.txt index 0b39758ad6c..3a8edb602e0 100644 --- a/tests/baselines/reference/genericGetter.errors.txt +++ b/tests/baselines/reference/genericGetter.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericGetter.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/genericGetter.ts(9,5): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/genericGetter.ts(9,5): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericGetter.ts (2 errors) ==== @@ -15,4 +15,4 @@ tests/cases/compiler/genericGetter.ts(9,5): error TS2323: Type 'number' is not a var c = new C(); var r: string = c.x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter3.errors.txt b/tests/baselines/reference/genericGetter3.errors.txt index a96a3cf8f5d..24b44af28ee 100644 --- a/tests/baselines/reference/genericGetter3.errors.txt +++ b/tests/baselines/reference/genericGetter3.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericGetter3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/genericGetter3.ts(11,5): error TS2323: Type 'A' is not assignable to type 'string'. +tests/cases/compiler/genericGetter3.ts(11,5): error TS2322: Type 'A' is not assignable to type 'string'. ==== tests/cases/compiler/genericGetter3.ts (2 errors) ==== @@ -17,4 +17,4 @@ tests/cases/compiler/genericGetter3.ts(11,5): error TS2323: Type 'A' is var c = new C(); var r: string = c.x; ~ -!!! error TS2323: Type 'A' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'A' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 49f61de325f..8a977452958 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -1,14 +1,17 @@ -tests/cases/compiler/genericRestArgs.ts(2,12): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/genericRestArgs.ts(2,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/compiler/genericRestArgs.ts(10,12): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. ==== tests/cases/compiler/genericRestArgs.ts (4 errors) ==== function makeArrayG(...items: T[]): T[] { return items; } var a1Ga = makeArrayG(1, ""); // no error - ~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); var a1Gd = makeArrayG(1, ""); // error @@ -19,8 +22,9 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' return [item1, item2, item3]; } var a2Ga = makeArrayGOpt(1, ""); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error ~ diff --git a/tests/baselines/reference/genericSpecializations3.errors.txt b/tests/baselines/reference/genericSpecializations3.errors.txt index 0011be255f1..ccaa839f9d0 100644 --- a/tests/baselines/reference/genericSpecializations3.errors.txt +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2421: Class 'IntFooBad' incorrectly implements interface 'IFoo': - Types of property 'foo' are incompatible: - Type '(x: string) => string' is not assignable to type '(x: number) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => string' is not assignable to type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo': - Types of property 'foo' are incompatible: - Type '(x: string) => string' is not assignable to type '(x: number) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => string' is not assignable to type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2': - Types of property 'foo' are incompatible: - Type '(x: number) => number' is not assignable to type '(x: string) => string': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. + Types of property 'foo' are incompatible. + Type '(x: number) => number' is not assignable to type '(x: string) => string'. + Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -25,11 +25,11 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo class IntFooBad implements IFoo { // error ~~~~~~~~~ -!!! error TS2421: Class 'IntFooBad' incorrectly implements interface 'IFoo': -!!! error TS2421: Types of property 'foo' are incompatible: -!!! error TS2421: Type '(x: string) => string' is not assignable to type '(x: number) => number': -!!! error TS2421: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'IntFooBad' incorrectly implements interface 'IFoo'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. foo(x: string): string { return null; } } @@ -51,17 +51,17 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFo intFoo = stringFoo2; // error ~~~~~~ -!!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. stringFoo2 = intFoo; // error ~~~~~~~~~~ -!!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/genericTypeAssertions1.errors.txt b/tests/baselines/reference/genericTypeAssertions1.errors.txt index 9e0492a8474..5479c5f948e 100644 --- a/tests/baselines/reference/genericTypeAssertions1.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions1.errors.txt @@ -1,10 +1,9 @@ -tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2322: Type 'A' is not assignable to type 'A'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2322: Type 'A>' is not assignable to type 'A': +tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2322: Type 'A>' is not assignable to type 'A'. Type 'A' is not assignable to type 'number'. -tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2353: Neither type 'A' nor type 'A>' is assignable to the other: - Type 'number' is not assignable to type 'A': - Property 'foo' is missing in type 'Number'. +tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. + Type 'number' is not assignable to type 'A'. ==== tests/cases/compiler/genericTypeAssertions1.ts (3 errors) ==== @@ -12,13 +11,12 @@ tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2353: Neither type var foo = new A(); var r: A = >new A(); // error ~ -!!! error TS2322: Type 'A' is not assignable to type 'A': +!!! error TS2322: Type 'A' is not assignable to type 'A'. !!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: A = >>foo; // error ~~ -!!! error TS2322: Type 'A>' is not assignable to type 'A': +!!! error TS2322: Type 'A>' is not assignable to type 'A'. !!! error TS2322: Type 'A' is not assignable to type 'number'. ~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'A' nor type 'A>' is assignable to the other: -!!! error TS2353: Type 'number' is not assignable to type 'A': -!!! error TS2353: Property 'foo' is missing in type 'Number'. \ No newline at end of file +!!! error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. +!!! error TS2352: Type 'number' is not assignable to type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions2.errors.txt b/tests/baselines/reference/genericTypeAssertions2.errors.txt index 887e66a532f..eda4c83646c 100644 --- a/tests/baselines/reference/genericTypeAssertions2.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B' is not assignable to type 'A': - Types of property 'foo' are incompatible: - Type '(x: string) => void' is not assignable to type '(x: number) => void': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B' is not assignable to type 'A'. + Types of property 'foo' are incompatible. + Type '(x: string) => void' is not assignable to type '(x: number) => void'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A' is not assignable to type 'B': +tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A' is not assignable to type 'B'. Property 'bar' is missing in type 'A'. -tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2353: Neither type 'undefined[]' nor type 'A' is assignable to the other: +tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. Property 'foo' is missing in type 'undefined[]'. @@ -21,17 +21,17 @@ tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2353: Neither typ var r: A = >new B(); var r2: A = >new B(); // error ~~ -!!! error TS2322: Type 'B' is not assignable to type 'A': -!!! error TS2322: Types of property 'foo' are incompatible: -!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. var r3: B = >new B(); // error ~~ -!!! error TS2322: Type 'A' is not assignable to type 'B': +!!! error TS2322: Type 'A' is not assignable to type 'B'. !!! error TS2322: Property 'bar' is missing in type 'A'. var r4: A = >new A(); var r5: A = >[]; // error ~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'undefined[]' nor type 'A' is assignable to the other: -!!! error TS2353: Property 'foo' is missing in type 'undefined[]'. \ No newline at end of file +!!! error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. +!!! error TS2352: Property 'foo' is missing in type 'undefined[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions4.errors.txt b/tests/baselines/reference/genericTypeAssertions4.errors.txt index 2a29eac6220..055de774b39 100644 --- a/tests/baselines/reference/genericTypeAssertions4.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericTypeAssertions4.ts(19,5): error TS2323: Type 'A' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions4.ts(20,5): error TS2323: Type 'B' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions4.ts(21,5): error TS2323: Type 'C' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(19,5): error TS2322: Type 'A' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(20,5): error TS2322: Type 'B' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(21,5): error TS2322: Type 'C' is not assignable to type 'T'. tests/cases/compiler/genericTypeAssertions4.ts(23,9): error TS2352: Neither type 'B' nor type 'T' is assignable to the other. tests/cases/compiler/genericTypeAssertions4.ts(24,9): error TS2352: Neither type 'C' nor type 'T' is assignable to the other. @@ -26,13 +26,13 @@ tests/cases/compiler/genericTypeAssertions4.ts(24,9): error TS2352: Neither type var y = x; y = a; // error: cannot convert A to T ~ -!!! error TS2323: Type 'A' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'T'. y = b; // error: cannot convert B to T ~ -!!! error TS2323: Type 'B' is not assignable to type 'T'. +!!! error TS2322: Type 'B' is not assignable to type 'T'. y = c; // error: cannot convert C to T ~ -!!! error TS2323: Type 'C' is not assignable to type 'T'. +!!! error TS2322: Type 'C' is not assignable to type 'T'. y = a; y = b; // error: cannot convert B to T ~~~~ diff --git a/tests/baselines/reference/genericTypeAssertions5.errors.txt b/tests/baselines/reference/genericTypeAssertions5.errors.txt index 3c53a791b9b..e315a7f122a 100644 --- a/tests/baselines/reference/genericTypeAssertions5.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericTypeAssertions5.ts(19,5): error TS2323: Type 'A' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions5.ts(20,5): error TS2323: Type 'B' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions5.ts(21,5): error TS2323: Type 'C' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(19,5): error TS2322: Type 'A' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(20,5): error TS2322: Type 'B' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(21,5): error TS2322: Type 'C' is not assignable to type 'T'. tests/cases/compiler/genericTypeAssertions5.ts(23,9): error TS2352: Neither type 'B' nor type 'T' is assignable to the other. tests/cases/compiler/genericTypeAssertions5.ts(24,9): error TS2352: Neither type 'C' nor type 'T' is assignable to the other. @@ -26,13 +26,13 @@ tests/cases/compiler/genericTypeAssertions5.ts(24,9): error TS2352: Neither type var y = x; y = a; // error: cannot convert A to T ~ -!!! error TS2323: Type 'A' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'T'. y = b; // error: cannot convert B to T ~ -!!! error TS2323: Type 'B' is not assignable to type 'T'. +!!! error TS2322: Type 'B' is not assignable to type 'T'. y = c; // error: cannot convert C to T ~ -!!! error TS2323: Type 'C' is not assignable to type 'T'. +!!! error TS2322: Type 'C' is not assignable to type 'T'. y = a; y = b; // error: cannot convert B to T ~~~~ diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt index a1efb4a4e87..ae93d059f9a 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2421: Class 'X' incorrectly implements interface 'I': - Types of property 'f' are incompatible: - Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void': - Types of parameters 'a' and 'a' are incompatible: - Type 'T' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2420: Class 'X' incorrectly implements interface 'I'. + Types of property 'f' are incompatible. + Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. + Types of parameters 'a' and 'a' are incompatible. + Type 'T' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I': - Types of property 'f' are incompatible: - Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void': - Types of parameters 'a' and 'a' are incompatible: - Type '{ a: string; }' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. + Types of property 'f' are incompatible. + Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. + Types of parameters 'a' and 'a' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. @@ -20,23 +20,23 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322 } class X implements I { ~ -!!! error TS2421: Class 'X' incorrectly implements interface 'I': -!!! error TS2421: Types of property 'f' are incompatible: -!!! error TS2421: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void': -!!! error TS2421: Types of parameters 'a' and 'a' are incompatible: -!!! error TS2421: Type 'T' is not assignable to type '{ a: number; }': -!!! error TS2421: Types of property 'a' are incompatible: -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'X' incorrectly implements interface 'I'. +!!! error TS2420: Types of property 'f' are incompatible. +!!! error TS2420: Type '(a: T) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2420: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2420: Type 'T' is not assignable to type '{ a: number; }'. +!!! error TS2420: Types of property 'a' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'number'. f(a: T): void { } } var x = new X<{ a: string }>(); var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' ~ -!!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void': -!!! error TS2322: Types of parameters 'a' and 'a' are incompatible: -!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }': -!!! error TS2322: Types of property 'a' are incompatible: +!!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2322: Types of property 'a' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/generics1.errors.txt b/tests/baselines/reference/generics1.errors.txt index 4d378d0b7d6..81d250a2ef4 100644 --- a/tests/baselines/reference/generics1.errors.txt +++ b/tests/baselines/reference/generics1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics1.ts(10,9): error TS2343: Type 'A' does not satisfy the constraint 'B': +tests/cases/compiler/generics1.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. tests/cases/compiler/generics1.ts(13,9): error TS2314: Generic type 'G' requires 2 type argument(s). tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' requires 2 type argument(s). @@ -16,8 +16,8 @@ tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' re var v2: G<{ a: string }, C>; // Ok, equivalent to G var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! error TS2343: Type 'A' does not satisfy the constraint 'B': -!!! error TS2343: Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. var v4: G, C>; // Ok var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments diff --git a/tests/baselines/reference/generics2.errors.txt b/tests/baselines/reference/generics2.errors.txt index dfe58f07f23..a0380eee753 100644 --- a/tests/baselines/reference/generics2.errors.txt +++ b/tests/baselines/reference/generics2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics2.ts(17,9): error TS2343: Type 'A' does not satisfy the constraint 'B': +tests/cases/compiler/generics2.ts(17,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. tests/cases/compiler/generics2.ts(20,9): error TS2314: Generic type 'G' requires 2 type argument(s). tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' requires 2 type argument(s). @@ -23,8 +23,8 @@ tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' re var v2: G<{ a: string }, C>; // Ok, equivalent to G var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! error TS2343: Type 'A' does not satisfy the constraint 'B': -!!! error TS2343: Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. var v4: G, C>; // Ok var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments diff --git a/tests/baselines/reference/generics4.errors.txt b/tests/baselines/reference/generics4.errors.txt index dcf210a53cf..06bfa122901 100644 --- a/tests/baselines/reference/generics4.errors.txt +++ b/tests/baselines/reference/generics4.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assignable to type 'C': - Type 'Y' is not assignable to type 'X': - Types of property 'f' are incompatible: - Type '() => boolean' is not assignable to type '() => string': +tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assignable to type 'C'. + Type 'Y' is not assignable to type 'X'. + Types of property 'f' are incompatible. + Type '() => boolean' is not assignable to type '() => string'. Type 'boolean' is not assignable to type 'string'. @@ -14,8 +14,8 @@ tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assigna a = b; // Not ok - return types of "f" are different ~ -!!! error TS2322: Type 'C' is not assignable to type 'C': -!!! error TS2322: Type 'Y' is not assignable to type 'X': -!!! error TS2322: Types of property 'f' are incompatible: -!!! error TS2322: Type '() => boolean' is not assignable to type '() => string': +!!! error TS2322: Type 'C' is not assignable to type 'C'. +!!! error TS2322: Type 'Y' is not assignable to type 'X'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '() => boolean' is not assignable to type '() => string'. !!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/generics5.errors.txt b/tests/baselines/reference/generics5.errors.txt index fa279b92a5d..17aeea63df2 100644 --- a/tests/baselines/reference/generics5.errors.txt +++ b/tests/baselines/reference/generics5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics5.ts(10,9): error TS2343: Type 'A' does not satisfy the constraint 'B': +tests/cases/compiler/generics5.ts(10,9): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. @@ -14,7 +14,7 @@ tests/cases/compiler/generics5.ts(10,9): error TS2343: Type 'A' does not satisfy var v3: G; // Error, A not valid argument for U ~~~~~~~ -!!! error TS2343: Type 'A' does not satisfy the constraint 'B': -!!! error TS2343: Property 'b' is missing in type 'A'. +!!! error TS2344: Type 'A' does not satisfy the constraint 'B'. +!!! error TS2344: Property 'b' is missing in type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt index b4843deb9c2..69d367bb21c 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'T'. @@ -27,7 +27,7 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': +!!! error TS2322: Type 'A' is not assignable to type 'A'. !!! error TS2322: Type 'string' is not assignable to type 'T'. } ~~~~~ diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt index 637c140a1f3..bca86419f62 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': +tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'number'. @@ -27,7 +27,7 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A': +!!! error TS2322: Type 'A' is not assignable to type 'A'. !!! error TS2322: Type 'string' is not assignable to type 'number'. } ~~~~~ diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index 15f8f21b8f3..e5c2be7a598 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. - Type 'string | number' is not assignable to type 'string': + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -15,7 +15,7 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argu this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'string': +!!! error TS2345: Type 'string | number' is not assignable to type 'string'. !!! error TS2345: Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/i3.errors.txt b/tests/baselines/reference/i3.errors.txt index 1a03e690a2f..ef7aefa4598 100644 --- a/tests/baselines/reference/i3.errors.txt +++ b/tests/baselines/reference/i3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }': +tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }'. Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. @@ -10,5 +10,5 @@ tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to ty i = x; x = i; ~ -!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }': +!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }'. !!! error TS2322: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt index 43baa8c8be7..0ded03b0808 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.errors.txt +++ b/tests/baselines/reference/implementClausePrecedingExtends.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/implementClausePrecedingExtends.ts(2,22): error TS1005: '{' expected. tests/cases/compiler/implementClausePrecedingExtends.ts(2,32): error TS1005: ';' expected. -tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2421: Class 'D' incorrectly implements interface 'C': +tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2420: Class 'D' incorrectly implements interface 'C'. Property 'foo' is missing in type 'D'. @@ -12,5 +12,5 @@ tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2421: Clas ~ !!! error TS1005: ';' expected. ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'C': -!!! error TS2421: Property 'foo' is missing in type 'D'. \ No newline at end of file +!!! error TS2420: Class 'D' incorrectly implements interface 'C'. +!!! error TS2420: Property 'foo' is missing in type 'D'. \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt index 4c2803b76ac..7a128b87764 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2421: Class 'C' incorrectly implements interface 'IFoo': - Types of property 'foo' are incompatible: - Type '(x: string) => number' is not assignable to type '(x: T) => T': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/compiler/implementGenericWithMismatchedTypes.ts(7,7): error TS2420: Class 'C' incorrectly implements interface 'IFoo'. + Types of property 'foo' are incompatible. + Type '(x: string) => number' is not assignable to type '(x: T) => T'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'T'. -tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': - Types of property 'foo' are incompatible: - Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': +tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. + Types of property 'foo' are incompatible. + Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. Type 'number' is not assignable to type 'T'. @@ -18,11 +18,11 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2421: } class C implements IFoo { // error ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'IFoo': -!!! error TS2421: Types of property 'foo' are incompatible: -!!! error TS2421: Type '(x: string) => number' is not assignable to type '(x: T) => T': -!!! error TS2421: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2421: Type 'string' is not assignable to type 'T'. +!!! error TS2420: Class 'C' incorrectly implements interface 'IFoo'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: string) => number' is not assignable to type '(x: T) => T'. +!!! error TS2420: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2420: Type 'string' is not assignable to type 'T'. foo(x: string): number { return null; } @@ -33,10 +33,10 @@ tests/cases/compiler/implementGenericWithMismatchedTypes.ts(16,7): error TS2421: } class C2 implements IFoo2 { // error ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': -!!! error TS2421: Types of property 'foo' are incompatible: -!!! error TS2421: Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': -!!! error TS2421: Type 'number' is not assignable to type 'T'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. +!!! error TS2420: Types of property 'foo' are incompatible. +!!! error TS2420: Type '(x: Tstring) => number' is not assignable to type '(x: T) => T'. +!!! error TS2420: Type 'number' is not assignable to type 'T'. foo(x: Tstring): number { return null; } diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt index c445403c3fa..75d9fdcce34 100644 --- a/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'x' is private in type 'C' but not in type 'I'. @@ -8,7 +8,7 @@ tests/cases/compiler/implementPublicPropertyAsPrivate.ts(4,7): error TS2421: Cla } class C implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is private in type 'C' but not in type 'I'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'C' but not in type 'I'. private x = 0; // should raise error at class decl } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt index ab12cb9708b..a38c477f111 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(9,7): error TS2421: Class 'Bar' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(12,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'x' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'x' is private in type 'I' but not in type 'Bar3'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2421: Class 'Bar4' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. @@ -19,29 +19,29 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar implements I { // error ~~~ -!!! error TS2421: Class 'Bar' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. } class Bar2 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'Bar2'. y: number; } class Bar3 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is private in type 'I' but not in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'I' but not in type 'Bar3'. x: string; y: number; } class Bar4 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar4' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: string; y: number; } \ No newline at end of file diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt index 53fc5c54bee..c6c0be3896c 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.errors.txt @@ -1,30 +1,30 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(13,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'x' is private in type 'I' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(18,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(42,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'z' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(47,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'z' is missing in type 'Bar3'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2421: Class 'Bar' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(67,11): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar'. tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(73,14): error TS2341: Property 'x' is private and only accessible within class 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(74,16): error TS2339: Property 'y' does not exist on type 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. Property 'x' is private in type 'Foo' but not in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(76,11): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithPrivates2.ts(81,11): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar3'. @@ -43,22 +43,22 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar2 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': -!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is private in type 'I' but not in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is private in type 'I' but not in type 'Bar2'. x: string; y: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: string; y: number; } @@ -84,22 +84,22 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar2 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': -!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'z' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'z' is missing in type 'Bar2'. x: string; y: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'z' is missing in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'z' is missing in type 'Bar3'. private x: string; y: number; } @@ -121,8 +121,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar extends Foo implements I { // error ~~~ -!!! error TS2421: Class 'Bar' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. z: number; } @@ -137,22 +137,22 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar2 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar2' incorrectly extends base class 'Foo': -!!! error TS2416: Property 'x' is private in type 'Foo' but not in type 'Bar2'. +!!! error TS2415: Class 'Bar2' incorrectly extends base class 'Foo'. +!!! error TS2415: Property 'x' is private in type 'Foo' but not in type 'Bar2'. ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar2'. x: string; z: number; } class Bar3 extends Foo implements I { // error ~~~~ -!!! error TS2416: Class 'Bar3' incorrectly extends base class 'Foo': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'Bar3' incorrectly extends base class 'Foo'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar3'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar3'. private x: string; z: number; } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt index fc7cbbed97a..3835408ab05 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2421: Class 'Bar' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(9,7): error TS2420: Class 'Bar' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2421: Class 'Bar2' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(12,7): error TS2420: Class 'Bar2' incorrectly implements interface 'I'. Property 'x' is missing in type 'Bar2'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2421: Class 'Bar3' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(16,7): error TS2420: Class 'Bar3' incorrectly implements interface 'I'. Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2421: Class 'Bar4' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(21,7): error TS2420: Class 'Bar4' incorrectly implements interface 'I'. Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2421: Class 'Bar5' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(26,7): error TS2420: Class 'Bar5' incorrectly implements interface 'I'. Property 'y' is missing in type 'Bar5'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2421: Class 'Bar6' incorrectly implements interface 'I': +tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInterfaceExtendingClassWithProtecteds.ts(29,7): error TS2420: Class 'Bar6' incorrectly implements interface 'I'. Property 'y' is protected in type 'Bar6' but public in type 'I'. @@ -23,43 +23,43 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/implementingAnInte class Bar implements I { // error ~~~ -!!! error TS2421: Class 'Bar' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar'. +!!! error TS2420: Class 'Bar' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar'. } class Bar2 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar2' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is missing in type 'Bar2'. +!!! error TS2420: Class 'Bar2' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is missing in type 'Bar2'. y: number; } class Bar3 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar3' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. +!!! error TS2420: Class 'Bar3' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is protected but type 'Bar3' is not a class derived from 'Foo'. x: string; y: number; } class Bar4 implements I { // error ~~~~ -!!! error TS2421: Class 'Bar4' incorrectly implements interface 'I': -!!! error TS2421: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. +!!! error TS2420: Class 'Bar4' incorrectly implements interface 'I'. +!!! error TS2420: Property 'x' is protected but type 'Bar4' is not a class derived from 'Foo'. protected x: string; y: number; } class Bar5 extends Foo implements I { // error ~~~~ -!!! error TS2421: Class 'Bar5' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is missing in type 'Bar5'. +!!! error TS2420: Class 'Bar5' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is missing in type 'Bar5'. } class Bar6 extends Foo implements I { // error ~~~~ -!!! error TS2421: Class 'Bar6' incorrectly implements interface 'I': -!!! error TS2421: Property 'y' is protected in type 'Bar6' but public in type 'I'. +!!! error TS2420: Class 'Bar6' incorrectly implements interface 'I'. +!!! error TS2420: Property 'y' is protected in type 'Bar6' but public in type 'I'. protected y: number; } diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 5cff22d7e98..7401c3e7518 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -61,12 +61,12 @@ import clolias = clodule; var p: clolias.Point; >p : alias.Point ->clolias : clodule +>clolias : unknown >Point : clolias.Point var p: clodule.Point; >p : alias.Point ->clodule : clodule +>clodule : unknown >Point : clolias.Point var p: { x: number; y: number; }; diff --git a/tests/baselines/reference/incompatibleGenericTypes.errors.txt b/tests/baselines/reference/incompatibleGenericTypes.errors.txt index 13aa9ea2e25..e5dc6ed5b3c 100644 --- a/tests/baselines/reference/incompatibleGenericTypes.errors.txt +++ b/tests/baselines/reference/incompatibleGenericTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1' is not assignable to type 'I1': +tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1' is not assignable to type 'I1'. Type 'boolean' is not assignable to type 'number'. @@ -14,5 +14,5 @@ tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1 = v1; ~~ -!!! error TS2322: Type 'I1' is not assignable to type 'I1': +!!! error TS2322: Type 'I1' is not assignable to type 'I1'. !!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 6f7fd89d79e..14dfa883f45 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -1,26 +1,26 @@ -tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2421: Class 'C1' incorrectly implements interface 'IFoo1': - Types of property 'p1' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/compiler/incompatibleTypes.ts(5,7): error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. + Types of property 'p1' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': - Types of property 'p1' are incompatible: - Type '(n: number) => number' is not assignable to type '(s: string) => number': - Types of parameters 'n' and 's' are incompatible: +tests/cases/compiler/incompatibleTypes.ts(15,7): error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. + Types of property 'p1' are incompatible. + Type '(n: number) => number' is not assignable to type '(s: string) => number'. + Types of parameters 'n' and 's' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2421: Class 'C3' incorrectly implements interface 'IFoo3': - Types of property 'p1' are incompatible: +tests/cases/compiler/incompatibleTypes.ts(25,7): error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. + Types of property 'p1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2421: Class 'C4' incorrectly implements interface 'IFoo4': - Types of property 'p1' are incompatible: - Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }': +tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2420: Class 'C4' incorrectly implements interface 'IFoo4'. + Types of property 'p1' are incompatible. + Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. tests/cases/compiler/incompatibleTypes.ts(49,5): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. Property 'c' is missing in type '{ e: number; f: number; }'. -tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }': +tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Property 'a' is missing in type '{ e: number; f: number; }'. -tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2323: Type 'number' is not assignable to type '() => string'. -tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => number' is not assignable to type '() => any'. +tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. +tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -30,10 +30,10 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C1 implements IFoo1 { // incompatible on the return type ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'IFoo1': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type '() => string' is not assignable to type '() => number': -!!! error TS2421: Type 'string' is not assignable to type 'number'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'IFoo1'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => number'. +!!! error TS2420: Type 'string' is not assignable to type 'number'. public p1() { return "s"; } @@ -45,11 +45,11 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C2 implements IFoo2 { // incompatible on the param type ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'IFoo2': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type '(n: number) => number' is not assignable to type '(s: string) => number': -!!! error TS2421: Types of parameters 'n' and 's' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'IFoo2'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '(n: number) => number' is not assignable to type '(s: string) => number'. +!!! error TS2420: Types of parameters 'n' and 's' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1(n:number) { return 0; } @@ -61,9 +61,9 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C3 implements IFoo3 { // incompatible on the property type ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'IFoo3': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'IFoo3'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public p1: number; } @@ -73,10 +73,10 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => class C4 implements IFoo4 { // incompatible on the property type ~~ -!!! error TS2421: Class 'C4' incorrectly implements interface 'IFoo4': -!!! error TS2421: Types of property 'p1' are incompatible: -!!! error TS2421: Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }': -!!! error TS2421: Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. +!!! error TS2420: Class 'C4' incorrectly implements interface 'IFoo4'. +!!! error TS2420: Types of property 'p1' are incompatible. +!!! error TS2420: Type '{ c: { b: string; }; d: string; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +!!! error TS2420: Property 'a' is missing in type '{ c: { b: string; }; d: string; }'. public p1: { c: { b: string; }; d: string; }; } @@ -116,7 +116,7 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; ~~ -!!! error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }': +!!! error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. !!! error TS2322: Property 'a' is missing in type '{ e: number; f: number; }'. var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; @@ -125,9 +125,9 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => var i1c1: { (): string; } = 5; ~~~~ -!!! error TS2323: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. var fp1: () =>any = a => 0; ~~~ -!!! error TS2323: Type '(a: any) => number' is not assignable to type '() => any'. +!!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.js b/tests/baselines/reference/incrementOperatorWithEnumType.js index 2baa326f399..590815ffec5 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumType.js +++ b/tests/baselines/reference/incrementOperatorWithEnumType.js @@ -22,8 +22,8 @@ var ENUM1; })(ENUM1 || (ENUM1 = {})); ; // expression -var ResultIsNumber1 = ++ENUM1["B"]; +var ResultIsNumber1 = ++1 /* "B" */; var ResultIsNumber2 = 1 /* B */++; // miss assignment operator -++ENUM1["B"]; +++1 /* "B" */; 1 /* B */++; diff --git a/tests/baselines/reference/indexIntoArraySubclass.errors.txt b/tests/baselines/reference/indexIntoArraySubclass.errors.txt index 297ef6a960b..1628e12d22f 100644 --- a/tests/baselines/reference/indexIntoArraySubclass.errors.txt +++ b/tests/baselines/reference/indexIntoArraySubclass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/indexIntoArraySubclass.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2323: Type 'number' var r = x2[0]; // string r = 0; //error ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/indexer2.errors.txt b/tests/baselines/reference/indexer2.errors.txt index 9587bb6bb75..28020a570ed 100644 --- a/tests/baselines/reference/indexer2.errors.txt +++ b/tests/baselines/reference/indexer2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/indexer2.ts(6,25): error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: - Types of property 'hasOwnProperty' are incompatible: - Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': - Types of parameters 'v' and 'objectId' are incompatible: +tests/cases/compiler/indexer2.ts(6,25): error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. + Types of property 'hasOwnProperty' are incompatible. + Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. + Types of parameters 'v' and 'objectId' are incompatible. Type 'string' is not assignable to type 'number'. @@ -13,8 +13,8 @@ tests/cases/compiler/indexer2.ts(6,25): error TS2353: Neither type '{ [x: number } var directChildrenMap = {}; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: -!!! error TS2353: Types of property 'hasOwnProperty' are incompatible: -!!! error TS2353: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': -!!! error TS2353: Types of parameters 'v' and 'objectId' are incompatible: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. +!!! error TS2352: Types of property 'hasOwnProperty' are incompatible. +!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. +!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/indexer2A.errors.txt b/tests/baselines/reference/indexer2A.errors.txt index 548ed5e565b..f2314c5b49b 100644 --- a/tests/baselines/reference/indexer2A.errors.txt +++ b/tests/baselines/reference/indexer2A.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/indexer2A.ts(4,5): error TS2391: Function implementation is missing or not immediately following the declaration. -tests/cases/compiler/indexer2A.ts(7,25): error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: - Types of property 'hasOwnProperty' are incompatible: - Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': - Types of parameters 'v' and 'objectId' are incompatible: +tests/cases/compiler/indexer2A.ts(7,25): error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. + Types of property 'hasOwnProperty' are incompatible. + Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. + Types of parameters 'v' and 'objectId' are incompatible. Type 'string' is not assignable to type 'number'. @@ -17,8 +17,8 @@ tests/cases/compiler/indexer2A.ts(7,25): error TS2353: Neither type '{ [x: numbe } var directChildrenMap = {}; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other: -!!! error TS2353: Types of property 'hasOwnProperty' are incompatible: -!!! error TS2353: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean': -!!! error TS2353: Types of parameters 'v' and 'objectId' are incompatible: -!!! error TS2353: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2352: Neither type '{ [x: number]: undefined; }' nor type 'IDirectChildrenMap' is assignable to the other. +!!! error TS2352: Types of property 'hasOwnProperty' are incompatible. +!!! error TS2352: Type '(v: string) => boolean' is not assignable to type '(objectId: number) => boolean'. +!!! error TS2352: Types of parameters 'v' and 'objectId' are incompatible. +!!! error TS2352: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.errors.txt b/tests/baselines/reference/indexerAssignability.errors.txt index 062ddbc3c43..9f28fc1e9e0 100644 --- a/tests/baselines/reference/indexerAssignability.errors.txt +++ b/tests/baselines/reference/indexerAssignability.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }': +tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{ [x: number]: string; }'. -tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }': +tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{}'. -tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }': +tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }'. Index signature is missing in type '{}'. @@ -13,16 +13,16 @@ tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is no a = b; ~ -!!! error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }': +!!! error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. !!! error TS2322: Index signature is missing in type '{ [x: number]: string; }'. a = c; ~ -!!! error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }': +!!! error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }'. !!! error TS2322: Index signature is missing in type '{}'. b = a; b = c; ~ -!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }': +!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }'. !!! error TS2322: Index signature is missing in type '{}'. c = a; c = b; \ No newline at end of file diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt index 9b01d9c4bc6..c9232d3fac7 100644 --- a/tests/baselines/reference/inferSetterParamType.errors.txt +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/inferSetterParamType.ts(3,9): error TS1056: Accessors are o tests/cases/compiler/inferSetterParamType.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/inferSetterParamType.ts (5 errors) ==== @@ -26,7 +26,7 @@ tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2323: Type 'number' !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; // should be an error - can't coerce infered return type to match setter annotated type ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } set bar(n:string) { ~~~ diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt index 0c87fb6d22d..9dfb41c0fac 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts (2 errors) ==== @@ -8,8 +8,8 @@ tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error } f({ x: [null] }, { x: [1] }).x[0] = "" // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt index 908681ddf7a..c8367bef57b 100644 --- a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2322: Type 'OwnerList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2322: Type 'OwnerList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'List' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2322: Type 'OwnerList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2322: Type 'OwnerList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'List' is not assignable to type 'T'. @@ -24,8 +24,8 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansion var ownerList: OwnerList; list = ownerList; ~~~~ -!!! error TS2322: Type 'OwnerList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: +!!! error TS2322: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. !!! error TS2322: Type 'List' is not assignable to type 'string'. function other(x: T) { @@ -33,8 +33,8 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansion var ownerList: OwnerList; list = ownerList; ~~~~ -!!! error TS2322: Type 'OwnerList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: +!!! error TS2322: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. !!! error TS2322: Type 'List' is not assignable to type 'T'. } diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt index 71a9f74e77a..555349cc251 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromDifferentOrigins.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -13,7 +13,7 @@ tests/cases/compiler/inheritSameNamePrivatePropertiesFromDifferentOrigins.ts(9,1 interface A extends C, C2 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt index 8de311e230a..3f9c4a3bae0 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentOptionality.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -13,7 +13,7 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentOptionality.ts(9,11): interface A extends C, C2 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt index a6671492277..9864b4a4792 100644 --- a/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt +++ b/tests/baselines/reference/inheritSameNamePropertiesWithDifferentVisibility.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -13,7 +13,7 @@ tests/cases/compiler/inheritSameNamePropertiesWithDifferentVisibility.ts(9,11): interface A extends C, C2 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritance.errors.txt b/tests/baselines/reference/inheritance.errors.txt index 4811357b6d5..c667e8b001e 100644 --- a/tests/baselines/reference/inheritance.errors.txt +++ b/tests/baselines/reference/inheritance.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritance.ts(30,7): error TS2416: Class 'Baad' incorrectly extends base class 'Good': - Types of property 'g' are incompatible: +tests/cases/compiler/inheritance.ts(30,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. + Types of property 'g' are incompatible. Type '(n: number) => number' is not assignable to type '() => number'. tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. @@ -36,9 +36,9 @@ tests/cases/compiler/inheritance.ts(31,12): error TS2425: Class 'Good' defines i class Baad extends Good { ~~~~ -!!! error TS2416: Class 'Baad' incorrectly extends base class 'Good': -!!! error TS2416: Types of property 'g' are incompatible: -!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. +!!! error TS2415: Types of property 'g' are incompatible. +!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. public f(): number { return 0; } ~ !!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. diff --git a/tests/baselines/reference/inheritance1.errors.txt b/tests/baselines/reference/inheritance1.errors.txt index 0d2f6a72bfd..f33dd120e76 100644 --- a/tests/baselines/reference/inheritance1.errors.txt +++ b/tests/baselines/reference/inheritance1.errors.txt @@ -1,24 +1,24 @@ -tests/cases/compiler/inheritance1.ts(14,7): error TS2421: Class 'ImageBase' incorrectly implements interface 'SelectableControl': +tests/cases/compiler/inheritance1.ts(14,7): error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'. Property 'select' is missing in type 'ImageBase'. -tests/cases/compiler/inheritance1.ts(18,7): error TS2421: Class 'Locations' incorrectly implements interface 'SelectableControl': +tests/cases/compiler/inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. Property 'state' is missing in type 'Locations'. -tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button': +tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox': +tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(40,1): error TS2323: Type 'ImageBase' is not assignable to type 'SelectableControl'. -tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl': +tests/cases/compiler/inheritance1.ts(40,1): error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'. Property 'select' is missing in type 'Image1'. -tests/cases/compiler/inheritance1.ts(52,1): error TS2323: Type 'Locations' is not assignable to type 'SelectableControl'. -tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control': +tests/cases/compiler/inheritance1.ts(52,1): error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control'. Property 'state' is missing in type 'Locations'. -tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations': +tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl': +tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'. Property 'state' is missing in type 'Locations1'. -tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control': +tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control'. Property 'state' is missing in type 'Locations1'. -tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1': +tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1'. Property 'select' is missing in type 'Control'. @@ -38,15 +38,15 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not } class ImageBase extends Control implements SelectableControl{ ~~~~~~~~~ -!!! error TS2421: Class 'ImageBase' incorrectly implements interface 'SelectableControl': -!!! error TS2421: Property 'select' is missing in type 'ImageBase'. +!!! error TS2420: Class 'ImageBase' incorrectly implements interface 'SelectableControl'. +!!! error TS2420: Property 'select' is missing in type 'ImageBase'. } class Image1 extends Control { } class Locations implements SelectableControl { ~~~~~~~~~ -!!! error TS2421: Class 'Locations' incorrectly implements interface 'SelectableControl': -!!! error TS2421: Property 'state' is missing in type 'Locations'. +!!! error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. +!!! error TS2420: Property 'state' is missing in type 'Locations'. select() { } } class Locations1 { @@ -61,7 +61,7 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not b = sc; b = c; ~ -!!! error TS2322: Type 'Control' is not assignable to type 'Button': +!!! error TS2322: Type 'Control' is not assignable to type 'Button'. !!! error TS2322: Property 'select' is missing in type 'Control'. var t: TextBox; @@ -70,13 +70,13 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not t = sc; t = c; ~ -!!! error TS2322: Type 'Control' is not assignable to type 'TextBox': +!!! error TS2322: Type 'Control' is not assignable to type 'TextBox'. !!! error TS2322: Property 'select' is missing in type 'Control'. var i: ImageBase; sc = i; ~~ -!!! error TS2323: Type 'ImageBase' is not assignable to type 'SelectableControl'. +!!! error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'. c = i; i = sc; i = c; @@ -84,7 +84,7 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not var i1: Image1; sc = i1; ~~ -!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl': +!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'. !!! error TS2322: Property 'select' is missing in type 'Image1'. c = i1; i1 = sc; @@ -93,28 +93,28 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not var l: Locations; sc = l; ~~ -!!! error TS2323: Type 'Locations' is not assignable to type 'SelectableControl'. +!!! error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'. c = l; ~ -!!! error TS2322: Type 'Locations' is not assignable to type 'Control': +!!! error TS2322: Type 'Locations' is not assignable to type 'Control'. !!! error TS2322: Property 'state' is missing in type 'Locations'. l = sc; l = c; ~ -!!! error TS2322: Type 'Control' is not assignable to type 'Locations': +!!! error TS2322: Type 'Control' is not assignable to type 'Locations'. !!! error TS2322: Property 'select' is missing in type 'Control'. var l1: Locations1; sc = l1; ~~ -!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl': +!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'. !!! error TS2322: Property 'state' is missing in type 'Locations1'. c = l1; ~ -!!! error TS2322: Type 'Locations1' is not assignable to type 'Control': +!!! error TS2322: Type 'Locations1' is not assignable to type 'Control'. !!! error TS2322: Property 'state' is missing in type 'Locations1'. l1 = sc; l1 = c; ~~ -!!! error TS2322: Type 'Control' is not assignable to type 'Locations1': +!!! error TS2322: Type 'Control' is not assignable to type 'Locations1'. !!! error TS2322: Property 'select' is missing in type 'Control'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt index 8bcef0e5a14..84a04107008 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B': +tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. Types have separate declarations of a private property 'myMethod'. @@ -11,8 +11,8 @@ tests/cases/compiler/inheritanceGrandParentPrivateMemberCollision.ts(7,7): error class C extends B { ~ -!!! error TS2416: Class 'C' incorrectly extends base class 'B': -!!! error TS2416: Types have separate declarations of a private property 'myMethod'. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Types have separate declarations of a private property 'myMethod'. private myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt index 7676029fb8b..7486fbc6e8f 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B': +tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. Property 'myMethod' is private in type 'B' but not in type 'C'. @@ -11,8 +11,8 @@ tests/cases/compiler/inheritanceGrandParentPrivateMemberCollisionWithPublicMembe class C extends B { ~ -!!! error TS2416: Class 'C' incorrectly extends base class 'B': -!!! error TS2416: Property 'myMethod' is private in type 'B' but not in type 'C'. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Property 'myMethod' is private in type 'B' but not in type 'C'. public myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt index c5d41868fab..1ef0d8c0cdb 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts(7,7): error TS2416: Class 'C' incorrectly extends base class 'B': +tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.ts(7,7): error TS2415: Class 'C' incorrectly extends base class 'B'. Property 'myMethod' is private in type 'C' but not in type 'B'. @@ -11,8 +11,8 @@ tests/cases/compiler/inheritanceGrandParentPublicMemberCollisionWithPrivateMembe class C extends B { ~ -!!! error TS2416: Class 'C' incorrectly extends base class 'B': -!!! error TS2416: Property 'myMethod' is private in type 'C' but not in type 'B'. +!!! error TS2415: Class 'C' incorrectly extends base class 'B'. +!!! error TS2415: Property 'myMethod' is private in type 'C' but not in type 'B'. private myMethod() { } } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt index 243bcecb57d..54f5fcc2a34 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2416: Class 'b' incorrectly extends base class 'a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor. @@ -15,9 +15,9 @@ tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS class b extends a { ~ -!!! error TS2416: Class 'b' incorrectly extends base class 'a': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type '() => string'. +!!! error TS2415: Class 'b' incorrectly extends base class 'a'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type '() => string'. get x() { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt index 3208de26bd4..283e7ce3f18 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(10,7): error TS2416: Class 'b' incorrectly extends base class 'a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(10,7): error TS2415: Class 'b' incorrectly extends base class 'a'. + Types of property 'x' are incompatible. Type '() => string' is not assignable to type 'string'. tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(11,5): error TS2426: Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. @@ -22,9 +22,9 @@ tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts(11,5): error TS2 class b extends a { ~ -!!! error TS2416: Class 'b' incorrectly extends base class 'a': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type '() => string' is not assignable to type 'string'. +!!! error TS2415: Class 'b' incorrectly extends base class 'a'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type '() => string' is not assignable to type 'string'. x() { ~ !!! error TS2426: Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function. diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt index eb8b181c1fd..026c2b51ac9 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. @@ -14,9 +14,9 @@ tests/cases/compiler/inheritanceStaticAccessorOverridingMethod.ts(7,7): error TS class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'string' is not assignable to type '() => string'. static get x() { ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt index 46e079217b8..cfe05da8ea4 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type '() => string' is not assignable to type 'string'. @@ -21,9 +21,9 @@ tests/cases/compiler/inheritanceStaticFuncOverridingAccessor.ts(10,7): error TS2 class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type '() => string' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type '() => string' is not assignable to type 'string'. static x() { return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt index 3ecc7a44522..61edfe7fc64 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type '() => string' is not assignable to type 'string'. @@ -10,9 +10,9 @@ tests/cases/compiler/inheritanceStaticFuncOverridingProperty.ts(5,7): error TS24 class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type '() => string' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type '() => string' is not assignable to type 'string'. static x() { return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt index 01c276be81c..49dfd2de513 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -10,8 +10,8 @@ tests/cases/compiler/inheritanceStaticMembersIncompatible.ts(5,7): error TS2418: class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type 'number' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'number' is not assignable to type 'string'. static x: number; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt index f2137aab6f0..22748fda783 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': - Types of property 'x' are incompatible: +tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. + Types of property 'x' are incompatible. Type 'string' is not assignable to type '() => string'. @@ -12,8 +12,8 @@ tests/cases/compiler/inheritanceStaticPropertyOverridingMethod.ts(7,7): error TS class b extends a { ~ -!!! error TS2418: Class static side 'typeof b' incorrectly extends base class static side 'typeof a': -!!! error TS2418: Types of property 'x' are incompatible: -!!! error TS2418: Type 'string' is not assignable to type '() => string'. +!!! error TS2417: Class static side 'typeof b' incorrectly extends base class static side 'typeof a'. +!!! error TS2417: Types of property 'x' are incompatible. +!!! error TS2417: Type 'string' is not assignable to type '() => string'. static x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt index 31816482cb5..0b7e00d95ce 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2418: Class static side 'typeof D' incorrectly extends base class static side 'typeof C': - Types of property 'foo' are incompatible: - Type '() => number' is not assignable to type '() => string': +tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. + Types of property 'foo' are incompatible. + Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. @@ -13,10 +13,10 @@ tests/cases/compiler/inheritedModuleMembersForClodule.ts(7,7): error TS2418: Cla class D extends C { ~ -!!! error TS2418: Class static side 'typeof D' incorrectly extends base class static side 'typeof C': -!!! error TS2418: Types of property 'foo' are incompatible: -!!! error TS2418: Type '() => number' is not assignable to type '() => string': -!!! error TS2418: Type 'number' is not assignable to type 'string'. +!!! error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'. +!!! error TS2417: Types of property 'foo' are incompatible. +!!! error TS2417: Type '() => number' is not assignable to type '() => string'. +!!! error TS2417: Type 'number' is not assignable to type 'string'. } module D { diff --git a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt index a7861a136ca..b99efb5e157 100644 --- a/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt +++ b/tests/baselines/reference/inheritedStringIndexersFromDifferentBaseTypes.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(13,11): error TS2429: Interface 'E' incorrectly extends interface 'D': - Index signatures are incompatible: +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(13,11): error TS2430: Interface 'E' incorrectly extends interface 'D'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): error TS2429: Interface 'E2' incorrectly extends interface 'D2': - Index signatures are incompatible: +tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): error TS2430: Interface 'E2' incorrectly extends interface 'D2'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -21,9 +21,9 @@ tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): er } interface E extends A, D { } // error ~ -!!! error TS2429: Interface 'E' incorrectly extends interface 'D': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'E' incorrectly extends interface 'D'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. // Same tests for number indexer @@ -40,6 +40,6 @@ tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts(28,11): er } interface E2 extends A2, D2 { } // error ~~ -!!! error TS2429: Interface 'E2' incorrectly extends interface 'D2': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2430: Interface 'E2' incorrectly extends interface 'D2'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt index 93f66768b35..b5e56d2f4e3 100644 --- a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2323: Type // otherwise, there's a bug in overload resolution / partial typechecking var k: string = 10; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } ); \ No newline at end of file diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt index 06d2d76a6e1..080316f8daf 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number': +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. Type 'void' is not assignable to type 'number'. @@ -11,7 +11,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara bar(x: number): number { C.prototype.bar = () => { } // error ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number': +!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. !!! error TS2322: Type 'void' is not assignable to type 'number'. C.prototype.bar = (x) => x; // ok C.prototype.bar = (x: number) => 1; // ok diff --git a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt index dab3c0279bc..ba93c2ef127 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt +++ b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2416: Class 'C2' incorrectly extends base class 'C1': - Types of property 'x' are incompatible: - Type 'string' is not assignable to type 'C2': +tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' incorrectly extends base class 'C1'. + Types of property 'x' are incompatible. + Type 'string' is not assignable to type 'C2'. Property 'x' is missing in type 'String'. @@ -11,9 +11,9 @@ tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2416: Class 'C2' class C2 extends C1 { ~~ -!!! error TS2416: Class 'C2' incorrectly extends base class 'C1': -!!! error TS2416: Types of property 'x' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'C2': -!!! error TS2416: Property 'x' is missing in type 'String'. +!!! error TS2415: Class 'C2' incorrectly extends base class 'C1'. +!!! error TS2415: Types of property 'x' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'C2'. +!!! error TS2415: Property 'x' is missing in type 'String'. x: string } \ No newline at end of file diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 6fdf7ea2aa8..e6cfc73230a 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -13,79 +13,79 @@ tests/cases/compiler/intTypeCheck.ts(174,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(188,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(202,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(83,5): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/intTypeCheck.ts(97,5): error TS2322: Type 'Object' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(97,5): error TS2322: Type 'Object' is not assignable to type 'i1'. Property 'p' is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(98,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'i1'. Property 'p' is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type '() => void' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type '() => void' is not assignable to type 'i1'. Property 'p' is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(104,5): error TS2322: Type 'boolean' is not assignable to type 'i1': +tests/cases/compiler/intTypeCheck.ts(104,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(104,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(105,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(110,5): error TS2323: Type '{}' is not assignable to type 'i2'. -tests/cases/compiler/intTypeCheck.ts(111,5): error TS2323: Type 'Object' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(110,5): error TS2322: Type '{}' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(111,5): error TS2322: Type 'Object' is not assignable to type 'i2'. tests/cases/compiler/intTypeCheck.ts(112,17): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/intTypeCheck.ts(113,5): error TS2323: Type 'Base' is not assignable to type 'i2'. -tests/cases/compiler/intTypeCheck.ts(118,5): error TS2323: Type 'boolean' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Base' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(118,5): error TS2322: Type 'boolean' is not assignable to type 'i2'. tests/cases/compiler/intTypeCheck.ts(118,22): error TS2304: Cannot find name 'i2'. tests/cases/compiler/intTypeCheck.ts(119,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(124,5): error TS2323: Type '{}' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(125,5): error TS2323: Type 'Object' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(127,5): error TS2323: Type 'Base' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(129,5): error TS2323: Type '() => void' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(132,5): error TS2323: Type 'boolean' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(124,5): error TS2322: Type '{}' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(125,5): error TS2322: Type 'Object' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Base' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type '() => void' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(132,5): error TS2322: Type 'boolean' is not assignable to type 'i3'. tests/cases/compiler/intTypeCheck.ts(132,22): error TS2304: Cannot find name 'i3'. tests/cases/compiler/intTypeCheck.ts(133,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(139,5): error TS2322: Type 'Object' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(139,5): error TS2322: Type 'Object' is not assignable to type 'i4'. Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(140,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Base' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Base' is not assignable to type 'i4'. Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type '() => void' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type '() => void' is not assignable to type 'i4'. Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not assignable to type 'i4': +tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(146,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(147,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5'. Property 'p' is missing in type '{}'. -tests/cases/compiler/intTypeCheck.ts(153,5): error TS2322: Type 'Object' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(153,5): error TS2322: Type 'Object' is not assignable to type 'i5'. Property 'p' is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(154,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(155,5): error TS2322: Type 'Base' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(155,5): error TS2322: Type 'Base' is not assignable to type 'i5'. Property 'p' is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type '() => void' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type '() => void' is not assignable to type 'i5'. Property 'p' is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(160,5): error TS2322: Type 'boolean' is not assignable to type 'i5': +tests/cases/compiler/intTypeCheck.ts(160,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(160,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(161,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(166,5): error TS2323: Type '{}' is not assignable to type 'i6'. -tests/cases/compiler/intTypeCheck.ts(167,5): error TS2323: Type 'Object' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(166,5): error TS2322: Type '{}' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(167,5): error TS2322: Type 'Object' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(168,17): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/intTypeCheck.ts(169,5): error TS2323: Type 'Base' is not assignable to type 'i6'. -tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type '() => void' is not assignable to type 'i6': +tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Base' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type '() => void' is not assignable to type 'i6'. Type 'void' is not assignable to type 'number'. -tests/cases/compiler/intTypeCheck.ts(174,5): error TS2323: Type 'boolean' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(174,5): error TS2322: Type 'boolean' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(174,22): error TS2304: Cannot find name 'i6'. tests/cases/compiler/intTypeCheck.ts(175,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(180,5): error TS2323: Type '{}' is not assignable to type 'i7'. -tests/cases/compiler/intTypeCheck.ts(181,5): error TS2323: Type 'Object' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(180,5): error TS2322: Type '{}' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(181,5): error TS2322: Type 'Object' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(183,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. -tests/cases/compiler/intTypeCheck.ts(185,5): error TS2323: Type '() => void' is not assignable to type 'i7'. -tests/cases/compiler/intTypeCheck.ts(188,5): error TS2323: Type 'boolean' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(185,5): error TS2322: Type '() => void' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(188,5): error TS2322: Type 'boolean' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(188,22): error TS2304: Cannot find name 'i7'. tests/cases/compiler/intTypeCheck.ts(189,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(195,5): error TS2322: Type 'Object' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(195,5): error TS2322: Type 'Object' is not assignable to type 'i8'. Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(196,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Base' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Base' is not assignable to type 'i8'. Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type '() => void' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type '() => void' is not assignable to type 'i8'. Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(202,5): error TS2322: Type 'boolean' is not assignable to type 'i8': +tests/cases/compiler/intTypeCheck.ts(202,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(202,22): error TS2304: Cannot find name 'i8'. tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -204,19 +204,19 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit }; var obj2: i1 = new Object(); ~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i1': +!!! error TS2322: Type 'Object' is not assignable to type 'i1'. !!! error TS2322: Property 'p' is missing in type 'Object'. var obj3: i1 = new obj0; ~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj4: i1 = new Base; ~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i1': +!!! error TS2322: Type 'Base' is not assignable to type 'i1'. !!! error TS2322: Property 'p' is missing in type 'Base'. var obj5: i1 = null; var obj6: i1 = function () { }; ~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i1': +!!! error TS2322: Type '() => void' is not assignable to type 'i1'. !!! error TS2322: Property 'p' is missing in type '() => void'. //var obj7: i1 = function foo() { }; var obj8: i1 = anyVar; @@ -224,7 +224,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i1': +!!! error TS2322: Type 'boolean' is not assignable to type 'i1'. !!! error TS2322: Property 'p' is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i1'. @@ -237,16 +237,16 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj11: i2; var obj12: i2 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i2'. +!!! error TS2322: Type '{}' is not assignable to type 'i2'. var obj13: i2 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i2'. +!!! error TS2322: Type 'Object' is not assignable to type 'i2'. var obj14: i2 = new obj11; ~~~~~~~~~ !!! error TS2350: Only a void function can be called with the 'new' keyword. var obj15: i2 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i2'. +!!! error TS2322: Type 'Base' is not assignable to type 'i2'. var obj16: i2 = null; var obj17: i2 = function ():any { return 0; }; //var obj18: i2 = function foo() { }; @@ -255,7 +255,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i2'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i2'. ~~ !!! error TS2304: Cannot find name 'i2'. var obj21: i2 = new {}; @@ -267,25 +267,25 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj22: i3; var obj23: i3 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i3'. +!!! error TS2322: Type '{}' is not assignable to type 'i3'. var obj24: i3 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i3'. +!!! error TS2322: Type 'Object' is not assignable to type 'i3'. var obj25: i3 = new obj22; var obj26: i3 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i3'. +!!! error TS2322: Type 'Base' is not assignable to type 'i3'. var obj27: i3 = null; var obj28: i3 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i3'. +!!! error TS2322: Type '() => void' is not assignable to type 'i3'. //var obj29: i3 = function foo() { }; var obj30: i3 = anyVar; var obj31: i3 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i3'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i3'. ~~ !!! error TS2304: Cannot find name 'i3'. var obj32: i3 = new {}; @@ -298,19 +298,19 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj34: i4 = {}; var obj35: i4 = new Object(); ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i4': +!!! error TS2322: Type 'Object' is not assignable to type 'i4'. !!! error TS2322: Index signature is missing in type 'Object'. var obj36: i4 = new obj33; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj37: i4 = new Base; ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i4': +!!! error TS2322: Type 'Base' is not assignable to type 'i4'. !!! error TS2322: Index signature is missing in type 'Base'. var obj38: i4 = null; var obj39: i4 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i4': +!!! error TS2322: Type '() => void' is not assignable to type 'i4'. !!! error TS2322: Index signature is missing in type '() => void'. //var obj40: i4 = function foo() { }; var obj41: i4 = anyVar; @@ -318,7 +318,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i4': +!!! error TS2322: Type 'boolean' is not assignable to type 'i4'. !!! error TS2322: Index signature is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i4'. @@ -331,23 +331,23 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj44: i5; var obj45: i5 = {}; ~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'i5': +!!! error TS2322: Type '{}' is not assignable to type 'i5'. !!! error TS2322: Property 'p' is missing in type '{}'. var obj46: i5 = new Object(); ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i5': +!!! error TS2322: Type 'Object' is not assignable to type 'i5'. !!! error TS2322: Property 'p' is missing in type 'Object'. var obj47: i5 = new obj44; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj48: i5 = new Base; ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i5': +!!! error TS2322: Type 'Base' is not assignable to type 'i5'. !!! error TS2322: Property 'p' is missing in type 'Base'. var obj49: i5 = null; var obj50: i5 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i5': +!!! error TS2322: Type '() => void' is not assignable to type 'i5'. !!! error TS2322: Property 'p' is missing in type '() => void'. //var obj51: i5 = function foo() { }; var obj52: i5 = anyVar; @@ -355,7 +355,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i5': +!!! error TS2322: Type 'boolean' is not assignable to type 'i5'. !!! error TS2322: Property 'p' is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i5'. @@ -368,20 +368,20 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj55: i6; var obj56: i6 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i6'. +!!! error TS2322: Type '{}' is not assignable to type 'i6'. var obj57: i6 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i6'. +!!! error TS2322: Type 'Object' is not assignable to type 'i6'. var obj58: i6 = new obj55; ~~~~~~~~~ !!! error TS2350: Only a void function can be called with the 'new' keyword. var obj59: i6 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i6'. +!!! error TS2322: Type 'Base' is not assignable to type 'i6'. var obj60: i6 = null; var obj61: i6 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i6': +!!! error TS2322: Type '() => void' is not assignable to type 'i6'. !!! error TS2322: Type 'void' is not assignable to type 'number'. //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; @@ -389,7 +389,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i6'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i6'. ~~ !!! error TS2304: Cannot find name 'i6'. var obj65: i6 = new {}; @@ -401,10 +401,10 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj66: i7; var obj67: i7 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i7'. +!!! error TS2322: Type '{}' is not assignable to type 'i7'. var obj68: i7 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i7'. +!!! error TS2322: Type 'Object' is not assignable to type 'i7'. var obj69: i7 = new obj66; var obj70: i7 = new Base; ~~~~~~~~~~~~ @@ -412,14 +412,14 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj71: i7 = null; var obj72: i7 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i7'. +!!! error TS2322: Type '() => void' is not assignable to type 'i7'. //var obj73: i7 = function foo() { }; var obj74: i7 = anyVar; var obj75: i7 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i7'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i7'. ~~ !!! error TS2304: Cannot find name 'i7'. var obj76: i7 = new {}; @@ -432,19 +432,19 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj78: i8 = {}; var obj79: i8 = new Object(); ~~~~~ -!!! error TS2322: Type 'Object' is not assignable to type 'i8': +!!! error TS2322: Type 'Object' is not assignable to type 'i8'. !!! error TS2322: Index signature is missing in type 'Object'. var obj80: i8 = new obj77; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj81: i8 = new Base; ~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'i8': +!!! error TS2322: Type 'Base' is not assignable to type 'i8'. !!! error TS2322: Index signature is missing in type 'Base'. var obj82: i8 = null; var obj83: i8 = function () { }; ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type 'i8': +!!! error TS2322: Type '() => void' is not assignable to type 'i8'. !!! error TS2322: Index signature is missing in type '() => void'. //var obj84: i8 = function foo() { }; var obj85: i8 = anyVar; @@ -452,7 +452,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'i8': +!!! error TS2322: Type 'boolean' is not assignable to type 'i8'. !!! error TS2322: Index signature is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i8'. diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index bd5a7a46f91..35cf2df71ff 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. tests/cases/compiler/interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'. -tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye': - Property 'coleur' is missing in type 'IEye'. -tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]': +tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. +tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. Type 'IEye' is not assignable to type 'IFrenchEye'. @@ -54,12 +53,11 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEy for (var j=z.length=1;j>=0;j--) { eeks[j]=z[j]; // nope: element assignment ~~~~~~~ -!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye': -!!! error TS2322: Property 'coleur' is missing in type 'IEye'. +!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. } eeks=z; // nope: array assignment ~~~~ -!!! error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]': +!!! error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. !!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. return result; } diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt index 3d7fcb86784..1e8cc0c1e68 100644 --- a/tests/baselines/reference/interfaceDeclaration1.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -3,10 +3,10 @@ tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate iden tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'. tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type. -tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2421: Class 'C1' incorrectly implements interface 'I3': +tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'. Property 'prototype' is missing in type 'C1'. tests/cases/compiler/interfaceDeclaration1.ts(41,11): error TS2310: Type 'i8' recursively references itself as a base type. -tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11': +tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'. Named properties 'foo' of types 'i10' and 'i11' are not identical. @@ -57,8 +57,8 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i class C1 implements I3 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I3': -!!! error TS2421: Property 'prototype' is missing in type 'C1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I3'. +!!! error TS2420: Property 'prototype' is missing in type 'C1'. constructor() { var prototype: number = 3; } @@ -79,6 +79,6 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i interface i12 extends i10, i11 { } ~~~ -!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11': +!!! error TS2320: Interface 'i12' cannot simultaneously extend types 'i10' and 'i11'. !!! error TS2320: Named properties 'foo' of types 'i10' and 'i11' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration3.errors.txt b/tests/baselines/reference/interfaceDeclaration3.errors.txt index d58a77b2e12..a9bd1d42647 100644 --- a/tests/baselines/reference/interfaceDeclaration3.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration3.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/interfaceDeclaration3.ts(6,11): error TS2421: Class 'C1' incorrectly implements interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration3.ts(6,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/interfaceDeclaration3.ts(31,11): error TS2421: Class 'C1' incorrectly implements interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration3.ts(31,11): error TS2420: Class 'C1' incorrectly implements interface 'I1'. + Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I2' incorrectly extends interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2430: Interface 'I2' incorrectly extends interface 'I1'. + Types of property 'item' are incompatible. Type 'string' is not assignable to type 'number'. @@ -17,9 +17,9 @@ tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I interface I2 { item:number; } class C1 implements I1 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I1': -!!! error TS2421: Types of property 'item' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Types of property 'item' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public item:number; } class C2 implements I1 { @@ -46,9 +46,9 @@ tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I } class C1 implements I1 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I1': -!!! error TS2421: Types of property 'item' are incompatible: -!!! error TS2421: Type 'number' is not assignable to type 'string'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Types of property 'item' are incompatible. +!!! error TS2420: Type 'number' is not assignable to type 'string'. public item:number; } class C2 implements I1 { @@ -73,7 +73,7 @@ tests/cases/compiler/interfaceDeclaration3.ts(54,11): error TS2429: Interface 'I interface I2 extends I1 { item:string; } ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'I1': -!!! error TS2429: Types of property 'item' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'I1'. +!!! error TS2430: Types of property 'item' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration4.errors.txt b/tests/baselines/reference/interfaceDeclaration4.errors.txt index 7092cda3dc2..520c0c2cadf 100644 --- a/tests/baselines/reference/interfaceDeclaration4.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration4.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected. tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected. -tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2429: Interface 'I3' incorrectly extends interface 'I1': - Types of property 'item' are incompatible: +tests/cases/compiler/interfaceDeclaration4.ts(18,11): error TS2430: Interface 'I3' incorrectly extends interface 'I1'. + Types of property 'item' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2421: Class 'C2' incorrectly implements interface 'I4': +tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2420: Class 'C2' incorrectly implements interface 'I4'. Property 'item' is missing in type 'C2'. -tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2421: Class 'C3' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'item' is missing in type 'C3'. tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'. @@ -30,9 +30,9 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find // Negative Case interface I3 extends Foo.I1 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'I1': -!!! error TS2429: Types of property 'item' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'I1'. +!!! error TS2430: Types of property 'item' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. item:number; } @@ -43,8 +43,8 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find // Err - not implemented item class C2 implements I4 { ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'I4': -!!! error TS2421: Property 'item' is missing in type 'C2'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'I4'. +!!! error TS2420: Property 'item' is missing in type 'C2'. public token: string; } @@ -55,8 +55,8 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find class C3 implements Foo.I1 { } ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'I1': -!!! error TS2421: Property 'item' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is missing in type 'C3'. // Negative case interface Foo.I1 { } diff --git a/tests/baselines/reference/interfaceDeclaration6.errors.txt b/tests/baselines/reference/interfaceDeclaration6.errors.txt index 9cf0606d8bf..ab5ac03a31d 100644 --- a/tests/baselines/reference/interfaceDeclaration6.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2429: Interface 'i3' incorrectly extends interface 'i1': - Types of property 'foo' are incompatible: +tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2430: Interface 'i3' incorrectly extends interface 'i1'. + Types of property 'foo' are incompatible. Type 'string' is not assignable to type 'number'. @@ -8,9 +8,9 @@ tests/cases/compiler/interfaceDeclaration6.ts(3,11): error TS2429: Interface 'i3 interface i2 extends i1 { foo: number; }; interface i3 extends i1 { foo: string; }; ~~ -!!! error TS2429: Interface 'i3' incorrectly extends interface 'i1': -!!! error TS2429: Types of property 'foo' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'i3' incorrectly extends interface 'i1'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. interface i4 { bar():any; bar():any; diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt index 93d8b7cfa57..d80df216c79 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2429: Interface 'I' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'. Property 'x' is private in type 'Foo' but not in type 'I'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates.ts(15,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'. @@ -10,8 +10,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I extends Foo { // error ~ -!!! error TS2429: Interface 'I' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is private in type 'Foo' but not in type 'I'. +!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt index f17a1ef3485..c9be8471e8c 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. Named properties 'x' of types 'Foo' and 'Bar' are not identical. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. Property 'x' is private in type 'Bar' but not in type 'I4'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. Property 'x' is private in type 'Foo' but not in type 'I4'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(26,10): error TS2341: Property 'x' is private and only accessible within class 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithPrivates2.ts(27,10): error TS2341: Property 'y' is private and only accessible within class 'Baz'. @@ -19,17 +19,17 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I3 extends Foo, Bar { // error ~~ -!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. !!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical. } interface I4 extends Foo, Bar { // error ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Bar': -!!! error TS2429: Property 'x' is private in type 'Bar' but not in type 'I4'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. +!!! error TS2430: Property 'x' is private in type 'Bar' but not in type 'I4'. ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is private in type 'Foo' but not in type 'I4'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is private in type 'Foo' but not in type 'I4'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt index 1cbc921e1ac..05651c92976 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(5,11): error TS2429: Interface 'I' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(5,11): error TS2430: Interface 'I' incorrectly extends interface 'Foo'. Property 'x' is protected but type 'I' is not a class derived from 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts(15,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. @@ -10,8 +10,8 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I extends Foo { // error ~ -!!! error TS2429: Interface 'I' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is protected but type 'I' is not a class derived from 'Foo'. +!!! error TS2430: Interface 'I' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is protected but type 'I' is not a class derived from 'Foo'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt index 4e5b6364010..a63dfd6efca 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClassWithProtecteds2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(9,11): error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. Named properties 'x' of types 'Foo' and 'Bar' are not identical. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Bar': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2429: Interface 'I4' incorrectly extends interface 'Foo': +tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(12,11): error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(26,10): error TS2445: Property 'x' is protected and only accessible within class 'Foo' and its subclasses. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts(27,10): error TS2445: Property 'y' is protected and only accessible within class 'Baz' and its subclasses. @@ -19,17 +19,17 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending interface I3 extends Foo, Bar { // error ~~ -!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar': +!!! error TS2320: Interface 'I3' cannot simultaneously extend types 'Foo' and 'Bar'. !!! error TS2320: Named properties 'x' of types 'Foo' and 'Bar' are not identical. } interface I4 extends Foo, Bar { // error ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Bar': -!!! error TS2429: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Bar'. +!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Bar'. ~~ -!!! error TS2429: Interface 'I4' incorrectly extends interface 'Foo': -!!! error TS2429: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. +!!! error TS2430: Interface 'I4' incorrectly extends interface 'Foo'. +!!! error TS2430: Property 'x' is protected but type 'I4' is not a class derived from 'Foo'. x: string; } diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt index 919bdaea17d..f624560b7c0 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2322: Type 'C' is not assignable to type 'I': +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2322: Type 'C' is not assignable to type 'I'. Property 'other' is missing in type 'C'. -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2322: Type 'I' is not assignable to type 'D': +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2322: Type 'I' is not assignable to type 'D'. Property 'bar' is missing in type 'I'. -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: Type 'C' is not assignable to type 'D': +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: Type 'C' is not assignable to type 'D'. Property 'other' is missing in type 'C'. @@ -29,17 +29,17 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: T c = i; i = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'I': +!!! error TS2322: Type 'C' is not assignable to type 'I'. !!! error TS2322: Property 'other' is missing in type 'C'. i = d; d = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'D': +!!! error TS2322: Type 'I' is not assignable to type 'D'. !!! error TS2322: Property 'bar' is missing in type 'I'. c = d; d = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'D': +!!! error TS2322: Type 'C' is not assignable to type 'D'. !!! error TS2322: Property 'other' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt index a965d7003bb..035fe89cd35 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2416: Class 'D' incorrectly extends base class 'C': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2415: Class 'D' incorrectly extends base class 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2421: Class 'D' incorrectly implements interface 'I': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(10,7): error TS2420: Class 'D' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2416: Class 'D2' incorrectly extends base class 'C': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2415: Class 'D2' incorrectly extends base class 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: Class 'D2' incorrectly implements interface 'I': +tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2420: Class 'D2' incorrectly implements interface 'I'. Types have separate declarations of a private property 'x'. @@ -20,11 +20,11 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: C class D extends C implements I { // error ~ -!!! error TS2416: Class 'D' incorrectly extends base class 'C': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'D' incorrectly extends base class 'C'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x; } private x = 2; private y = 3; @@ -34,11 +34,11 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate2.ts(18,7): error TS2421: C class D2 extends C implements I { // error ~~ -!!! error TS2416: Class 'D2' incorrectly extends base class 'C': -!!! error TS2416: Types have separate declarations of a private property 'x'. +!!! error TS2415: Class 'D2' incorrectly extends base class 'C'. +!!! error TS2415: Types have separate declarations of a private property 'x'. ~~ -!!! error TS2421: Class 'D2' incorrectly implements interface 'I': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D2' incorrectly implements interface 'I'. +!!! error TS2420: Types have separate declarations of a private property 'x'. public foo(x: any) { return x; } private x = ""; other(x: any) { return x; } diff --git a/tests/baselines/reference/interfaceImplementation1.errors.txt b/tests/baselines/reference/interfaceImplementation1.errors.txt index 59a81e66957..45b011c6929 100644 --- a/tests/baselines/reference/interfaceImplementation1.errors.txt +++ b/tests/baselines/reference/interfaceImplementation1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2421: Class 'C1' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I1'. Property 'iObj' is private in type 'C1' but not in type 'I1'. -tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2421: Class 'C1' incorrectly implements interface 'I2': +tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'iFn' is private in type 'C1' but not in type 'I2'. -tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() => C2' is not assignable to type 'I4'. +tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() => C2' is not assignable to type 'I4'. ==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ==== @@ -19,11 +19,11 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() = class C1 implements I1,I2 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iObj' is private in type 'C1' but not in type 'I1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iObj' is private in type 'C1' but not in type 'I1'. ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I2': -!!! error TS2421: Property 'iFn' is private in type 'C1' but not in type 'I2'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I2'. +!!! error TS2420: Property 'iFn' is private in type 'C1' but not in type 'I2'. private iFn(); private iFn(n?:number, s?:string) { } private iAny:any; @@ -47,7 +47,7 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() = var a:I4 = function(){ ~ -!!! error TS2323: Type '() => C2' is not assignable to type 'I4'. +!!! error TS2322: Type '() => C2' is not assignable to type 'I4'. return new C2(); } new a(); diff --git a/tests/baselines/reference/interfaceImplementation2.errors.txt b/tests/baselines/reference/interfaceImplementation2.errors.txt index d723549d8be..eedc3a4f746 100644 --- a/tests/baselines/reference/interfaceImplementation2.errors.txt +++ b/tests/baselines/reference/interfaceImplementation2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2421: Class 'C3' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'iFn' is missing in type 'C3'. @@ -12,8 +12,8 @@ tests/cases/compiler/interfaceImplementation2.ts(8,7): error TS2421: Class 'C3' class C3 implements I1 { ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iFn' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iFn' is missing in type 'C3'. public iObj:{ }; public iNum:number; public iAny:any; diff --git a/tests/baselines/reference/interfaceImplementation3.errors.txt b/tests/baselines/reference/interfaceImplementation3.errors.txt index 1e5073ac2ee..06baf5d5915 100644 --- a/tests/baselines/reference/interfaceImplementation3.errors.txt +++ b/tests/baselines/reference/interfaceImplementation3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2421: Class 'C4' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2420: Class 'C4' incorrectly implements interface 'I1'. Property 'iAny' is missing in type 'C4'. @@ -12,8 +12,8 @@ tests/cases/compiler/interfaceImplementation3.ts(8,7): error TS2421: Class 'C4' class C4 implements I1 { ~~ -!!! error TS2421: Class 'C4' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iAny' is missing in type 'C4'. +!!! error TS2420: Class 'C4' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iAny' is missing in type 'C4'. public iObj:{ }; public iNum:number; public iFn() { } diff --git a/tests/baselines/reference/interfaceImplementation4.errors.txt b/tests/baselines/reference/interfaceImplementation4.errors.txt index 8a08026b0bb..f50aa4ade97 100644 --- a/tests/baselines/reference/interfaceImplementation4.errors.txt +++ b/tests/baselines/reference/interfaceImplementation4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2421: Class 'C5' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2420: Class 'C5' incorrectly implements interface 'I1'. Property 'iObj' is missing in type 'C5'. @@ -12,8 +12,8 @@ tests/cases/compiler/interfaceImplementation4.ts(8,7): error TS2421: Class 'C5' class C5 implements I1 { ~~ -!!! error TS2421: Class 'C5' incorrectly implements interface 'I1': -!!! error TS2421: Property 'iObj' is missing in type 'C5'. +!!! error TS2420: Class 'C5' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'iObj' is missing in type 'C5'. public iNum:number; public iAny:any; public iFn() { } diff --git a/tests/baselines/reference/interfaceImplementation6.errors.txt b/tests/baselines/reference/interfaceImplementation6.errors.txt index 0965a1c6019..c4c0dcba8ae 100644 --- a/tests/baselines/reference/interfaceImplementation6.errors.txt +++ b/tests/baselines/reference/interfaceImplementation6.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2421: Class 'C2' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation6.ts(9,7): error TS2420: Class 'C2' incorrectly implements interface 'I1'. Property 'item' is private in type 'C2' but not in type 'I1'. -tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2421: Class 'C3' incorrectly implements interface 'I1': +tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'. Property 'item' is missing in type 'C3'. @@ -15,15 +15,15 @@ tests/cases/compiler/interfaceImplementation6.ts(13,7): error TS2421: Class 'C3' class C2 implements I1 { ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'I1': -!!! error TS2421: Property 'item' is private in type 'C2' but not in type 'I1'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is private in type 'C2' but not in type 'I1'. private item:number; } class C3 implements I1 { ~~ -!!! error TS2421: Class 'C3' incorrectly implements interface 'I1': -!!! error TS2421: Property 'item' is missing in type 'C3'. +!!! error TS2420: Class 'C3' incorrectly implements interface 'I1'. +!!! error TS2420: Property 'item' is missing in type 'C3'. constructor() { var item: number; } diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index 9e04892215d..ff1118e5c69 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2': +tests/cases/compiler/interfaceImplementation7.ts(4,11): error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'. Named properties 'name' of types 'i1' and 'i2' are not identical. -tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2421: Class 'C1' incorrectly implements interface 'i4': - Types of property 'name' are incompatible: - Type '() => string' is not assignable to type '() => { s: string; n: number; }': - Type 'string' is not assignable to type '{ s: string; n: number; }': +tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' incorrectly implements interface 'i4'. + Types of property 'name' are incompatible. + Type '() => string' is not assignable to type '() => { s: string; n: number; }'. + Type 'string' is not assignable to type '{ s: string; n: number; }'. Property 's' is missing in type 'String'. @@ -13,17 +13,17 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2421: Class 'C1' interface i3 extends i1, i2 { } ~~ -!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2': +!!! error TS2320: Interface 'i3' cannot simultaneously extend types 'i1' and 'i2'. !!! error TS2320: Named properties 'name' of types 'i1' and 'i2' are not identical. interface i4 extends i1, i2 { name(): { s: string; n: number; }; } class C1 implements i4 { ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'i4': -!!! error TS2421: Types of property 'name' are incompatible: -!!! error TS2421: Type '() => string' is not assignable to type '() => { s: string; n: number; }': -!!! error TS2421: Type 'string' is not assignable to type '{ s: string; n: number; }': -!!! error TS2421: Property 's' is missing in type 'String'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'i4'. +!!! error TS2420: Types of property 'name' are incompatible. +!!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'. +!!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. +!!! error TS2420: Property 's' is missing in type 'String'. public name(): string { return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation8.errors.txt b/tests/baselines/reference/interfaceImplementation8.errors.txt index 4d0d06042a1..6b4b8f4a4fa 100644 --- a/tests/baselines/reference/interfaceImplementation8.errors.txt +++ b/tests/baselines/reference/interfaceImplementation8.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2421: Class 'C2' incorrectly implements interface 'i1': +tests/cases/compiler/interfaceImplementation8.ts(12,7): error TS2420: Class 'C2' incorrectly implements interface 'i1'. Property 'name' is private in type 'C2' but not in type 'i1'. -tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2421: Class 'C5' incorrectly implements interface 'i1': +tests/cases/compiler/interfaceImplementation8.ts(21,7): error TS2420: Class 'C5' incorrectly implements interface 'i1'. Property 'name' is private in type 'C5' but not in type 'i1'. -tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' incorrectly implements interface 'i1': +tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2420: Class 'C6' incorrectly implements interface 'i1'. Property 'name' is private in type 'C6' but not in type 'i1'. @@ -20,8 +20,8 @@ tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' class C2 implements i1 { ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'C2' but not in type 'i1'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C2' but not in type 'i1'. private name:string; } @@ -32,12 +32,12 @@ tests/cases/compiler/interfaceImplementation8.ts(22,7): error TS2421: Class 'C6' class C4 extends C1 implements i1{ } class C5 extends C2 implements i1{ } ~~ -!!! error TS2421: Class 'C5' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'C5' but not in type 'i1'. +!!! error TS2420: Class 'C5' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C5' but not in type 'i1'. class C6 extends C3 implements i1{ } ~~ -!!! error TS2421: Class 'C6' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'C6' but not in type 'i1'. +!!! error TS2420: Class 'C6' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'C6' but not in type 'i1'. /* 2 diff --git a/tests/baselines/reference/interfaceInheritance.errors.txt b/tests/baselines/reference/interfaceInheritance.errors.txt index e192d0fa2e9..c96053b8a84 100644 --- a/tests/baselines/reference/interfaceInheritance.errors.txt +++ b/tests/baselines/reference/interfaceInheritance.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/interfaceInheritance.ts(22,7): error TS2421: Class 'C1' incorrectly implements interface 'I2': +tests/cases/compiler/interfaceInheritance.ts(22,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'i1P1' is missing in type 'C1'. -tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2322: Type 'I3' is not assignable to type 'I2': +tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2322: Type 'I3' is not assignable to type 'I2'. Property 'i1P1' is missing in type 'I3'. -tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2322: Type 'I5' is not assignable to type 'I4': - Types of property 'one' are incompatible: +tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2322: Type 'I5' is not assignable to type 'I4'. + Types of property 'one' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is not assignable to type 'I5': - Types of property 'one' are incompatible: +tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is not assignable to type 'I5'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -34,8 +34,8 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is n class C1 implements I2 { // should be an error - it doesn't implement the members of I1 ~~ -!!! error TS2421: Class 'C1' incorrectly implements interface 'I2': -!!! error TS2421: Property 'i1P1' is missing in type 'C1'. +!!! error TS2420: Class 'C1' incorrectly implements interface 'I2'. +!!! error TS2420: Property 'i1P1' is missing in type 'C1'. public i2P1: string; } @@ -45,7 +45,7 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is n i1 = i2; i2 = i3; // should be an error - i3 does not implement the members of i1 ~~ -!!! error TS2322: Type 'I3' is not assignable to type 'I2': +!!! error TS2322: Type 'I3' is not assignable to type 'I2'. !!! error TS2322: Property 'i1P1' is missing in type 'I3'. var c1: C1; @@ -55,13 +55,13 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is n i4 = i5; // should be an error ~~ -!!! error TS2322: Type 'I5' is not assignable to type 'I4': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'I5' is not assignable to type 'I4'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. i5 = i4; // should be an error ~~ -!!! error TS2322: Type 'I4' is not assignable to type 'I5': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'I4' is not assignable to type 'I5'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceMemberValidation.errors.txt b/tests/baselines/reference/interfaceMemberValidation.errors.txt index ed8b119bbdd..3b2b1d1874c 100644 --- a/tests/baselines/reference/interfaceMemberValidation.errors.txt +++ b/tests/baselines/reference/interfaceMemberValidation.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/interfaceMemberValidation.ts(2,11): error TS2429: Interface 'i2' incorrectly extends interface 'i1': - Types of property 'name' are incompatible: +tests/cases/compiler/interfaceMemberValidation.ts(2,11): error TS2430: Interface 'i2' incorrectly extends interface 'i1'. + Types of property 'name' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/compiler/interfaceMemberValidation.ts(5,2): error TS2411: Property 'bar' of type '{ (): any; (): any; }' is not assignable to string index type 'number'. tests/cases/compiler/interfaceMemberValidation.ts(10,2): error TS2374: Duplicate string index signature. @@ -9,9 +9,9 @@ tests/cases/compiler/interfaceMemberValidation.ts(10,2): error TS2374: Duplicate interface i1 { name: string; } interface i2 extends i1 { name: number; yo: string; } ~~ -!!! error TS2429: Interface 'i2' incorrectly extends interface 'i1': -!!! error TS2429: Types of property 'name' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'i2' incorrectly extends interface 'i1'. +!!! error TS2430: Types of property 'name' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. interface foo { bar():any; diff --git a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt index 82d4a755d2a..a7df9c15e59 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker': +tests/cases/compiler/interfacePropertiesWithSameName2.ts(10,11): error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. -tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker': +tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. @@ -16,7 +16,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I interface MoverShaker extends Mover, Shaker { ~~~~~~~~~~~ -!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker': +!!! error TS2320: Interface 'MoverShaker' cannot simultaneously extend types 'Mover' and 'Shaker'. !!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. } @@ -35,7 +35,7 @@ tests/cases/compiler/interfacePropertiesWithSameName2.ts(26,11): error TS2320: I interface MoverShaker2 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { } // error ~~~~~~~~~~~~ -!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker': +!!! error TS2320: Interface 'MoverShaker2' cannot simultaneously extend types 'Mover' and 'Shaker'. !!! error TS2320: Named properties 'getStatus' of types 'Mover' and 'Shaker' are not identical. interface MoverShaker3 extends MoversAndShakers.Mover, MoversAndShakers.Shaker { diff --git a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt index 136a2460b5e..b7dfdffc79e 100644 --- a/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt +++ b/tests/baselines/reference/interfacePropertiesWithSameName3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D': +tests/cases/compiler/interfacePropertiesWithSameName3.ts(3,11): error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'. Named properties 'a' of types 'E' and 'D' are not identical. -tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2': +tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'. Named properties 'a' of types 'E2' and 'D2' are not identical. @@ -9,13 +9,13 @@ tests/cases/compiler/interfacePropertiesWithSameName3.ts(7,11): error TS2320: In interface E { a: string; } interface F extends E, D { } // error ~ -!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D': +!!! error TS2320: Interface 'F' cannot simultaneously extend types 'E' and 'D'. !!! error TS2320: Named properties 'a' of types 'E' and 'D' are not identical. class D2 { a: number; } class E2 { a: string; } interface F2 extends E2, D2 { } // error ~~ -!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2': +!!! error TS2320: Interface 'F2' cannot simultaneously extend types 'E2' and 'D2'. !!! error TS2320: Named properties 'a' of types 'E2' and 'D2' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt index dafff4336ba..f66e13c0d9d 100644 --- a/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts(5,11): error TS2429: Interface 'Derived' incorrectly extends interface 'Base': - Types of property 'x' are incompatible: - Type '{ a: string; }' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty2.ts(5,11): error TS2430: Interface 'Derived' incorrectly extends interface 'Base'. + Types of property 'x' are incompatible. + Type '{ a: string; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. @@ -12,11 +12,11 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseP interface Derived extends Base { // error ~~~~~~~ -!!! error TS2429: Interface 'Derived' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: string; }' is not assignable to type '{ a: number; }': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. x: { a: string; }; diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt index 85351b191ec..1562e16df4d 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes.errors.txt @@ -1,27 +1,27 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(21,11): error TS2429: Interface 'Derived2' incorrectly extends interface 'Base2': - Types of property 'x' are incompatible: - Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }': - Types of property 'b' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(21,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }'. + Types of property 'b' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(52,15): error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. Named properties 'x' of types 'Base1' and 'Base2' are not identical. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2429: Interface 'Derived4' incorrectly extends interface 'Base1': - Types of property 'x' are incompatible: - Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }': - Types of property 'a' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. + Types of property 'x' are incompatible. + Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'. + Types of property 'a' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2429: Interface 'Derived4' incorrectly extends interface 'Base2': - Types of property 'x' are incompatible: - Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }': - Types of property 'b' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(54,15): error TS2430: Interface 'Derived4' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }'. + Types of property 'b' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2429: Interface 'Derived5' incorrectly extends interface 'Base1': - Types of property 'x' are incompatible: - Type 'T' is not assignable to type '{ a: T; }': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' incorrectly extends interface 'Base1'. + Types of property 'x' are incompatible. + Type 'T' is not assignable to type '{ a: T; }'. Property 'a' is missing in type '{}'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2429: Interface 'Derived5' incorrectly extends interface 'Base2': - Types of property 'x' are incompatible: - Type 'T' is not assignable to type '{ b: T; }': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes.ts(60,15): error TS2430: Interface 'Derived5' incorrectly extends interface 'Base2'. + Types of property 'x' are incompatible. + Type 'T' is not assignable to type '{ b: T; }'. Property 'b' is missing in type '{}'. @@ -48,11 +48,11 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived2 extends Base1, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }': -!!! error TS2429: Types of property 'b' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: string; b: number; }' is not assignable to type '{ b: string; }'. +!!! error TS2430: Types of property 'b' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. x: { a: string; b: number; } @@ -85,22 +85,22 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived3 extends Base1, Base2 { } // error ~~~~~~~~ -!!! error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2': +!!! error TS2320: Interface 'Derived3' cannot simultaneously extend types 'Base1' and 'Base2'. !!! error TS2320: Named properties 'x' of types 'Base1' and 'Base2' are not identical. interface Derived4 extends Base1, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived4' incorrectly extends interface 'Base1': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived4' incorrectly extends interface 'Base1'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ a: number; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. ~~~~~~~~ -!!! error TS2429: Interface 'Derived4' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }': -!!! error TS2429: Types of property 'b' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type 'number'. +!!! error TS2430: Interface 'Derived4' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: T; b: T; }' is not assignable to type '{ b: number; }'. +!!! error TS2430: Types of property 'b' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type 'number'. x: { a: T; b: T; } @@ -108,15 +108,15 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived5 extends Base1, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived5' incorrectly extends interface 'Base1': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type '{ a: T; }': -!!! error TS2429: Property 'a' is missing in type '{}'. +!!! error TS2430: Interface 'Derived5' incorrectly extends interface 'Base1'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type '{ a: T; }'. +!!! error TS2430: Property 'a' is missing in type '{}'. ~~~~~~~~ -!!! error TS2429: Interface 'Derived5' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type 'T' is not assignable to type '{ b: T; }': -!!! error TS2429: Property 'b' is missing in type '{}'. +!!! error TS2430: Interface 'Derived5' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type 'T' is not assignable to type '{ b: T; }'. +!!! error TS2430: Property 'b' is missing in type '{}'. x: T; } } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt index 9d60afede0a..b3459233923 100644 --- a/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2429: Interface 'Derived2' incorrectly extends interface 'Base': - Types of property 'x' are incompatible: - Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }': - Types of property 'a' are incompatible: +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'. + Types of property 'x' are incompatible. + Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'. + Types of property 'a' are incompatible. Type 'number' is not assignable to type 'string'. @@ -24,11 +24,11 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBa interface Derived2 extends Base, Base2 { // error ~~~~~~~~ -!!! error TS2429: Interface 'Derived2' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'x' are incompatible: -!!! error TS2429: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'x' are incompatible. +!!! error TS2430: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. x: { a: number; b: string } } diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt index 60c917d0fbc..79cbd0e6b4e 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(5,11): error TS2429: Interface 'Foo' incorrectly extends interface 'Base': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(5,11): error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. Property 'x' is private in type 'Base' but not in type 'Foo'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(13,11): error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType.ts(13,11): error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. Property 'x' is private in type 'Base2' but not in type 'Foo2'. @@ -11,8 +11,8 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo extends Base { // error ~~~ -!!! error TS2429: Interface 'Foo' incorrectly extends interface 'Base': -!!! error TS2429: Property 'x' is private in type 'Base' but not in type 'Foo'. +!!! error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. +!!! error TS2430: Property 'x' is private in type 'Base' but not in type 'Foo'. x: number; } @@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo2 extends Base2 { // error ~~~~ -!!! error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': -!!! error TS2429: Property 'x' is private in type 'Base2' but not in type 'Foo2'. +!!! error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. +!!! error TS2430: Property 'x' is private in type 'Base2' but not in type 'Foo2'. x: number; } \ No newline at end of file diff --git a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt index 4ee4bf8709f..3a31d7dfcbd 100644 --- a/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt +++ b/tests/baselines/reference/interfaceWithPropertyThatIsPrivateInBaseType2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(5,11): error TS2429: Interface 'Foo' incorrectly extends interface 'Base': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(5,11): error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. Property 'x' is private in type 'Base' but not in type 'Foo'. -tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(13,11): error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': +tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyThatIsPrivateInBaseType2.ts(13,11): error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. Property 'x' is private in type 'Base2' but not in type 'Foo2'. @@ -11,8 +11,8 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo extends Base { // error ~~~ -!!! error TS2429: Interface 'Foo' incorrectly extends interface 'Base': -!!! error TS2429: Property 'x' is private in type 'Base' but not in type 'Foo'. +!!! error TS2430: Interface 'Foo' incorrectly extends interface 'Base'. +!!! error TS2430: Property 'x' is private in type 'Base' but not in type 'Foo'. x(): any; } @@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyTh interface Foo2 extends Base2 { // error ~~~~ -!!! error TS2429: Interface 'Foo2' incorrectly extends interface 'Base2': -!!! error TS2429: Property 'x' is private in type 'Base2' but not in type 'Foo2'. +!!! error TS2430: Interface 'Foo2' incorrectly extends interface 'Base2'. +!!! error TS2430: Property 'x' is private in type 'Base2' but not in type 'Foo2'. x(): any; } \ No newline at end of file diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt index 2d800b4befd..3ac4f122e58 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -1,55 +1,55 @@ -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2323: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2323: Type '{}' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2323: Type 'typeof C' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2323: Type 'C' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(14,1): error TS2323: Type 'I' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(17,1): error TS2323: Type 'typeof M' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(20,5): error TS2323: Type 'T' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): error TS2323: Type '(a: T) => void' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2322: Type '{}' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2322: Type 'typeof C' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2322: Type 'C' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(14,1): error TS2322: Type 'I' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(17,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(20,5): error TS2322: Type 'T' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts (10 errors) ==== var x: void; x = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. x = true; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. x = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. x = {} ~ -!!! error TS2323: Type '{}' is not assignable to type 'void'. +!!! error TS2322: Type '{}' is not assignable to type 'void'. class C { foo: string; } var c: C; x = C; ~ -!!! error TS2323: Type 'typeof C' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof C' is not assignable to type 'void'. x = c; ~ -!!! error TS2323: Type 'C' is not assignable to type 'void'. +!!! error TS2322: Type 'C' is not assignable to type 'void'. interface I { foo: string; } var i: I; x = i; ~ -!!! error TS2323: Type 'I' is not assignable to type 'void'. +!!! error TS2322: Type 'I' is not assignable to type 'void'. module M { export var x = 1; } x = M; ~ -!!! error TS2323: Type 'typeof M' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof M' is not assignable to type 'void'. function f(a: T) { x = a; ~ -!!! error TS2323: Type 'T' is not assignable to type 'void'. +!!! error TS2322: Type 'T' is not assignable to type 'void'. } x = f; ~ -!!! error TS2323: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index d7642fa4ace..84ced226113 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2323: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2323: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2323: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2323: Type 'boolean' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C': +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'boolean' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. Property 'foo' is missing in type 'Boolean'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I': +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. Property 'bar' is missing in type 'Boolean'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2323: Type 'boolean' is not assignable to type '() => string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2323: Type 'boolean' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. @@ -17,35 +17,35 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var a: number = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var b: string = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. var c: void = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. var d: typeof undefined = x; enum E { A } var e: E = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'E'. +!!! error TS2322: Type 'boolean' is not assignable to type 'E'. class C { foo: string } var f: C = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'C': +!!! error TS2322: Type 'boolean' is not assignable to type 'C'. !!! error TS2322: Property 'foo' is missing in type 'Boolean'. interface I { bar: string } var g: I = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'I': +!!! error TS2322: Type 'boolean' is not assignable to type 'I'. !!! error TS2322: Property 'bar' is missing in type 'Boolean'. var h: { (): string } = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'boolean' is not assignable to type '() => string'. var h2: { toString(): string } = x; // no error module M { export var a = 1; } @@ -56,7 +56,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 function i(a: T) { a = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'T'. +!!! error TS2322: Type 'boolean' is not assignable to type 'T'. } i = x; ~ diff --git a/tests/baselines/reference/invalidEnumAssignments.errors.txt b/tests/baselines/reference/invalidEnumAssignments.errors.txt index 6e9c46d4239..962e4bf62d5 100644 --- a/tests/baselines/reference/invalidEnumAssignments.errors.txt +++ b/tests/baselines/reference/invalidEnumAssignments.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2323: Type 'E2' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2323: Type 'E' is not assignable to type 'E2'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2323: Type 'void' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2323: Type '{}' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2323: Type 'string' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2323: Type 'T' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E' is not assignable to type 'E2'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2322: Type 'void' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2322: Type '{}' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2322: Type 'T' is not assignable to type 'E'. ==== tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts (6 errors) ==== @@ -22,22 +22,22 @@ tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): e e = E2.A; ~ -!!! error TS2323: Type 'E2' is not assignable to type 'E'. +!!! error TS2322: Type 'E2' is not assignable to type 'E'. e2 = E.A; ~~ -!!! error TS2323: Type 'E' is not assignable to type 'E2'. +!!! error TS2322: Type 'E' is not assignable to type 'E2'. e = null; ~ -!!! error TS2323: Type 'void' is not assignable to type 'E'. +!!! error TS2322: Type 'void' is not assignable to type 'E'. e = {}; ~ -!!! error TS2323: Type '{}' is not assignable to type 'E'. +!!! error TS2322: Type '{}' is not assignable to type 'E'. e = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type 'string' is not assignable to type 'E'. function f(a: T) { e = a; ~ -!!! error TS2323: Type 'T' is not assignable to type 'E'. +!!! error TS2322: Type 'T' is not assignable to type 'E'. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index 641e02683e6..7eb5e6cb897 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5): error TS2323: Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. Property 'bar' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2323: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -19,34 +19,34 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 var a: boolean = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. var b: string = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var c: void = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! error TS2322: Type 'number' is not assignable to type 'C': +!!! error TS2322: Type 'number' is not assignable to type 'C'. !!! error TS2322: Property 'foo' is missing in type 'Number'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I': +!!! error TS2322: Type 'number' is not assignable to type 'I'. !!! error TS2322: Property 'bar' is missing in type 'Number'. var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. !!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. !!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } @@ -57,7 +57,7 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 function i(a: T) { a = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. } i = x; ~ diff --git a/tests/baselines/reference/invalidReturnStatements.errors.txt b/tests/baselines/reference/invalidReturnStatements.errors.txt index ed15e4543aa..780166e07c2 100644 --- a/tests/baselines/reference/invalidReturnStatements.errors.txt +++ b/tests/baselines/reference/invalidReturnStatements.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(2 tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(4,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(5,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2322: Type '{ id: number; }' is not assignable to type 'D': +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2322: Type '{ id: number; }' is not assignable to type 'D'. Property 'name' is missing in type '{ id: number; }'. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2322: Type 'C' is not assignable to type 'D': +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2322: Type 'C' is not assignable to type 'D'. Property 'name' is missing in type 'C'. @@ -34,12 +34,12 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(1 } function fn10(): D { return { id: 12 }; } ~~~~~~~~~~ -!!! error TS2322: Type '{ id: number; }' is not assignable to type 'D': +!!! error TS2322: Type '{ id: number; }' is not assignable to type 'D'. !!! error TS2322: Property 'name' is missing in type '{ id: number; }'. function fn11(): D { return new C(); } ~~~~~~~ -!!! error TS2322: Type 'C' is not assignable to type 'D': +!!! error TS2322: Type 'C' is not assignable to type 'D'. !!! error TS2322: Property 'name' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index eca680b23cd..e67106bef92 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5): error TS2323: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2323: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2323: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable to type 'E'. ==== tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts (11 errors) ==== @@ -20,34 +20,34 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 var a: boolean = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. var b: number = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var c: void = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! error TS2322: Type 'string' is not assignable to type 'C': +!!! error TS2322: Type 'string' is not assignable to type 'C'. !!! error TS2322: Property 'foo' is missing in type 'String'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2322: Type 'string' is not assignable to type 'I': +!!! error TS2322: Type 'string' is not assignable to type 'I'. !!! error TS2322: Property 'bar' is missing in type 'String'. var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. !!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. !!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } @@ -58,7 +58,7 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 function i(a: T) { a = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } i = x; ~ @@ -67,4 +67,4 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 enum E { A } var j: E = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'E'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'E'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 4ec170717b9..64decc2f5e2 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(3,5): error TS2323: Type 'void' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): error TS2323: Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2323: Type 'void' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2323: Type 'void' is not assignable to type 'C'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2323: Type 'void' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(3,5): error TS2322: Type 'void' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): error TS2322: Type 'void' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2322: Type 'void' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2323: Type 'void' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2323: Type 'typeof E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2323: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts (13 errors) ==== @@ -20,32 +20,32 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var a: boolean = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'boolean'. +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. var b: string = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. var c: number = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'C'. +!!! error TS2322: Type 'void' is not assignable to type 'C'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'I'. +!!! error TS2322: Type 'void' is not assignable to type 'I'. var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }': +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. !!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. !!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } @@ -56,7 +56,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e function i(a: T) { a = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'T'. +!!! error TS2322: Type 'void' is not assignable to type 'T'. } i = x; ~ @@ -65,11 +65,11 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e enum E { A } x = E; ~ -!!! error TS2323: Type 'typeof E' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof E' is not assignable to type 'void'. x = E.A; ~ -!!! error TS2323: Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. x = { f() { } } ~ -!!! error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt index db20d7d7fcc..b8a4400e4e0 100644 --- a/tests/baselines/reference/invalidVoidValues.errors.txt +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -1,62 +1,62 @@ -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2323: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2323: Type 'typeof E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2323: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2323: Type 'C' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2323: Type 'I' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2323: Type 'typeof M' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2323: Type 'T' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error TS2323: Type '(a: T) => void' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2322: Type 'I' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2322: Type 'T' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidVoidValues.ts (11 errors) ==== var x: void; x = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. x = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. x = true; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. enum E { A } x = E; ~ -!!! error TS2323: Type 'typeof E' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof E' is not assignable to type 'void'. x = E.A; ~ -!!! error TS2323: Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. class C { foo: string } var a: C; x = a; ~ -!!! error TS2323: Type 'C' is not assignable to type 'void'. +!!! error TS2322: Type 'C' is not assignable to type 'void'. interface I { foo: string } var b: I; x = b; ~ -!!! error TS2323: Type 'I' is not assignable to type 'void'. +!!! error TS2322: Type 'I' is not assignable to type 'void'. x = { f() {} } ~ -!!! error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. +!!! error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. module M { export var x = 1; } x = M; ~ -!!! error TS2323: Type 'typeof M' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof M' is not assignable to type 'void'. function f(a: T) { x = a; ~ -!!! error TS2323: Type 'T' is not assignable to type 'void'. +!!! error TS2322: Type 'T' is not assignable to type 'void'. } x = f; ~ -!!! error TS2323: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt index 39e5cfaa834..4bf5521d24d 100644 --- a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt +++ b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt @@ -1,10 +1,8 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(8,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(9,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(12,6): error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. - Types of property 'thunk' are incompatible: - Type '(num: number) => void' is not assignable to type '(str: string) => void': - Types of parameters 'num' and 'str' are incompatible: - Type 'number' is not assignable to type 'string'. + Types of property 'thunk' are incompatible. + Type '(num: number) => void' is not assignable to type '(str: string) => void'. tests/cases/compiler/lastPropertyInLiteralWins.ts(13,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate identifier 'thunk'. @@ -38,8 +36,6 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate }); ~ !!! error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. -!!! error TS2345: Types of property 'thunk' are incompatible: -!!! error TS2345: Type '(num: number) => void' is not assignable to type '(str: string) => void': -!!! error TS2345: Types of parameters 'num' and 'str' are incompatible: -!!! error TS2345: Type 'number' is not assignable to type 'string'. +!!! error TS2345: Types of property 'thunk' are incompatible. +!!! error TS2345: Type '(num: number) => void' is not assignable to type '(str: string) => void'. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.js b/tests/baselines/reference/logicalNotOperatorWithEnumType.js index 69ea283051d..89ee1a14833 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.js +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.js @@ -37,11 +37,11 @@ var ENUM1; // enum type var var ResultIsBoolean1 = !ENUM; // enum type expressions -var ResultIsBoolean2 = !ENUM["B"]; -var ResultIsBoolean3 = !(1 /* B */ + ENUM["C"]); +var ResultIsBoolean2 = !1 /* "B" */; +var ResultIsBoolean3 = !(1 /* B */ + 2 /* "C" */); // multiple ! operators var ResultIsBoolean4 = !!ENUM; -var ResultIsBoolean5 = !!!(ENUM["B"] + 2 /* C */); +var ResultIsBoolean5 = !!!(1 /* "B" */ + 2 /* C */); // miss assignment operators !ENUM; !ENUM1; diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt index b273526b4f1..744ebed7d08 100644 --- a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2323: Type 'number' is not assignable to type 'boolean'. +tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type 'number' is not assignable to type 'boolean'. ==== tests/cases/compiler/matchReturnTypeInAllBranches.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2323: Type { return 12345; ~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. } } } diff --git a/tests/baselines/reference/memberOverride.errors.txt b/tests/baselines/reference/memberOverride.errors.txt index c63803f5aa1..0fd0fb57e67 100644 --- a/tests/baselines/reference/memberOverride.errors.txt +++ b/tests/baselines/reference/memberOverride.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/memberOverride.ts(4,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/memberOverride.ts(5,5): error TS2300: Duplicate identifier 'a'. -tests/cases/compiler/memberOverride.ts(8,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/memberOverride.ts(8,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/memberOverride.ts (3 errors) ==== @@ -17,4 +17,4 @@ tests/cases/compiler/memberOverride.ts(8,5): error TS2323: Type 'string' is not var n: number = x.a; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt index f1ee1f383bf..92d4cb17e72 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2421: Class 'D' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(13,7): error TS2420: Class 'D' incorrectly implements interface 'A'. Types have separate declarations of a private property 'x'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2421: Class 'E' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(19,7): error TS2420: Class 'E' incorrectly implements interface 'A'. Property 'x' is private in type 'A' but not in type 'E'. tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates.ts(26,9): error TS2341: Property 'x' is private and only accessible within class 'C'. @@ -20,8 +20,8 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class D implements A { // error ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'A': -!!! error TS2421: Types have separate declarations of a private property 'x'. +!!! error TS2420: Class 'D' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'x'. private x: number; y: string; z: string; @@ -29,8 +29,8 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class E implements A { // error ~ -!!! error TS2421: Class 'E' incorrectly implements interface 'A': -!!! error TS2421: Property 'x' is private in type 'A' but not in type 'E'. +!!! error TS2420: Class 'E' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is private in type 'A' but not in type 'E'. x: number; y: string; z: string; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt index 0ca3b4c3aa2..8fc1f0fe819 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2421: Class 'D' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(17,7): error TS2420: Class 'D' incorrectly implements interface 'A'. Types have separate declarations of a private property 'w'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2416: Class 'E' incorrectly extends base class 'C2': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2415: Class 'E' incorrectly extends base class 'C2'. Property 'w' is private in type 'C2' but not in type 'E'. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2421: Class 'E' incorrectly implements interface 'A': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(23,7): error TS2420: Class 'E' incorrectly implements interface 'A'. Property 'x' is missing in type 'E'. tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(30,9): error TS2341: Property 'x' is private and only accessible within class 'C'. tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates2.ts(31,10): error TS2341: Property 'w' is private and only accessible within class 'C2'. @@ -27,8 +27,8 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class D extends C implements A { // error ~ -!!! error TS2421: Class 'D' incorrectly implements interface 'A': -!!! error TS2421: Types have separate declarations of a private property 'w'. +!!! error TS2420: Class 'D' incorrectly implements interface 'A'. +!!! error TS2420: Types have separate declarations of a private property 'w'. private w: number; y: string; z: string; @@ -36,11 +36,11 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri class E extends C2 implements A { // error ~ -!!! error TS2416: Class 'E' incorrectly extends base class 'C2': -!!! error TS2416: Property 'w' is private in type 'C2' but not in type 'E'. +!!! error TS2415: Class 'E' incorrectly extends base class 'C2'. +!!! error TS2415: Property 'w' is private in type 'C2' but not in type 'E'. ~ -!!! error TS2421: Class 'E' incorrectly implements interface 'A': -!!! error TS2421: Property 'x' is missing in type 'E'. +!!! error TS2420: Class 'E' incorrectly implements interface 'A'. +!!! error TS2420: Property 'x' is missing in type 'E'. w: number; y: string; z: string; diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt index 0fadcfde588..4c49e6beb0c 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(9,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheritedPrivates3.ts(31,15): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. Named properties 'x' of types 'C' and 'C2' are not identical. @@ -15,7 +15,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri interface A extends C { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } @@ -40,7 +40,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithInheri interface A extends C { // error, privates conflict ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C2'. !!! error TS2320: Named properties 'x' of types 'C' and 'C2' are not identical. y: string; } diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt index 3687a0b79e8..1e11dc792f1 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C': +tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases4.ts(19,11): error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C'. Named properties 'a' of types 'C' and 'C' are not identical. @@ -23,7 +23,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultip interface A extends C, C3 { // error ~ -!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C': +!!! error TS2320: Interface 'A' cannot simultaneously extend types 'C' and 'C'. !!! error TS2320: Named properties 'a' of types 'C' and 'C' are not identical. y: T; } diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index cc93b716d2e..2fb7bd1bfbb 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): error TS2346: Supplied parameters do not match any signature of call target. @@ -17,7 +17,7 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): e var r7 = map([1, ""], (x) => x.toString()); // error ~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/multiLineErrors.errors.txt b/tests/baselines/reference/multiLineErrors.errors.txt index 1f28f758c38..23a6278b4fb 100644 --- a/tests/baselines/reference/multiLineErrors.errors.txt +++ b/tests/baselines/reference/multiLineErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/multiLineErrors.ts(3,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not assignable to type 'A1': - Types of property 'x' are incompatible: - Type '{ y: string; }' is not assignable to type '{ y: number; }': - Types of property 'y' are incompatible: +tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not assignable to type 'A1'. + Types of property 'x' are incompatible. + Type '{ y: string; }' is not assignable to type '{ y: number; }'. + Types of property 'y' are incompatible. Type 'string' is not assignable to type 'number'. @@ -34,9 +34,9 @@ tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not as var t2: A2; t1 = t2; ~~ -!!! error TS2322: Type 'A2' is not assignable to type 'A1': -!!! error TS2322: Types of property 'x' are incompatible: -!!! error TS2322: Type '{ y: string; }' is not assignable to type '{ y: number; }': -!!! error TS2322: Types of property 'y' are incompatible: +!!! error TS2322: Type 'A2' is not assignable to type 'A1'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type '{ y: string; }' is not assignable to type '{ y: number; }'. +!!! error TS2322: Types of property 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt index d815861d7fb..633f544a67b 100644 --- a/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt +++ b/tests/baselines/reference/multipleBaseInterfaesWithIncompatibleProperties.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A': +tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A'. Named properties 'x' of types 'A' and 'A' are not identical. @@ -10,6 +10,6 @@ tests/cases/compiler/multipleBaseInterfaesWithIncompatibleProperties.ts(6,11): e interface C extends A, A { } ~ -!!! error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A': +!!! error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'A'. !!! error TS2320: Named properties 'x' of types 'A' and 'A' are not identical. \ No newline at end of file diff --git a/tests/baselines/reference/multipleInheritance.errors.txt b/tests/baselines/reference/multipleInheritance.errors.txt index b482e0a125e..b15a6978ef5 100644 --- a/tests/baselines/reference/multipleInheritance.errors.txt +++ b/tests/baselines/reference/multipleInheritance.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/multipleInheritance.ts(9,19): error TS1005: '{' expected. tests/cases/compiler/multipleInheritance.ts(9,24): error TS1005: ';' expected. tests/cases/compiler/multipleInheritance.ts(18,19): error TS1005: '{' expected. tests/cases/compiler/multipleInheritance.ts(18,24): error TS1005: ';' expected. -tests/cases/compiler/multipleInheritance.ts(34,7): error TS2416: Class 'Baad' incorrectly extends base class 'Good': - Types of property 'g' are incompatible: +tests/cases/compiler/multipleInheritance.ts(34,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'. + Types of property 'g' are incompatible. Type '(n: number) => number' is not assignable to type '() => number'. tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. @@ -52,9 +52,9 @@ tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' d class Baad extends Good { ~~~~ -!!! error TS2416: Class 'Baad' incorrectly extends base class 'Good': -!!! error TS2416: Types of property 'g' are incompatible: -!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'. +!!! error TS2415: Class 'Baad' incorrectly extends base class 'Good'. +!!! error TS2415: Types of property 'g' are incompatible. +!!! error TS2415: Type '(n: number) => number' is not assignable to type '() => number'. public f(): number { return 0; } ~ !!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function. diff --git a/tests/baselines/reference/negateOperatorWithEnumType.js b/tests/baselines/reference/negateOperatorWithEnumType.js index 876bed45cc2..77458f442df 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.js +++ b/tests/baselines/reference/negateOperatorWithEnumType.js @@ -33,10 +33,10 @@ var ENUM1; // enum type var var ResultIsNumber1 = -ENUM; // expressions -var ResultIsNumber2 = -ENUM1["B"]; -var ResultIsNumber3 = -(1 /* B */ + ENUM1[""]); +var ResultIsNumber2 = -1 /* "B" */; +var ResultIsNumber3 = -(1 /* B */ + 2 /* "" */); // miss assignment operators -ENUM; -ENUM1; --ENUM1["B"]; +-1 /* "B" */; -ENUM, ENUM1; diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt b/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt index ac52b2365ee..66a7773ab49 100644 --- a/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2353: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other: +tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other. Property 'a' is missing in type '{ c: null; }'. @@ -20,5 +20,5 @@ tests/cases/compiler/noImplicitAnyInCastExpression.ts(16,2): error TS2353: Neith // Neither types is assignable to each other ({ c: null }); ~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other: -!!! error TS2353: Property 'a' is missing in type '{ c: null; }'. \ No newline at end of file +!!! error TS2352: Neither type '{ c: null; }' nor type 'IFoo' is assignable to the other. +!!! error TS2352: Property 'a' is missing in type '{ c: null; }'. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyIndexing.js b/tests/baselines/reference/noImplicitAnyIndexing.js index ebadbd9a121..91dbcae730c 100644 --- a/tests/baselines/reference/noImplicitAnyIndexing.js +++ b/tests/baselines/reference/noImplicitAnyIndexing.js @@ -61,7 +61,7 @@ var strRepresentation2 = MyEmusEnum[0 /* emu */]; // Should be implicit 'any' ; property access fails, no string indexer. var strRepresentation3 = MyEmusEnum["monehh"]; // Should be okay; should be a MyEmusEnum -var strRepresentation4 = MyEmusEnum["emu"]; +var strRepresentation4 = 0 /* "emu" */; // Should report an implicit 'any'. var x = {}["hi"]; // Should report an implicit 'any'. diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt index d703632d18b..07cc9009a67 100644 --- a/tests/baselines/reference/numberToString.errors.txt +++ b/tests/baselines/reference/numberToString.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numberToString.ts(2,12): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numberToString.ts(2,12): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. @@ -6,7 +6,7 @@ tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'num function f1(n:number):string { return n; // error return type mismatch ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } function f2(s:string):void { diff --git a/tests/baselines/reference/numericIndexExpressions.errors.txt b/tests/baselines/reference/numericIndexExpressions.errors.txt index 5832cca76c6..2c3b8d76796 100644 --- a/tests/baselines/reference/numericIndexExpressions.errors.txt +++ b/tests/baselines/reference/numericIndexExpressions.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexExpressions.ts (4 errors) ==== @@ -16,15 +16,15 @@ tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2323: Type 'numbe var x: Numbers1; x[1] = 4; // error ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x['1'] = 4; // error ~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var y: Strings1; y['1'] = 4; // should be error ~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. y[1] = 4; // should be error ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index 9965709713d..19f2c700ccf 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -7,9 +7,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }': - Index signatures are incompatible: - Type 'string | number' is not assignable to type 'string': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. + Index signatures are incompatible. + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. @@ -108,9 +108,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: string; } = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'string | number' is not assignable to type 'string': +!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', b: 1, diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt index 327a09d8813..7f73ac6da0a 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }': - Index signatures are incompatible: - Type 'number | A' is not assignable to type 'A': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. + Index signatures are incompatible. + Type 'number | A' is not assignable to type 'A'. Type 'number' is not assignable to type 'A'. @@ -54,9 +54,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: A } = { ~ -!!! error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'number | A' is not assignable to type 'A': +!!! error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number | A' is not assignable to type 'A'. !!! error TS2322: Type 'number' is not assignable to type 'A'. 1.0: new A(), 2.0: new B(), diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt index cd800042c4b..42cf293fe60 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo': +tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo'. Property 'foo' is missing in type 'Number'. @@ -7,6 +7,6 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'numb var x: { [index: string]: number; }; var result: Foo = x["one"]; // error ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'Foo': +!!! error TS2322: Type 'number' is not assignable to type 'Foo'. !!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint2.errors.txt b/tests/baselines/reference/numericIndexerConstraint2.errors.txt index b31688ca349..4260f60becf 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }': +tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. Index signature is missing in type '{ one: number; }'. @@ -8,5 +8,5 @@ tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ on var a: { one: number; }; x = a; ~ -!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }': +!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. !!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint5.errors.txt b/tests/baselines/reference/numericIndexerConstraint5.errors.txt index 4cccdf0d30b..445fc771218 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }': +tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. Index signature is missing in type '{ 0: Date; name: string; }'. @@ -6,5 +6,5 @@ tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: var x = { name: "x", 0: new Date() }; var z: { [name: number]: string } = x; ~ -!!! error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }': +!!! error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. !!! error TS2322: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping1.errors.txt b/tests/baselines/reference/numericIndexerTyping1.errors.txt index 2c5217bf5c6..3717a79a0ad 100644 --- a/tests/baselines/reference/numericIndexerTyping1.errors.txt +++ b/tests/baselines/reference/numericIndexerTyping1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericIndexerTyping1.ts(9,5): error TS2323: Type 'Date' is not assignable to type 'string'. -tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2323: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping1.ts(9,5): error TS2322: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2322: Type 'Date' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexerTyping1.ts (2 errors) ==== @@ -13,9 +13,9 @@ tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2323: Type 'Date' i var i: I; var r: string = i[1]; // error: numeric indexer returns the type of the string indexer ~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexer ~~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping2.errors.txt b/tests/baselines/reference/numericIndexerTyping2.errors.txt index 2736c9d6789..5f2278c6ac1 100644 --- a/tests/baselines/reference/numericIndexerTyping2.errors.txt +++ b/tests/baselines/reference/numericIndexerTyping2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericIndexerTyping2.ts(9,5): error TS2323: Type 'Date' is not assignable to type 'string'. -tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2323: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping2.ts(9,5): error TS2322: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2322: Type 'Date' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexerTyping2.ts (2 errors) ==== @@ -13,9 +13,9 @@ tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2323: Type 'Date' i var i: I; var r: string = i[1]; // error: numeric indexer returns the type of the string indexer ~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere ~~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt index 25f51e89882..0b218d3227b 100644 --- a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }': +tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. Property 'a' is missing in type '{ b: number; }'. @@ -6,5 +6,5 @@ tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type // Shouldn't compile var x: { a: number; } = { b: 5 }; ~ -!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }': +!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. !!! error TS2322: Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt index 761cd24c1a0..0d064af3935 100644 --- a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. - Types of property 'a' are incompatible: + Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'number'. @@ -11,5 +11,5 @@ tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument process({a:true,b:"y"}); ~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 1fc92ac5a48..91b9aaeecdc 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -92,7 +92,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,13) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,12): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,43): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,12): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type. @@ -331,7 +331,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) !!! error TS2380: 'get' and 'set' accessor must have the same type. var g2 = { get a() { return 4; }, set a(n: string) { } }; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index 18aa2c63160..ef084477f6d 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,7 +1,6 @@ -tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }': - Index signatures are incompatible: - Type 'A' is not assignable to type 'B': - Property 'y' is missing in type 'A'. +tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. + Index signatures are incompatible. + Type 'A' is not assignable to type 'B'. ==== tests/cases/compiler/objectLiteralIndexerErrors.ts (1 errors) ==== @@ -19,8 +18,7 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A ~~ -!!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'A' is not assignable to type 'B': -!!! error TS2322: Property 'y' is missing in type 'A'. +!!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'B'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt index 00f724ee0a7..3f499b0a580 100644 --- a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: Type '{ 0: number; }' is not assignable to type 'A': - Types of property '0' are incompatible: +tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. + Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. @@ -9,8 +9,8 @@ tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: } var x: A = { ~ -!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'A': -!!! error TS2322: Types of property '0' are incompatible: +!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. +!!! error TS2322: Types of property '0' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. 0: 3 }; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt index 42395ccf0b5..c4ee3ea17b2 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. @@ -21,9 +21,9 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var o: Object; o = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': +!!! error TS2322: Type 'I' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. !!! error TS2322: Type 'void' is not assignable to type 'string'. i = o; // ok @@ -33,9 +33,9 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var c: C; o = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': +!!! error TS2322: Type 'C' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. !!! error TS2322: Type 'void' is not assignable to type 'string'. c = o; // ok @@ -44,8 +44,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC } o = a; // error ~ -!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': +!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. !!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt index 4a64f34aa5e..a88796b390e 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -1,22 +1,22 @@ -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => number' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I': - Types of property 'toString' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. + Types of property 'toString' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => number' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C': - Types of property 'toString' are incompatible: - Type '() => string' is not assignable to type '() => number': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C'. + Types of property 'toString' are incompatible. + Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': - Types of property 'toString' are incompatible: - Type '() => void' is not assignable to type '() => string': +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. + Types of property 'toString' are incompatible. + Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. @@ -29,15 +29,15 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var o: Object; o = i; // error ~ -!!! error TS2322: Type 'I' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => number' is not assignable to type '() => string': +!!! error TS2322: Type 'I' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => number' is not assignable to type '() => string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. i = o; // error ~ -!!! error TS2322: Type 'Object' is not assignable to type 'I': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => string' is not assignable to type '() => number': +!!! error TS2322: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => string' is not assignable to type '() => number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. class C { @@ -46,15 +46,15 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var c: C; o = c; // error ~ -!!! error TS2322: Type 'C' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => number' is not assignable to type '() => string': +!!! error TS2322: Type 'C' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => number' is not assignable to type '() => string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. c = o; // error ~ -!!! error TS2322: Type 'Object' is not assignable to type 'C': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => string' is not assignable to type '() => number': +!!! error TS2322: Type 'Object' is not assignable to type 'C'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => string' is not assignable to type '() => number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. var a = { @@ -62,8 +62,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC } o = a; // error ~ -!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object': -!!! error TS2322: Types of property 'toString' are incompatible: -!!! error TS2322: Type '() => void' is not assignable to type '() => string': +!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. !!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 982fcf05b3b..30b40f431a7 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. -tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2323: Type 'Object' is not assignable to type '() => void'. +tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. ==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf f = i; i = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { (): void @@ -20,4 +20,4 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf f = a; a = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 1544fb5bebe..0faba936715 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. -tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2323: Type 'Object' is not assignable to type 'new () => any'. +tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type 'new () => any'. ==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb f = i; i = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { new(): any @@ -20,4 +20,4 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb f = a; a = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt index 6a6fe5965fc..582d7719a89 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List': +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List'. Type 'string' is not assignable to type 'number'. @@ -17,5 +17,5 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! error TS2322: Type 'List' is not assignable to type 'List': +!!! error TS2322: Type 'List' is not assignable to type 'List'. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt index bcabfeaa183..6349a452821 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List': +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List'. Type 'string' is not assignable to type 'number'. @@ -17,5 +17,5 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! error TS2322: Type 'List' is not assignable to type 'List': +!!! error TS2322: Type 'List' is not assignable to type 'List'. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt index 9dc658d1850..91a92dbd54c 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2322: Type 'MyList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2322: Type 'MyList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2322: Type 'MyList' is not assignable to type 'List': - Types of property 'data' are incompatible: +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2322: Type 'MyList' is not assignable to type 'List'. + Types of property 'data' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(30,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(30,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(41,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(43,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(48,5): error TS2323: Type 'T' is not assignable to type 'List'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(50,5): error TS2323: Type 'T' is not assignable to type 'MyList'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(43,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(48,5): error TS2322: Type 'T' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(50,5): error TS2322: Type 'T' is not assignable to type 'MyList'. ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (9 errors) ==== @@ -35,14 +35,14 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = myList1; // error, not nominally equal list1 = myList2; // error, type mismatch ~~~~~ -!!! error TS2322: Type 'MyList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: +!!! error TS2322: Type 'MyList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. list2 = myList1; // error, not nominally equal ~~~~~ -!!! error TS2322: Type 'MyList' is not assignable to type 'List': -!!! error TS2322: Types of property 'data' are incompatible: +!!! error TS2322: Type 'MyList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. list2 = myList2; // error, type mismatch @@ -53,10 +53,10 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec function foo, U extends MyList>(t: T, u: U) { t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; @@ -71,20 +71,20 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // was error, ok after constraint made illegal, doesn't matter ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; a = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'List'. +!!! error TS2322: Type 'T' is not assignable to type 'List'. a = u; // error b = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'MyList'. +!!! error TS2322: Type 'T' is not assignable to type 'MyList'. b = u; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt index c950b935130..9cbaa730022 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates3.ts(25,1): error TS2353: Neither type 'C3' nor type 'C4' is assignable to the other: +tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates3.ts(25,1): error TS2352: Neither type 'C3' nor type 'C4' is assignable to the other. Property 'y' is missing in type 'C3'. @@ -29,5 +29,5 @@ tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectType var c3: C3; c3; // Should fail (private x originates in the same declaration, but different types) ~~~~~~ -!!! error TS2353: Neither type 'C3' nor type 'C4' is assignable to the other: -!!! error TS2353: Property 'y' is missing in type 'C3'. \ No newline at end of file +!!! error TS2352: Neither type 'C3' nor type 'C4' is assignable to the other. +!!! error TS2352: Property 'y' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt index a930e9f7657..52fb45e40d2 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise': - Types of parameters 'onFulFill' and 'onFulfill' are incompatible: - Type '(value: number) => any' is not assignable to type '(value: string) => any': - Types of parameters 'value' and 'value' are incompatible: +tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. + Types of parameters 'onFulFill' and 'onFulfill' are incompatible. + Type '(value: number) => any' is not assignable to type '(value: string) => any'. + Types of parameters 'value' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,9 +14,9 @@ tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Typ var b = function then(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise { return null }; a = b; // error because number is not assignable to string ~ -!!! error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise': -!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible: -!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any': -!!! error TS2322: Types of parameters 'value' and 'value' are incompatible: +!!! error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. +!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. +!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any'. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt index f6e9cd01761..de02509d124 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1': - Types of parameters 'p1' and 'p1' are incompatible: +tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. + Types of parameters 'p1' and 'p1' are incompatible. Type 'string' is not assignable to type 'number'. @@ -15,7 +15,7 @@ tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type var c: I1 = i2.p1; // should be ok var d: I1 = i2.m1; // should error ~ -!!! error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1': -!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible: +!!! error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. +!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamTypeComparison.errors.txt b/tests/baselines/reference/optionalParamTypeComparison.errors.txt index 29ecc73509f..98a07570c65 100644 --- a/tests/baselines/reference/optionalParamTypeComparison.errors.txt +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void': - Types of parameters 'b' and 'n' are incompatible: +tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. + Types of parameters 'b' and 'n' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void': - Types of parameters 'n' and 'b' are incompatible: +tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. + Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -12,11 +12,11 @@ tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s f = g; ~ -!!! error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void': -!!! error TS2322: Types of parameters 'b' and 'n' are incompatible: +!!! error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. +!!! error TS2322: Types of parameters 'b' and 'n' are incompatible. !!! error TS2322: Type 'boolean' is not assignable to type 'number'. g = f; ~ -!!! error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void': -!!! error TS2322: Types of parameters 'n' and 'b' are incompatible: +!!! error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. +!!! error TS2322: Types of parameters 'n' and 'b' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt index d1193270c0c..7e27dea4df9 100644 --- a/tests/baselines/reference/optionalPropertiesInClasses.errors.txt +++ b/tests/baselines/reference/optionalPropertiesInClasses.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2421: Class 'C2' incorrectly implements interface 'ifoo': +tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2420: Class 'C2' incorrectly implements interface 'ifoo'. Property 'y' is missing in type 'C2'. @@ -14,8 +14,8 @@ tests/cases/compiler/optionalPropertiesInClasses.ts(10,7): error TS2421: Class ' class C2 implements ifoo { // ERROR - still need 'y' ~~ -!!! error TS2421: Class 'C2' incorrectly implements interface 'ifoo': -!!! error TS2421: Property 'y' is missing in type 'C2'. +!!! error TS2420: Class 'C2' incorrectly implements interface 'ifoo'. +!!! error TS2420: Property 'y' is missing in type 'C2'. public x:number; } diff --git a/tests/baselines/reference/optionalPropertiesTest.errors.txt b/tests/baselines/reference/optionalPropertiesTest.errors.txt index 74b8dd7a73a..a4b721e92ef 100644 --- a/tests/baselines/reference/optionalPropertiesTest.errors.txt +++ b/tests/baselines/reference/optionalPropertiesTest.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo': +tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. Property 'id' is missing in type '{ name: string; }'. -tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1': +tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1'. Property 'M' is missing in type '{}'. -tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3': +tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3'. Property 'M' is missing in type '{}'. -tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is not assignable to type 'i1': +tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is not assignable to type 'i1'. Property 'M' is optional in type 'i2' but required in type 'i1'. @@ -24,7 +24,7 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is foo = { id: 1234, name: "test" }; // Ok foo = { name: "test" }; // Error, id missing ~~~ -!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo': +!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. !!! error TS2322: Property 'id' is missing in type '{ name: string; }'. foo = {id: 1234, print:()=>{}} // Ok @@ -38,11 +38,11 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is var test1: i1 = {}; ~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'i1': +!!! error TS2322: Type '{}' is not assignable to type 'i1'. !!! error TS2322: Property 'M' is missing in type '{}'. var test2: i3 = {}; ~~~~~ -!!! error TS2322: Type '{}' is not assignable to type 'i3': +!!! error TS2322: Type '{}' is not assignable to type 'i3'. !!! error TS2322: Property 'M' is missing in type '{}'. var test3: i2 = {}; var test4: i4 = {}; @@ -59,5 +59,5 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is var test10_2: i2; test10_1 = test10_2; ~~~~~~~~ -!!! error TS2322: Type 'i2' is not assignable to type 'i1': +!!! error TS2322: Type 'i2' is not assignable to type 'i1'. !!! error TS2322: Property 'M' is optional in type 'i2' but required in type 'i1'. \ No newline at end of file diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt index cb2635c4a3b..c18a965a6dc 100644 --- a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Type 'I1' is not assignable to type 'I1': +tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Type 'I1' is not assignable to type 'I1'. Type 'number' is not assignable to type 'string'. @@ -12,7 +12,7 @@ tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Ty declare var v1: I1; var r1: I1 = v1.func(num => num.toString()) // Correctly returns an I1 ~~ -!!! error TS2322: Type 'I1' is not assignable to type 'I1': +!!! error TS2322: Type 'I1' is not assignable to type 'I1'. !!! error TS2322: Type 'number' is not assignable to type 'string'. .func(str => str.length); // should error diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index c4d3d999880..a1d8c5a6232 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/overload1.ts(27,5): error TS2323: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(29,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(27,5): error TS2322: Type 'C' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(31,3): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/overload1.ts(32,3): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/overload1.ts(33,1): error TS2323: Type 'C' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. @@ -35,11 +35,11 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' var e:string=x.g(new O.A()); // matches overload but bad assignment ~ -!!! error TS2323: Type 'C' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'string'. var y:string=x.f(3); // good y=x.f("nope"); // can't assign number to string ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var z:string=x.g(x.g(3,3)); // good z=x.g(2,2,2); // no match ~~~~~~~~~~ @@ -49,7 +49,7 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' !!! error TS2346: Supplied parameters do not match any signature of call target. z=x.g(new O.B()); // ambiguous (up and down conversion) ~ -!!! error TS2323: Type 'C' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. diff --git a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt index f50dcd04a1d..159af64a13a 100644 --- a/tests/baselines/reference/overloadOnConstInheritance2.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': - Types of property 'addEventListener' are incompatible: +tests/cases/compiler/overloadOnConstInheritance2.ts(5,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. + Types of property 'addEventListener' are incompatible. Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -11,9 +11,9 @@ tests/cases/compiler/overloadOnConstInheritance2.ts(6,5): error TS2382: Speciali } interface Deriver extends Base { ~~~~~~~ -!!! error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'addEventListener' are incompatible: -!!! error TS2429: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. +!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'addEventListener' are incompatible. +!!! error TS2430: Type '(x: 'bar') => string' is not assignable to type '{ (x: string): any; (x: 'foo'): string; }'. addEventListener(x: 'bar'): string; // shouldn't need to redeclare the string overload ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. diff --git a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt index 4ddb7d3669a..e0fff7b1ec7 100644 --- a/tests/baselines/reference/overloadOnConstInheritance3.errors.txt +++ b/tests/baselines/reference/overloadOnConstInheritance3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': - Types of property 'addEventListener' are incompatible: +tests/cases/compiler/overloadOnConstInheritance3.ts(4,11): error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. + Types of property 'addEventListener' are incompatible. Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. tests/cases/compiler/overloadOnConstInheritance3.ts(6,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. @@ -11,9 +11,9 @@ tests/cases/compiler/overloadOnConstInheritance3.ts(7,5): error TS2382: Speciali } interface Deriver extends Base { ~~~~~~~ -!!! error TS2429: Interface 'Deriver' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'addEventListener' are incompatible: -!!! error TS2429: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. +!!! error TS2430: Interface 'Deriver' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'addEventListener' are incompatible. +!!! error TS2430: Type '{ (x: 'bar'): string; (x: 'foo'): string; }' is not assignable to type '(x: string) => any'. // shouldn't need to redeclare the string overload addEventListener(x: 'bar'): string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 729b52d6045..e0a65f7475e 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,23 +1,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,5): error TS2344: Type 'string' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,13): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,5): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,13): error TS2344: Type 'string' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(72,5): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(72,13): error TS2344: Type 'string' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,14): error TS2344: Type 'Date' does not satisfy the constraint 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. -==== tests/cases/conformance/expressions/functionCalls/overloadResolution.ts (17 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/overloadResolution.ts (10 errors) ==== class SomeBase { private n; @@ -94,24 +87,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): function fn4() { } fn4('', 3); fn4(3, ''); // Error - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. - ~~~~~~ -!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. fn4('', 3); // Error - ~~~~~~ -!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. ~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. fn4(3, ''); - ~~~~~~ -!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that satisfy the constraints fn4('', 3); @@ -122,9 +103,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4(null, null); // Error ~~~~~~~ -!!! error TS2344: Type 'boolean' does not satisfy the constraint 'string'. - ~~~~ -!!! error TS2344: Type 'Date' does not satisfy the constraint 'number'. +!!! error TS2344: Type 'boolean' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index 676d5ea12d0..c6737c3d792 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -4,21 +4,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,17): error TS2344: Type 'string' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,25): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,17): error TS2344: Type 'string' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(79,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(80,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(84,9): error TS2344: Type 'boolean' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(84,18): error TS2344: Type 'Date' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(87,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(88,15): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(96,18): error TS2339: Property 'toFixed' does not exist on type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(98,18): error TS2339: Property 'blah' does not exist on type 'string'. -==== tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts (18 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts (14 errors) ==== class SomeBase { private n; @@ -105,15 +101,9 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn4('', 3); // Error ~~~~~~ !!! error TS2344: Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. - ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. new fn4(3, ''); // Error ~~~~~~ !!! error TS2344: Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that satisfy the constraints new fn4('', 3); @@ -129,8 +119,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn4(null, null); // Error ~~~~~~~ !!! error TS2344: Type 'boolean' does not satisfy the constraint 'string'. - ~~~~ -!!! error TS2344: Type 'Date' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 0cbaec65c13..540e12774c7 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,23 +1,16 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,9): error TS2344: Type 'string' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,17): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,17): error TS2344: Type 'string' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(79,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(79,17): error TS2344: Type 'string' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,18): error TS2344: Type 'Date' does not satisfy the constraint 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. -==== tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts (17 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts (10 errors) ==== class SomeBase { private n; @@ -101,24 +94,12 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn4('', 3); new fn4(3, ''); // Error - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. - ~~~~~~ -!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new fn4('', 3); // Error - ~~~~~~ -!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. ~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. new fn4(3, ''); - ~~~~~~ -!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. - ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that satisfy the constraints new fn4('', 3); @@ -129,9 +110,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error ~~~~~~~ -!!! error TS2344: Type 'boolean' does not satisfy the constraint 'string'. - ~~~~ -!!! error TS2344: Type 'Date' does not satisfy the constraint 'number'. +!!! error TS2344: Type 'boolean' does not satisfy the constraint 'number'. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 6e9be0cc516..9f51c0fa10b 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,12 +1,12 @@ tests/cases/compiler/overloadResolutionTest1.ts(8,16): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }': - Types of property 'a' are incompatible: + Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(19,15): error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. - Types of property 'a' are incompatible: + Types of property 'a' are incompatible. Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. - Types of property 'a' are incompatible: + Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -21,8 +21,8 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~ !!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }': -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -37,7 +37,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x4 = foo2({a:"s"}); // error ~~~~~~~ !!! error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'boolean'. @@ -47,5 +47,5 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x = foo4({a:true}); // error ~~~~~~~~ !!! error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. -!!! error TS2345: Types of property 'a' are incompatible: +!!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadingOnConstants1.errors.txt b/tests/baselines/reference/overloadingOnConstants1.errors.txt index bc277dc0795..f134a146500 100644 --- a/tests/baselines/reference/overloadingOnConstants1.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2322: Type 'Base' is not assignable to type 'Derived1': +tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2322: Type 'Base' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Base'. -tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2322: Type 'Derived1' is not assignable to type 'Derived3': +tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2322: Type 'Derived1' is not assignable to type 'Derived3'. Property 'biz' is missing in type 'Derived1'. -tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2322: Type 'Derived2' is not assignable to type 'Derived1': +tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2322: Type 'Derived2' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Derived2'. -tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Derived3' is not assignable to type 'Derived1': +tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Derived3' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Derived3'. @@ -32,17 +32,17 @@ tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Deriv // these are errors var htmlElement2: Derived1 = d2.createElement("yo") ~~~~~~~~~~~~ -!!! error TS2322: Type 'Base' is not assignable to type 'Derived1': +!!! error TS2322: Type 'Base' is not assignable to type 'Derived1'. !!! error TS2322: Property 'bar' is missing in type 'Base'. var htmlCanvasElement2: Derived3 = d2.createElement("canvas"); ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'Derived1' is not assignable to type 'Derived3': +!!! error TS2322: Type 'Derived1' is not assignable to type 'Derived3'. !!! error TS2322: Property 'biz' is missing in type 'Derived1'. var htmlDivElement2: Derived1 = d2.createElement("div"); ~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived1': +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived1'. !!! error TS2322: Property 'bar' is missing in type 'Derived2'. var htmlSpanElement2: Derived1 = d2.createElement("span"); ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'Derived3' is not assignable to type 'Derived1': +!!! error TS2322: Type 'Derived3' is not assignable to type 'Derived1'. !!! error TS2322: Property 'bar' is missing in type 'Derived3'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index e41557a2903..4a119c5ca22 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,12): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -20,22 +20,22 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,12): declare function foo(arg: (x: C) => any): string; declare function foo(arg: (x: B) => any): number; - var result: number = foo(x => new G(x)); // No error, returns number + var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~ !!! error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. - var result2: number = foo(x => new G(x)); // No error, returns number - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. + var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. + ~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~~~~~~~~ !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. - var result3: string = foo(x => { // returns string because the C overload is picked - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - var y: G; // error that C does not satisfy constraint - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var result3: string = foo(x => { // x has type D + ~~~~~~~~~~~~~~~~~~~~~~ + var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. return y; diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js index 0e5f84c8d69..63b4a2b1e93 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js @@ -12,12 +12,12 @@ declare function foo(arg: (x: D) => number): string; declare function foo(arg: (x: C) => any): string; declare function foo(arg: (x: B) => any): number; -var result: number = foo(x => new G(x)); // No error, returns number +var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -var result2: number = foo(x => new G(x)); // No error, returns number +var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -var result3: string = foo(x => { // returns string because the C overload is picked - var y: G; // error that C does not satisfy constraint +var result3: string = foo(x => { // x has type D + var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y; }); @@ -28,9 +28,9 @@ var G = (function () { } return G; })(); -var result = foo(function (x) { return new G(x); }); // No error, returns number -var result2 = foo(function (x) { return new G(x); }); // No error, returns number +var result = foo(function (x) { return new G(x); }); // x has type D, new G(x) fails, so first overload is picked. +var result2 = foo(function (x) { return new G(x); }); // x has type D, new G(x) fails, so first overload is picked. var result3 = foo(function (x) { - var y; // error that C does not satisfy constraint + var y; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y; }); diff --git a/tests/baselines/reference/overloadsWithConstraints.js b/tests/baselines/reference/overloadsWithConstraints.js new file mode 100644 index 00000000000..f9cc87b2260 --- /dev/null +++ b/tests/baselines/reference/overloadsWithConstraints.js @@ -0,0 +1,8 @@ +//// [overloadsWithConstraints.ts] +declare function f(x: T): T; +declare function f(x: T): T + +var v = f(""); + +//// [overloadsWithConstraints.js] +var v = f(""); diff --git a/tests/baselines/reference/overloadsWithConstraints.types b/tests/baselines/reference/overloadsWithConstraints.types new file mode 100644 index 00000000000..1493a0e1a2a --- /dev/null +++ b/tests/baselines/reference/overloadsWithConstraints.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/overloadsWithConstraints.ts === +declare function f(x: T): T; +>f : { (x: T): T; (x: T): T; } +>T : T +>Number : Number +>x : T +>T : T +>T : T + +declare function f(x: T): T +>f : { (x: T): T; (x: T): T; } +>T : T +>String : String +>x : T +>T : T +>T : T + +var v = f(""); +>v : string +>f("") : string +>f : { (x: T): T; (x: T): T; } + diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt index 6d51014f005..c63856a9ee1 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt +++ b/tests/baselines/reference/overridingPrivateStaticMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': +tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. Types have separate declarations of a private property 'y'. @@ -9,7 +9,7 @@ tests/cases/compiler/overridingPrivateStaticMembers.ts(5,7): error TS2418: Class class Derived2 extends Base2 { ~~~~~~~~ -!!! error TS2418: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2': -!!! error TS2418: Types have separate declarations of a private property 'y'. +!!! error TS2417: Class static side 'typeof Derived2' incorrectly extends base class static side 'typeof Base2'. +!!! error TS2417: Types have separate declarations of a private property 'y'. private static y: { foo: string; bar: string; }; } \ No newline at end of file diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index 96d004c5b01..baa5aaff738 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/parseTypes.ts(9,1): error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. -tests/cases/compiler/parseTypes.ts(10,1): error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. -tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }': +tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type '(s: string) => void'. -tests/cases/compiler/parseTypes.ts(12,1): error TS2323: Type '(s: string) => void' is not assignable to type 'new () => number'. +tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. ==== tests/cases/compiler/parseTypes.ts (4 errors) ==== @@ -16,15 +16,15 @@ tests/cases/compiler/parseTypes.ts(12,1): error TS2323: Type '(s: string) => voi y=f; y=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. x=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. w=g; ~ -!!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }': +!!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. !!! error TS2322: Index signature is missing in type '(s: string) => void'. z=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type 'new () => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. \ No newline at end of file diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt index 237541b40f7..940083ca93a 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt +++ b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'. @@ -19,8 +20,9 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error T var one = 1; var _float = -(4/3); var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 diff --git a/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt b/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt index 4e67a4e8641..ee17b6f82aa 100644 --- a/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt +++ b/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. -tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2323: Type 'Object' is not assignable to type '() => void'. +tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. ==== tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut o = i; i = o; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { (): void @@ -20,5 +20,5 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut o = a; a = o; ~ -!!! error TS2323: Type 'Object' is not assignable to type '() => void'. +!!! error TS2322: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreation1.errors.txt b/tests/baselines/reference/parserObjectCreation1.errors.txt index 211a3620b19..0787d17c605 100644 --- a/tests/baselines/reference/parserObjectCreation1.errors.txt +++ b/tests/baselines/reference/parserObjectCreation1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts(1,5): error TS2322: Type 'number[][]' is not assignable to type 'number[]': +tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts(1,5): error TS2322: Type 'number[][]' is not assignable to type 'number[]'. Type 'number[]' is not assignable to type 'number'. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts (1 errors) ==== var autoToken: number[] = new Array(1); ~~~~~~~~~ -!!! error TS2322: Type 'number[][]' is not assignable to type 'number[]': +!!! error TS2322: Type 'number[][]' is not assignable to type 'number[]'. !!! error TS2322: Type 'number[]' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithEnumType.js b/tests/baselines/reference/plusOperatorWithEnumType.js index 4d6eaad892e..1ce6036d5ce 100644 --- a/tests/baselines/reference/plusOperatorWithEnumType.js +++ b/tests/baselines/reference/plusOperatorWithEnumType.js @@ -35,8 +35,8 @@ var ENUM1; var ResultIsNumber1 = +ENUM; var ResultIsNumber2 = +ENUM1; // enum type expressions -var ResultIsNumber3 = +ENUM1["A"]; -var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); +var ResultIsNumber3 = +0 /* "A" */; +var ResultIsNumber4 = +(ENUM[0] + 1 /* "B" */); // miss assignment operators +ENUM; +ENUM1; diff --git a/tests/baselines/reference/preserveConstEnums.js b/tests/baselines/reference/preserveConstEnums.js new file mode 100644 index 00000000000..3f27825283f --- /dev/null +++ b/tests/baselines/reference/preserveConstEnums.js @@ -0,0 +1,11 @@ +//// [preserveConstEnums.ts] +const enum E { + Value = 1, Value2 = Value +} + +//// [preserveConstEnums.js] +var E; +(function (E) { + E[E["Value"] = 1] = "Value"; + E[E["Value2"] = 1] = "Value2"; +})(E || (E = {})); diff --git a/tests/baselines/reference/preserveConstEnums.types b/tests/baselines/reference/preserveConstEnums.types new file mode 100644 index 00000000000..080cdbffb2b --- /dev/null +++ b/tests/baselines/reference/preserveConstEnums.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/preserveConstEnums.ts === +const enum E { +>E : E + + Value = 1, Value2 = Value +>Value : E +>Value2 : E +>Value : E +} diff --git a/tests/baselines/reference/primitiveMembers.errors.txt b/tests/baselines/reference/primitiveMembers.errors.txt index d0ed1da7cce..7a1ed5c8e53 100644 --- a/tests/baselines/reference/primitiveMembers.errors.txt +++ b/tests/baselines/reference/primitiveMembers.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/primitiveMembers.ts(24,35): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/primitiveMembers.ts(5,3): error TS2339: Property 'toBAZ' does not exist on type 'number'. -tests/cases/compiler/primitiveMembers.ts(11,1): error TS2323: Type 'Number' is not assignable to type 'number'. +tests/cases/compiler/primitiveMembers.ts(11,1): error TS2322: Type 'Number' is not assignable to type 'number'. ==== tests/cases/compiler/primitiveMembers.ts (4 errors) ==== @@ -19,7 +19,7 @@ tests/cases/compiler/primitiveMembers.ts(11,1): error TS2323: Type 'Number' is n n = N; // should not work, as 'number' has a different brand ~ -!!! error TS2323: Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. N = n; // should work var o: Object = {} diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types index 9fa07a674f3..936f04731f6 100644 --- a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types @@ -13,7 +13,7 @@ interface Foo { } var Foo: new () => Foo.A>; >Foo : new () => Foo.A> ->Foo : Foo +>Foo : unknown >A : Foo.A >Foo : Foo diff --git a/tests/baselines/reference/privateInterfaceProperties.errors.txt b/tests/baselines/reference/privateInterfaceProperties.errors.txt index faff968379f..2c363ad40cc 100644 --- a/tests/baselines/reference/privateInterfaceProperties.errors.txt +++ b/tests/baselines/reference/privateInterfaceProperties.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privateInterfaceProperties.ts(4,7): error TS2421: Class 'c1' incorrectly implements interface 'i1': +tests/cases/compiler/privateInterfaceProperties.ts(4,7): error TS2420: Class 'c1' incorrectly implements interface 'i1'. Property 'name' is private in type 'c1' but not in type 'i1'. @@ -8,8 +8,8 @@ tests/cases/compiler/privateInterfaceProperties.ts(4,7): error TS2421: Class 'c1 // should be an error class c1 implements i1 { private name:string; } ~~ -!!! error TS2421: Class 'c1' incorrectly implements interface 'i1': -!!! error TS2421: Property 'name' is private in type 'c1' but not in type 'i1'. +!!! error TS2420: Class 'c1' incorrectly implements interface 'i1'. +!!! error TS2420: Property 'name' is private in type 'c1' but not in type 'i1'. // should be ok class c2 implements i1 { public name:string; } diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 0b2aa01bb5c..9104d924e66 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -20,13 +20,20 @@ tests/cases/compiler/promisePermutations.ts(120,19): error TS2345: Argument of t tests/cases/compiler/promisePermutations.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations.ts(122,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(126,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(129,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/promisePermutations.ts(129,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations.ts(134,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations.ts(137,11): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/promisePermutations.ts(144,12): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/promisePermutations.ts(152,12): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/promisePermutations.ts(137,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(144,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations.ts(152,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. tests/cases/compiler/promisePermutations.ts(156,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(158,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations.ts(159,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. @@ -207,8 +214,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -223,8 +232,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -232,8 +243,10 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // ok - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -242,8 +255,9 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index e512ca73277..3c316115a27 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -20,13 +20,20 @@ tests/cases/compiler/promisePermutations2.ts(119,19): error TS2345: Argument of tests/cases/compiler/promisePermutations2.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(128,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/promisePermutations2.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations2.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations2.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations2.ts(136,11): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/promisePermutations2.ts(143,12): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/promisePermutations2.ts(151,12): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/promisePermutations2.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations2.ts(143,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations2.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. tests/cases/compiler/promisePermutations2.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations2.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. @@ -206,8 +213,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -222,8 +231,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -231,8 +242,10 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -241,8 +254,9 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 97d47cc7f7f..f8edf83c694 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -21,13 +21,20 @@ tests/cases/compiler/promisePermutations3.ts(119,19): error TS2345: Argument of tests/cases/compiler/promisePermutations3.ts(120,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations3.ts(121,19): error TS2345: Argument of type '(x: T, cb: (a: T) => T) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(125,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(128,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/promisePermutations3.ts(128,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. tests/cases/compiler/promisePermutations3.ts(131,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => IPromise' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(132,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => Promise'. tests/cases/compiler/promisePermutations3.ts(133,19): error TS2345: Argument of type '(x: T, cb: (a: U) => U) => Promise' is not assignable to parameter of type '(value: number) => IPromise'. -tests/cases/compiler/promisePermutations3.ts(136,11): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/promisePermutations3.ts(143,12): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/promisePermutations3.ts(151,12): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/promisePermutations3.ts(136,11): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations3.ts(143,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/promisePermutations3.ts(151,12): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. tests/cases/compiler/promisePermutations3.ts(155,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(157,21): error TS2345: Argument of type '{ (x: number): IPromise; (x: string): IPromise; }' is not assignable to parameter of type '(value: number) => IPromise'. tests/cases/compiler/promisePermutations3.ts(158,21): error TS2345: Argument of type '{ (x: number): Promise; (x: string): Promise; }' is not assignable to parameter of type '(value: number) => Promise'. @@ -210,8 +217,10 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var r9b = r9.then(sIPromise, sIPromise, sIPromise); // ok var r9c = r9.then(nIPromise, nIPromise, nIPromise); // ok var r9d = r9.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s9: Promise; var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error @@ -226,8 +235,10 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s9d = s9.then(sPromise, sPromise, sPromise); // ok var s9e = s9.then(nPromise, nPromise, nPromise); // ok var s9f = s9.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var r10 = testFunction10(x => x); @@ -235,8 +246,10 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var r10b = r10.then(sIPromise, sIPromise, sIPromise); // ok var r10c = r10.then(nIPromise, nIPromise, nIPromise); // ok var r10d = r10.then(testFunction, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'IPromise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. +!!! error TS2453: Type 'string' is not assignable to type 'number'. var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); // ok var s10 = testFunction10P(x => x); var s10a = s10.then(testFunction10, testFunction10, testFunction10); // ok @@ -245,8 +258,9 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of var s10d = s10.then(sPromise, sPromise, sPromise); // ok var s10e = s10.then(nIPromise, nPromise, nIPromise); // ok var s10f = s10.then(testFunctionP, sIPromise, nIPromise); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'Promise' is not a valid type argument because it is not a supertype of candidate 'IPromise'. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/propertyAssignment.errors.txt b/tests/baselines/reference/propertyAssignment.errors.txt index 3f5aca52c87..20894f159e0 100644 --- a/tests/baselines/reference/propertyAssignment.errors.txt +++ b/tests/baselines/reference/propertyAssignment.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/propertyAssignment.ts(6,14): error TS1022: An index signature parameter must have a type annotation. -tests/cases/compiler/propertyAssignment.ts(14,1): error TS2323: Type '{ x: number; }' is not assignable to type 'new () => any'. -tests/cases/compiler/propertyAssignment.ts(16,1): error TS2323: Type '{ x: number; }' is not assignable to type '() => void'. +tests/cases/compiler/propertyAssignment.ts(14,1): error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. +tests/cases/compiler/propertyAssignment.ts(16,1): error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. ==== tests/cases/compiler/propertyAssignment.ts (3 errors) ==== @@ -21,8 +21,8 @@ tests/cases/compiler/propertyAssignment.ts(16,1): error TS2323: Type '{ x: numbe foo1 = bar1; // should be an error ~~~~ -!!! error TS2323: Type '{ x: number; }' is not assignable to type 'new () => any'. +!!! error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. foo2 = bar2; foo3 = bar3; // should be an error ~~~~ -!!! error TS2323: Type '{ x: number; }' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt index e68922ccf36..b3970c216eb 100644 --- a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2322: Type '{}' is not assignable to type 'C': +tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2322: Type '{}' is not assignable to type 'C'. Property 'x' is missing in type '{}'. -tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2322: Type '{ x?: any; }' is not assignable to type 'C': +tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2322: Type '{ x?: any; }' is not assignable to type 'C'. Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. @@ -12,11 +12,11 @@ tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2322: Ty // x should not be an optional property var v: C = {}; // Should fail ~ -!!! error TS2322: Type '{}' is not assignable to type 'C': +!!! error TS2322: Type '{}' is not assignable to type 'C'. !!! error TS2322: Property 'x' is missing in type '{}'. var v2: { x? } v = v2; // Should fail ~ -!!! error TS2322: Type '{ x?: any; }' is not assignable to type 'C': +!!! error TS2322: Type '{ x?: any; }' is not assignable to type 'C'. !!! error TS2322: Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. var v3: { x } = new C; // Should succeed \ No newline at end of file diff --git a/tests/baselines/reference/protectedMembers.errors.txt b/tests/baselines/reference/protectedMembers.errors.txt index ce9529a7f67..10ea00cf10f 100644 --- a/tests/baselines/reference/protectedMembers.errors.txt +++ b/tests/baselines/reference/protectedMembers.errors.txt @@ -9,11 +9,11 @@ tests/cases/compiler/protectedMembers.ts(48,1): error TS2445: Property 'sx' is p tests/cases/compiler/protectedMembers.ts(49,1): error TS2445: Property 'sf' is protected and only accessible within class 'C2' and its subclasses. tests/cases/compiler/protectedMembers.ts(68,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. tests/cases/compiler/protectedMembers.ts(69,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. -tests/cases/compiler/protectedMembers.ts(98,1): error TS2322: Type 'B1' is not assignable to type 'A1': +tests/cases/compiler/protectedMembers.ts(98,1): error TS2322: Type 'B1' is not assignable to type 'A1'. Property 'x' is protected but type 'B1' is not a class derived from 'A1'. -tests/cases/compiler/protectedMembers.ts(99,1): error TS2322: Type 'A1' is not assignable to type 'B1': +tests/cases/compiler/protectedMembers.ts(99,1): error TS2322: Type 'A1' is not assignable to type 'B1'. Property 'x' is protected in type 'A1' but public in type 'B1'. -tests/cases/compiler/protectedMembers.ts(112,7): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/compiler/protectedMembers.ts(112,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property 'x' is protected in type 'B3' but public in type 'A3'. @@ -139,11 +139,11 @@ tests/cases/compiler/protectedMembers.ts(112,7): error TS2416: Class 'B3' incorr var b1: B1; a1 = b1; // Error, B1 doesn't derive from A1 ~~ -!!! error TS2322: Type 'B1' is not assignable to type 'A1': +!!! error TS2322: Type 'B1' is not assignable to type 'A1'. !!! error TS2322: Property 'x' is protected but type 'B1' is not a class derived from 'A1'. b1 = a1; // Error, x is protected in A1 but public in B1 ~~ -!!! error TS2322: Type 'A1' is not assignable to type 'B1': +!!! error TS2322: Type 'A1' is not assignable to type 'B1'. !!! error TS2322: Property 'x' is protected in type 'A1' but public in type 'B1'. class A2 { @@ -159,8 +159,8 @@ tests/cases/compiler/protectedMembers.ts(112,7): error TS2416: Class 'B3' incorr // Error x is protected in B3 but public in A3 class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property 'x' is protected in type 'B3' but public in type 'A3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property 'x' is protected in type 'B3' but public in type 'A3'. protected x; } diff --git a/tests/baselines/reference/protoAsIndexInIndexExpression.types b/tests/baselines/reference/protoAsIndexInIndexExpression.types index e950098e6a1..bde87801fa5 100644 --- a/tests/baselines/reference/protoAsIndexInIndexExpression.types +++ b/tests/baselines/reference/protoAsIndexInIndexExpression.types @@ -20,8 +20,8 @@ WorkspacePrototype['__proto__'] = EntityPrototype; >EntityPrototype : any var o = { ->o : {} ->{ "__proto__": 0} : {} +>o : { "__proto__": number; } +>{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 }; diff --git a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt index b5404823218..3083338f573 100644 --- a/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt +++ b/tests/baselines/reference/publicMemberImplementedAsPrivateInDerivedClass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts(4,7): error TS2421: Class 'Foo' incorrectly implements interface 'Qux': +tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts(4,7): error TS2420: Class 'Foo' incorrectly implements interface 'Qux'. Property 'Bar' is private in type 'Foo' but not in type 'Qux'. @@ -8,8 +8,8 @@ tests/cases/compiler/publicMemberImplementedAsPrivateInDerivedClass.ts(4,7): err } class Foo implements Qux { ~~~ -!!! error TS2421: Class 'Foo' incorrectly implements interface 'Qux': -!!! error TS2421: Property 'Bar' is private in type 'Foo' but not in type 'Qux'. +!!! error TS2420: Class 'Foo' incorrectly implements interface 'Qux'. +!!! error TS2420: Property 'Bar' is private in type 'Foo' but not in type 'Qux'. private Bar: number; } \ No newline at end of file diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index 2ae8ea57b25..a2f59733fae 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I': +tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. Property 'p' is missing in type 'Number'. -tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2': +tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. Property 'q' is missing in type 'Number'. -tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3': +tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]': +tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. Property 'length' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(47,13): error TS2323: Type 'I4' is not assignable to type '() => I3'. -tests/cases/compiler/qualify.ts(48,13): error TS2323: Type 'I4' is not assignable to type '(k: I3) => void'. -tests/cases/compiler/qualify.ts(49,13): error TS2322: Type 'I4' is not assignable to type '{ k: I3; }': +tests/cases/compiler/qualify.ts(47,13): error TS2322: Type 'I4' is not assignable to type '() => I3'. +tests/cases/compiler/qualify.ts(48,13): error TS2322: Type 'I4' is not assignable to type '(k: I3) => void'. +tests/cases/compiler/qualify.ts(49,13): error TS2322: Type 'I4' is not assignable to type '{ k: I3; }'. Property 'k' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable to type 'I': +tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable to type 'I'. Property 'p' is missing in type 'I'. @@ -37,7 +37,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U { var z:I=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I': +!!! error TS2322: Type 'number' is not assignable to type 'I'. !!! error TS2322: Property 'p' is missing in type 'Number'. export interface I2 { q; @@ -49,7 +49,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U2 { var z:T.U.I2=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I2': +!!! error TS2322: Type 'number' is not assignable to type 'I2'. !!! error TS2322: Property 'q' is missing in type 'Number'. } } @@ -67,21 +67,21 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var v1:I4; var v2:K1.I3=v1; ~~ -!!! error TS2322: Type 'I4' is not assignable to type 'I3': +!!! error TS2322: Type 'I4' is not assignable to type 'I3'. !!! error TS2322: Property 'zeep' is missing in type 'I4'. var v3:K1.I3[]=v1; ~~ -!!! error TS2322: Type 'I4' is not assignable to type 'I3[]': +!!! error TS2322: Type 'I4' is not assignable to type 'I3[]'. !!! error TS2322: Property 'length' is missing in type 'I4'. var v4:()=>K1.I3=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type '() => I3'. +!!! error TS2322: Type 'I4' is not assignable to type '() => I3'. var v5:(k:K1.I3)=>void=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type '(k: I3) => void'. +!!! error TS2322: Type 'I4' is not assignable to type '(k: I3) => void'. var v6:{k:K1.I3;}=v1; ~~ -!!! error TS2322: Type 'I4' is not assignable to type '{ k: I3; }': +!!! error TS2322: Type 'I4' is not assignable to type '{ k: I3; }'. !!! error TS2322: Property 'k' is missing in type 'I4'. } } @@ -93,7 +93,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var y:I; var x:T.I=y; ~ -!!! error TS2322: Type 'I' is not assignable to type 'I': +!!! error TS2322: Type 'I' is not assignable to type 'I'. !!! error TS2322: Property 'p' is missing in type 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index cb26efe3472..30f6c7aa41f 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2323: Type 'number' is not assignable to type '() => typeof fn'. -tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2323: Type '() => typeof fn' is not assignable to type 'number'. -tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number': +tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2322: Type '() => typeof fn' is not assignable to type 'number'. +tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2323: Type '() => I' is not assignable to type 'number'. +tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. -tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2323: Type 'number' is not assignable to type '() => any'. +tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type 'number' is not assignable to type '() => any'. tests/cases/compiler/recursiveFunctionTypes.ts(30,1): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. @@ -17,14 +17,14 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== function fn(): typeof fn { return 1; } ~ -!!! error TS2323: Type 'number' is not assignable to type '() => typeof fn'. +!!! error TS2322: Type 'number' is not assignable to type '() => typeof fn'. var x: number = fn; // error ~ -!!! error TS2323: Type '() => typeof fn' is not assignable to type 'number'. +!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. var y: () => number = fn; // ok ~ -!!! error TS2322: Type '() => typeof fn' is not assignable to type '() => number': +!!! error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. !!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. var f: () => typeof g; @@ -44,7 +44,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of var a: number = f3; // error ~ -!!! error TS2323: Type '() => I' is not assignable to type 'number'. +!!! error TS2322: Type '() => I' is not assignable to type 'number'. class C { static g(t: typeof C.g){ } @@ -56,7 +56,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of var f4: () => typeof f4; f4 = 3; // error ~~ -!!! error TS2323: Type 'number' is not assignable to type '() => any'. +!!! error TS2322: Type 'number' is not assignable to type '() => any'. function f5() { return f5; } diff --git a/tests/baselines/reference/recursiveInheritance3.errors.txt b/tests/baselines/reference/recursiveInheritance3.errors.txt index 494aa26a201..6ec3935ece4 100644 --- a/tests/baselines/reference/recursiveInheritance3.errors.txt +++ b/tests/baselines/reference/recursiveInheritance3.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/recursiveInheritance3.ts(1,7): error TS2421: Class 'C' incorrectly implements interface 'I': +tests/cases/compiler/recursiveInheritance3.ts(1,7): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'other' is missing in type 'C'. ==== tests/cases/compiler/recursiveInheritance3.ts (1 errors) ==== class C implements I { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'I': -!!! error TS2421: Property 'other' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'I'. +!!! error TS2420: Property 'other' is missing in type 'C'. public foo(x: any) { return x; } private x = 1; } diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 063c5b67480..ad47f15c521 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/redefineArray.ts(1,1): error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +tests/cases/compiler/redefineArray.ts(1,1): error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. Property 'isArray' is missing in type '(n: number, s: string) => number'. ==== tests/cases/compiler/redefineArray.ts (1 errors) ==== Array = function (n:number, s:string) {return n;}; ~~~~~ -!!! error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }': +!!! error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. !!! error TS2322: Property 'isArray' is missing in type '(n: number, s: string) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/reservedNamesInAliases.errors.txt b/tests/baselines/reference/reservedNamesInAliases.errors.txt new file mode 100644 index 00000000000..9f2d87c5409 --- /dev/null +++ b/tests/baselines/reference/reservedNamesInAliases.errors.txt @@ -0,0 +1,30 @@ +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS1003: Identifier expected. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,11): error TS1005: ';' expected. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(2,6): error TS2457: Type alias name cannot be 'any' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(3,6): error TS2457: Type alias name cannot be 'number' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(4,6): error TS2457: Type alias name cannot be 'boolean' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(5,6): error TS2457: Type alias name cannot be 'string' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error TS2304: Cannot find name 'I'. + + +==== tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts (7 errors) ==== + interface I {} + type any = I; + ~~~ +!!! error TS2457: Type alias name cannot be 'any' + type number = I; + ~~~~~~ +!!! error TS2457: Type alias name cannot be 'number' + type boolean = I; + ~~~~~~~ +!!! error TS2457: Type alias name cannot be 'boolean' + type string = I; + ~~~~~~ +!!! error TS2457: Type alias name cannot be 'string' + type void = I; + ~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS2304: Cannot find name 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt index 3a02ecf63ab..2ea07395099 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void': - Types of parameters 'x' and 'x' are incompatible: - Type 'number' is not assignable to type 'number[]': +tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -13,9 +13,9 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: var n = g; n = f; ~ -!!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void': -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2322: Type 'number' is not assignable to type 'number[]': +!!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. !!! error TS2322: Property 'length' is missing in type 'Number'. n([4], 'foo'); \ No newline at end of file diff --git a/tests/baselines/reference/scopeTests.errors.txt b/tests/baselines/reference/scopeTests.errors.txt index 59749eaf396..ce24301efc2 100644 --- a/tests/baselines/reference/scopeTests.errors.txt +++ b/tests/baselines/reference/scopeTests.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/scopeTests.ts(2,7): error TS2416: Class 'D' incorrectly extends base class 'C': +tests/cases/compiler/scopeTests.ts(2,7): error TS2415: Class 'D' incorrectly extends base class 'C'. Property 'v' is private in type 'C' but not in type 'D'. @@ -6,8 +6,8 @@ tests/cases/compiler/scopeTests.ts(2,7): error TS2416: Class 'D' incorrectly ext class C { private v; public p; static s; } class D extends C { ~ -!!! error TS2416: Class 'D' incorrectly extends base class 'C': -!!! error TS2416: Property 'v' is private in type 'C' but not in type 'D'. +!!! error TS2415: Class 'D' incorrectly extends base class 'C'. +!!! error TS2415: Property 'v' is private in type 'C' but not in type 'D'. public v: number; public p: number constructor() { diff --git a/tests/baselines/reference/shadowPrivateMembers.errors.txt b/tests/baselines/reference/shadowPrivateMembers.errors.txt index 94dd577c1c4..2196224b7c4 100644 --- a/tests/baselines/reference/shadowPrivateMembers.errors.txt +++ b/tests/baselines/reference/shadowPrivateMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/shadowPrivateMembers.ts(2,7): error TS2416: Class 'derived' incorrectly extends base class 'base': +tests/cases/compiler/shadowPrivateMembers.ts(2,7): error TS2415: Class 'derived' incorrectly extends base class 'base'. Types have separate declarations of a private property 'n'. @@ -6,6 +6,6 @@ tests/cases/compiler/shadowPrivateMembers.ts(2,7): error TS2416: Class 'derived' class base { private n() {} } class derived extends base { private n() {} } ~~~~~~~ -!!! error TS2416: Class 'derived' incorrectly extends base class 'base': -!!! error TS2416: Types have separate declarations of a private property 'n'. +!!! error TS2415: Class 'derived' incorrectly extends base class 'base'. +!!! error TS2415: Types have separate declarations of a private property 'n'. \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.js b/tests/baselines/reference/sourceMapValidationStatements.js index 85a4dc33889..8a4b565e9b0 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js +++ b/tests/baselines/reference/sourceMapValidationStatements.js @@ -136,22 +136,19 @@ function f() { z = 10; } switch (obj.z) { - case 0: - { - x++; - break; - } - case 1: - { - x--; - break; - } - default: - { - x *= 2; - x = 50; - break; - } + case 0: { + x++; + break; + } + case 1: { + x--; + break; + } + default: { + x *= 2; + x = 50; + break; + } } while (x < 10) { x++; diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map index a8ff3d46038..02b5c0bb806 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js.map +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationStatements.js.map] -{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA,SAAS,CAAC;IACNA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAAA,CAACA;QACGA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAATA,CAACA;QACCA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAAA,CAACA;QACGA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAAVA,CAACA;QACCA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAACA,CAACA;QACCA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA;YAASA,CAACA;gBACNA,CAACA,IAAIA,CAACA,CAACA;gBACPA,CAACA,GAAGA,EAAEA,CAACA;gBACPA,KAAKA,CAACA;YAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA,SAAS,CAAC;IACNA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAAA,CAACA;QACGA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAATA,CAACA;QACCA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAAA,CAACA;QACGA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAAVA,CAACA;QACCA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAACA,CAACA;QACCA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA,EAAEA,CAACA;YACLA,CAACA,EAAEA,CAACA;YACJA,KAAKA,CAACA;QAEVA,CAACA;QACDA,KAAKA,CAACA,EAAEA,CAACA;YACLA,CAACA,EAAEA,CAACA;YACJA,KAAKA,CAACA;QAEVA,CAACA;QACDA,SAASA,CAACA;YACNA,CAACA,IAAIA,CAACA,CAACA;YACPA,CAACA,GAAGA,EAAEA,CAACA;YACPA,KAAKA,CAACA;QAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt index d997557cdfe..1a288e3a830 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -936,200 +936,191 @@ sourceFile:sourceMapValidationStatements.ts 9 >Emitted(52, 20) Source(47, 20) + SourceIndex(0) name (f) 10>Emitted(52, 21) Source(47, 21) + SourceIndex(0) name (f) --- ->>> case 0: +>>> case 0: { 1 >^^^^^^^^ 2 > ^^^^^ 3 > ^ +4 > ^^ +5 > ^ 1 > > 2 > case 3 > 0 +4 > : +5 > { 1 >Emitted(53, 9) Source(48, 9) + SourceIndex(0) name (f) 2 >Emitted(53, 14) Source(48, 14) + SourceIndex(0) name (f) 3 >Emitted(53, 15) Source(48, 15) + SourceIndex(0) name (f) +4 >Emitted(53, 17) Source(48, 17) + SourceIndex(0) name (f) +5 >Emitted(53, 18) Source(48, 18) + SourceIndex(0) name (f) --- ->>> { +>>> x++; 1 >^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^-> -1 >: -2 > { -1 >Emitted(54, 13) Source(48, 17) + SourceIndex(0) name (f) -2 >Emitted(54, 14) Source(48, 18) + SourceIndex(0) name (f) +3 > ^^ +4 > ^ +5 > ^^^-> +1 > + > +2 > x +3 > ++ +4 > ; +1 >Emitted(54, 13) Source(49, 13) + SourceIndex(0) name (f) +2 >Emitted(54, 14) Source(49, 14) + SourceIndex(0) name (f) +3 >Emitted(54, 16) Source(49, 16) + SourceIndex(0) name (f) +4 >Emitted(54, 17) Source(49, 17) + SourceIndex(0) name (f) --- ->>> x++; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^^^-> +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1-> > -2 > x -3 > ++ -4 > ; -1->Emitted(55, 17) Source(49, 13) + SourceIndex(0) name (f) -2 >Emitted(55, 18) Source(49, 14) + SourceIndex(0) name (f) -3 >Emitted(55, 20) Source(49, 16) + SourceIndex(0) name (f) -4 >Emitted(55, 21) Source(49, 17) + SourceIndex(0) name (f) +2 > break +3 > ; +1->Emitted(55, 13) Source(50, 13) + SourceIndex(0) name (f) +2 >Emitted(55, 18) Source(50, 18) + SourceIndex(0) name (f) +3 >Emitted(55, 19) Source(50, 19) + SourceIndex(0) name (f) --- ->>> break; -1->^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -1-> - > -2 > break -3 > ; -1->Emitted(56, 17) Source(50, 13) + SourceIndex(0) name (f) -2 >Emitted(56, 22) Source(50, 18) + SourceIndex(0) name (f) -3 >Emitted(56, 23) Source(50, 19) + SourceIndex(0) name (f) ---- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^-> +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> 1 > > > -2 > } -1 >Emitted(57, 13) Source(52, 9) + SourceIndex(0) name (f) -2 >Emitted(57, 14) Source(52, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(56, 9) Source(52, 9) + SourceIndex(0) name (f) +2 >Emitted(56, 10) Source(52, 10) + SourceIndex(0) name (f) --- ->>> case 1: +>>> case 1: { 1->^^^^^^^^ 2 > ^^^^^ 3 > ^ +4 > ^^ +5 > ^ 1-> > 2 > case 3 > 1 -1->Emitted(58, 9) Source(53, 9) + SourceIndex(0) name (f) -2 >Emitted(58, 14) Source(53, 14) + SourceIndex(0) name (f) -3 >Emitted(58, 15) Source(53, 15) + SourceIndex(0) name (f) +4 > : +5 > { +1->Emitted(57, 9) Source(53, 9) + SourceIndex(0) name (f) +2 >Emitted(57, 14) Source(53, 14) + SourceIndex(0) name (f) +3 >Emitted(57, 15) Source(53, 15) + SourceIndex(0) name (f) +4 >Emitted(57, 17) Source(53, 17) + SourceIndex(0) name (f) +5 >Emitted(57, 18) Source(53, 18) + SourceIndex(0) name (f) --- ->>> { +>>> x--; 1 >^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^-> -1 >: -2 > { -1 >Emitted(59, 13) Source(53, 17) + SourceIndex(0) name (f) -2 >Emitted(59, 14) Source(53, 18) + SourceIndex(0) name (f) +3 > ^^ +4 > ^ +5 > ^^^-> +1 > + > +2 > x +3 > -- +4 > ; +1 >Emitted(58, 13) Source(54, 13) + SourceIndex(0) name (f) +2 >Emitted(58, 14) Source(54, 14) + SourceIndex(0) name (f) +3 >Emitted(58, 16) Source(54, 16) + SourceIndex(0) name (f) +4 >Emitted(58, 17) Source(54, 17) + SourceIndex(0) name (f) --- ->>> x--; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^^^-> +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1-> > -2 > x -3 > -- -4 > ; -1->Emitted(60, 17) Source(54, 13) + SourceIndex(0) name (f) -2 >Emitted(60, 18) Source(54, 14) + SourceIndex(0) name (f) -3 >Emitted(60, 20) Source(54, 16) + SourceIndex(0) name (f) -4 >Emitted(60, 21) Source(54, 17) + SourceIndex(0) name (f) +2 > break +3 > ; +1->Emitted(59, 13) Source(55, 13) + SourceIndex(0) name (f) +2 >Emitted(59, 18) Source(55, 18) + SourceIndex(0) name (f) +3 >Emitted(59, 19) Source(55, 19) + SourceIndex(0) name (f) --- ->>> break; -1->^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -1-> - > -2 > break -3 > ; -1->Emitted(61, 17) Source(55, 13) + SourceIndex(0) name (f) -2 >Emitted(61, 22) Source(55, 18) + SourceIndex(0) name (f) -3 >Emitted(61, 23) Source(55, 19) + SourceIndex(0) name (f) ---- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^-> +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> 1 > > > -2 > } -1 >Emitted(62, 13) Source(57, 9) + SourceIndex(0) name (f) -2 >Emitted(62, 14) Source(57, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(60, 9) Source(57, 9) + SourceIndex(0) name (f) +2 >Emitted(60, 10) Source(57, 10) + SourceIndex(0) name (f) --- ->>> default: +>>> default: { 1->^^^^^^^^ -2 > ^^^^^^-> +2 > ^^^^^^^^^ +3 > ^ +4 > ^^-> 1-> > -1->Emitted(63, 9) Source(58, 9) + SourceIndex(0) name (f) +2 > default: +3 > { +1->Emitted(61, 9) Source(58, 9) + SourceIndex(0) name (f) +2 >Emitted(61, 18) Source(58, 18) + SourceIndex(0) name (f) +3 >Emitted(61, 19) Source(58, 19) + SourceIndex(0) name (f) --- ->>> { +>>> x *= 2; 1->^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^-> -1->default: -2 > { -1->Emitted(64, 13) Source(58, 18) + SourceIndex(0) name (f) -2 >Emitted(64, 14) Source(58, 19) + SourceIndex(0) name (f) ---- ->>> x *= 2; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^ -6 > ^-> +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^-> 1-> > -2 > x -3 > *= -4 > 2 -5 > ; -1->Emitted(65, 17) Source(59, 13) + SourceIndex(0) name (f) -2 >Emitted(65, 18) Source(59, 14) + SourceIndex(0) name (f) -3 >Emitted(65, 22) Source(59, 18) + SourceIndex(0) name (f) -4 >Emitted(65, 23) Source(59, 19) + SourceIndex(0) name (f) -5 >Emitted(65, 24) Source(59, 20) + SourceIndex(0) name (f) +2 > x +3 > *= +4 > 2 +5 > ; +1->Emitted(62, 13) Source(59, 13) + SourceIndex(0) name (f) +2 >Emitted(62, 14) Source(59, 14) + SourceIndex(0) name (f) +3 >Emitted(62, 18) Source(59, 18) + SourceIndex(0) name (f) +4 >Emitted(62, 19) Source(59, 19) + SourceIndex(0) name (f) +5 >Emitted(62, 20) Source(59, 20) + SourceIndex(0) name (f) --- ->>> x = 50; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^ -4 > ^^ -5 > ^ +>>> x = 50; +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ 1-> > -2 > x -3 > = -4 > 50 -5 > ; -1->Emitted(66, 17) Source(60, 13) + SourceIndex(0) name (f) -2 >Emitted(66, 18) Source(60, 14) + SourceIndex(0) name (f) -3 >Emitted(66, 21) Source(60, 17) + SourceIndex(0) name (f) -4 >Emitted(66, 23) Source(60, 19) + SourceIndex(0) name (f) -5 >Emitted(66, 24) Source(60, 20) + SourceIndex(0) name (f) +2 > x +3 > = +4 > 50 +5 > ; +1->Emitted(63, 13) Source(60, 13) + SourceIndex(0) name (f) +2 >Emitted(63, 14) Source(60, 14) + SourceIndex(0) name (f) +3 >Emitted(63, 17) Source(60, 17) + SourceIndex(0) name (f) +4 >Emitted(63, 19) Source(60, 19) + SourceIndex(0) name (f) +5 >Emitted(63, 20) Source(60, 20) + SourceIndex(0) name (f) --- ->>> break; -1 >^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +>>> break; +1 >^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1 > > -2 > break -3 > ; -1 >Emitted(67, 17) Source(61, 13) + SourceIndex(0) name (f) -2 >Emitted(67, 22) Source(61, 18) + SourceIndex(0) name (f) -3 >Emitted(67, 23) Source(61, 19) + SourceIndex(0) name (f) +2 > break +3 > ; +1 >Emitted(64, 13) Source(61, 13) + SourceIndex(0) name (f) +2 >Emitted(64, 18) Source(61, 18) + SourceIndex(0) name (f) +3 >Emitted(64, 19) Source(61, 19) + SourceIndex(0) name (f) --- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ +>>> } +1 >^^^^^^^^ +2 > ^ 1 > > > -2 > } -1 >Emitted(68, 13) Source(63, 9) + SourceIndex(0) name (f) -2 >Emitted(68, 14) Source(63, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(65, 9) Source(63, 9) + SourceIndex(0) name (f) +2 >Emitted(65, 10) Source(63, 10) + SourceIndex(0) name (f) --- >>> } 1 >^^^^ @@ -1138,8 +1129,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 > } -1 >Emitted(69, 5) Source(64, 5) + SourceIndex(0) name (f) -2 >Emitted(69, 6) Source(64, 6) + SourceIndex(0) name (f) +1 >Emitted(66, 5) Source(64, 5) + SourceIndex(0) name (f) +2 >Emitted(66, 6) Source(64, 6) + SourceIndex(0) name (f) --- >>> while (x < 10) { 1->^^^^ @@ -1157,13 +1148,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > 10 6 > ) 7 > { -1->Emitted(70, 5) Source(65, 5) + SourceIndex(0) name (f) -2 >Emitted(70, 12) Source(65, 12) + SourceIndex(0) name (f) -3 >Emitted(70, 13) Source(65, 13) + SourceIndex(0) name (f) -4 >Emitted(70, 16) Source(65, 16) + SourceIndex(0) name (f) -5 >Emitted(70, 18) Source(65, 18) + SourceIndex(0) name (f) -6 >Emitted(70, 20) Source(65, 20) + SourceIndex(0) name (f) -7 >Emitted(70, 21) Source(65, 21) + SourceIndex(0) name (f) +1->Emitted(67, 5) Source(65, 5) + SourceIndex(0) name (f) +2 >Emitted(67, 12) Source(65, 12) + SourceIndex(0) name (f) +3 >Emitted(67, 13) Source(65, 13) + SourceIndex(0) name (f) +4 >Emitted(67, 16) Source(65, 16) + SourceIndex(0) name (f) +5 >Emitted(67, 18) Source(65, 18) + SourceIndex(0) name (f) +6 >Emitted(67, 20) Source(65, 20) + SourceIndex(0) name (f) +7 >Emitted(67, 21) Source(65, 21) + SourceIndex(0) name (f) --- >>> x++; 1 >^^^^^^^^ @@ -1175,10 +1166,10 @@ sourceFile:sourceMapValidationStatements.ts 2 > x 3 > ++ 4 > ; -1 >Emitted(71, 9) Source(66, 9) + SourceIndex(0) name (f) -2 >Emitted(71, 10) Source(66, 10) + SourceIndex(0) name (f) -3 >Emitted(71, 12) Source(66, 12) + SourceIndex(0) name (f) -4 >Emitted(71, 13) Source(66, 13) + SourceIndex(0) name (f) +1 >Emitted(68, 9) Source(66, 9) + SourceIndex(0) name (f) +2 >Emitted(68, 10) Source(66, 10) + SourceIndex(0) name (f) +3 >Emitted(68, 12) Source(66, 12) + SourceIndex(0) name (f) +4 >Emitted(68, 13) Source(66, 13) + SourceIndex(0) name (f) --- >>> } 1 >^^^^ @@ -1187,8 +1178,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 > } -1 >Emitted(72, 5) Source(67, 5) + SourceIndex(0) name (f) -2 >Emitted(72, 6) Source(67, 6) + SourceIndex(0) name (f) +1 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) name (f) +2 >Emitted(69, 6) Source(67, 6) + SourceIndex(0) name (f) --- >>> do { 1->^^^^ @@ -1199,9 +1190,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 > do 3 > { -1->Emitted(73, 5) Source(68, 5) + SourceIndex(0) name (f) -2 >Emitted(73, 8) Source(68, 8) + SourceIndex(0) name (f) -3 >Emitted(73, 9) Source(68, 9) + SourceIndex(0) name (f) +1->Emitted(70, 5) Source(68, 5) + SourceIndex(0) name (f) +2 >Emitted(70, 8) Source(68, 8) + SourceIndex(0) name (f) +3 >Emitted(70, 9) Source(68, 9) + SourceIndex(0) name (f) --- >>> x--; 1->^^^^^^^^ @@ -1214,10 +1205,10 @@ sourceFile:sourceMapValidationStatements.ts 2 > x 3 > -- 4 > ; -1->Emitted(74, 9) Source(69, 9) + SourceIndex(0) name (f) -2 >Emitted(74, 10) Source(69, 10) + SourceIndex(0) name (f) -3 >Emitted(74, 12) Source(69, 12) + SourceIndex(0) name (f) -4 >Emitted(74, 13) Source(69, 13) + SourceIndex(0) name (f) +1->Emitted(71, 9) Source(69, 9) + SourceIndex(0) name (f) +2 >Emitted(71, 10) Source(69, 10) + SourceIndex(0) name (f) +3 >Emitted(71, 12) Source(69, 12) + SourceIndex(0) name (f) +4 >Emitted(71, 13) Source(69, 13) + SourceIndex(0) name (f) --- >>> } while (x > 4); 1->^^^^ @@ -1235,13 +1226,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > > 6 > 4 7 > ) -1->Emitted(75, 5) Source(70, 5) + SourceIndex(0) name (f) -2 >Emitted(75, 6) Source(70, 6) + SourceIndex(0) name (f) -3 >Emitted(75, 14) Source(70, 14) + SourceIndex(0) name (f) -4 >Emitted(75, 15) Source(70, 15) + SourceIndex(0) name (f) -5 >Emitted(75, 18) Source(70, 18) + SourceIndex(0) name (f) -6 >Emitted(75, 19) Source(70, 19) + SourceIndex(0) name (f) -7 >Emitted(75, 21) Source(70, 20) + SourceIndex(0) name (f) +1->Emitted(72, 5) Source(70, 5) + SourceIndex(0) name (f) +2 >Emitted(72, 6) Source(70, 6) + SourceIndex(0) name (f) +3 >Emitted(72, 14) Source(70, 14) + SourceIndex(0) name (f) +4 >Emitted(72, 15) Source(70, 15) + SourceIndex(0) name (f) +5 >Emitted(72, 18) Source(70, 18) + SourceIndex(0) name (f) +6 >Emitted(72, 19) Source(70, 19) + SourceIndex(0) name (f) +7 >Emitted(72, 21) Source(70, 20) + SourceIndex(0) name (f) --- >>> x = y; 1 >^^^^ @@ -1256,11 +1247,11 @@ sourceFile:sourceMapValidationStatements.ts 3 > = 4 > y 5 > ; -1 >Emitted(76, 5) Source(71, 5) + SourceIndex(0) name (f) -2 >Emitted(76, 6) Source(71, 6) + SourceIndex(0) name (f) -3 >Emitted(76, 9) Source(71, 9) + SourceIndex(0) name (f) -4 >Emitted(76, 10) Source(71, 10) + SourceIndex(0) name (f) -5 >Emitted(76, 11) Source(71, 11) + SourceIndex(0) name (f) +1 >Emitted(73, 5) Source(71, 5) + SourceIndex(0) name (f) +2 >Emitted(73, 6) Source(71, 6) + SourceIndex(0) name (f) +3 >Emitted(73, 9) Source(71, 9) + SourceIndex(0) name (f) +4 >Emitted(73, 10) Source(71, 10) + SourceIndex(0) name (f) +5 >Emitted(73, 11) Source(71, 11) + SourceIndex(0) name (f) --- >>> var z = (x == 1) ? x + 1 : x - 1; 1->^^^^ @@ -1300,24 +1291,24 @@ sourceFile:sourceMapValidationStatements.ts 16> - 17> 1 18> ; -1->Emitted(77, 5) Source(72, 5) + SourceIndex(0) name (f) -2 >Emitted(77, 9) Source(72, 9) + SourceIndex(0) name (f) -3 >Emitted(77, 10) Source(72, 10) + SourceIndex(0) name (f) -4 >Emitted(77, 13) Source(72, 13) + SourceIndex(0) name (f) -5 >Emitted(77, 14) Source(72, 14) + SourceIndex(0) name (f) -6 >Emitted(77, 15) Source(72, 15) + SourceIndex(0) name (f) -7 >Emitted(77, 19) Source(72, 19) + SourceIndex(0) name (f) -8 >Emitted(77, 20) Source(72, 20) + SourceIndex(0) name (f) -9 >Emitted(77, 21) Source(72, 21) + SourceIndex(0) name (f) -10>Emitted(77, 24) Source(72, 24) + SourceIndex(0) name (f) -11>Emitted(77, 25) Source(72, 25) + SourceIndex(0) name (f) -12>Emitted(77, 28) Source(72, 28) + SourceIndex(0) name (f) -13>Emitted(77, 29) Source(72, 29) + SourceIndex(0) name (f) -14>Emitted(77, 32) Source(72, 32) + SourceIndex(0) name (f) -15>Emitted(77, 33) Source(72, 33) + SourceIndex(0) name (f) -16>Emitted(77, 36) Source(72, 36) + SourceIndex(0) name (f) -17>Emitted(77, 37) Source(72, 37) + SourceIndex(0) name (f) -18>Emitted(77, 38) Source(72, 38) + SourceIndex(0) name (f) +1->Emitted(74, 5) Source(72, 5) + SourceIndex(0) name (f) +2 >Emitted(74, 9) Source(72, 9) + SourceIndex(0) name (f) +3 >Emitted(74, 10) Source(72, 10) + SourceIndex(0) name (f) +4 >Emitted(74, 13) Source(72, 13) + SourceIndex(0) name (f) +5 >Emitted(74, 14) Source(72, 14) + SourceIndex(0) name (f) +6 >Emitted(74, 15) Source(72, 15) + SourceIndex(0) name (f) +7 >Emitted(74, 19) Source(72, 19) + SourceIndex(0) name (f) +8 >Emitted(74, 20) Source(72, 20) + SourceIndex(0) name (f) +9 >Emitted(74, 21) Source(72, 21) + SourceIndex(0) name (f) +10>Emitted(74, 24) Source(72, 24) + SourceIndex(0) name (f) +11>Emitted(74, 25) Source(72, 25) + SourceIndex(0) name (f) +12>Emitted(74, 28) Source(72, 28) + SourceIndex(0) name (f) +13>Emitted(74, 29) Source(72, 29) + SourceIndex(0) name (f) +14>Emitted(74, 32) Source(72, 32) + SourceIndex(0) name (f) +15>Emitted(74, 33) Source(72, 33) + SourceIndex(0) name (f) +16>Emitted(74, 36) Source(72, 36) + SourceIndex(0) name (f) +17>Emitted(74, 37) Source(72, 37) + SourceIndex(0) name (f) +18>Emitted(74, 38) Source(72, 38) + SourceIndex(0) name (f) --- >>> (x == 1) ? x + 1 : x - 1; 1 >^^^^ @@ -1351,21 +1342,21 @@ sourceFile:sourceMapValidationStatements.ts 13> - 14> 1 15> ; -1 >Emitted(78, 5) Source(73, 5) + SourceIndex(0) name (f) -2 >Emitted(78, 6) Source(73, 6) + SourceIndex(0) name (f) -3 >Emitted(78, 7) Source(73, 7) + SourceIndex(0) name (f) -4 >Emitted(78, 11) Source(73, 11) + SourceIndex(0) name (f) -5 >Emitted(78, 12) Source(73, 12) + SourceIndex(0) name (f) -6 >Emitted(78, 13) Source(73, 13) + SourceIndex(0) name (f) -7 >Emitted(78, 16) Source(73, 16) + SourceIndex(0) name (f) -8 >Emitted(78, 17) Source(73, 17) + SourceIndex(0) name (f) -9 >Emitted(78, 20) Source(73, 20) + SourceIndex(0) name (f) -10>Emitted(78, 21) Source(73, 21) + SourceIndex(0) name (f) -11>Emitted(78, 24) Source(73, 24) + SourceIndex(0) name (f) -12>Emitted(78, 25) Source(73, 25) + SourceIndex(0) name (f) -13>Emitted(78, 28) Source(73, 28) + SourceIndex(0) name (f) -14>Emitted(78, 29) Source(73, 29) + SourceIndex(0) name (f) -15>Emitted(78, 30) Source(73, 30) + SourceIndex(0) name (f) +1 >Emitted(75, 5) Source(73, 5) + SourceIndex(0) name (f) +2 >Emitted(75, 6) Source(73, 6) + SourceIndex(0) name (f) +3 >Emitted(75, 7) Source(73, 7) + SourceIndex(0) name (f) +4 >Emitted(75, 11) Source(73, 11) + SourceIndex(0) name (f) +5 >Emitted(75, 12) Source(73, 12) + SourceIndex(0) name (f) +6 >Emitted(75, 13) Source(73, 13) + SourceIndex(0) name (f) +7 >Emitted(75, 16) Source(73, 16) + SourceIndex(0) name (f) +8 >Emitted(75, 17) Source(73, 17) + SourceIndex(0) name (f) +9 >Emitted(75, 20) Source(73, 20) + SourceIndex(0) name (f) +10>Emitted(75, 21) Source(73, 21) + SourceIndex(0) name (f) +11>Emitted(75, 24) Source(73, 24) + SourceIndex(0) name (f) +12>Emitted(75, 25) Source(73, 25) + SourceIndex(0) name (f) +13>Emitted(75, 28) Source(73, 28) + SourceIndex(0) name (f) +14>Emitted(75, 29) Source(73, 29) + SourceIndex(0) name (f) +15>Emitted(75, 30) Source(73, 30) + SourceIndex(0) name (f) --- >>> x === 1; 1 >^^^^ @@ -1380,11 +1371,11 @@ sourceFile:sourceMapValidationStatements.ts 3 > === 4 > 1 5 > ; -1 >Emitted(79, 5) Source(74, 5) + SourceIndex(0) name (f) -2 >Emitted(79, 6) Source(74, 6) + SourceIndex(0) name (f) -3 >Emitted(79, 11) Source(74, 11) + SourceIndex(0) name (f) -4 >Emitted(79, 12) Source(74, 12) + SourceIndex(0) name (f) -5 >Emitted(79, 13) Source(74, 13) + SourceIndex(0) name (f) +1 >Emitted(76, 5) Source(74, 5) + SourceIndex(0) name (f) +2 >Emitted(76, 6) Source(74, 6) + SourceIndex(0) name (f) +3 >Emitted(76, 11) Source(74, 11) + SourceIndex(0) name (f) +4 >Emitted(76, 12) Source(74, 12) + SourceIndex(0) name (f) +5 >Emitted(76, 13) Source(74, 13) + SourceIndex(0) name (f) --- >>> x = z = 40; 1->^^^^ @@ -1402,13 +1393,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > = 6 > 40 7 > ; -1->Emitted(80, 5) Source(75, 5) + SourceIndex(0) name (f) -2 >Emitted(80, 6) Source(75, 6) + SourceIndex(0) name (f) -3 >Emitted(80, 9) Source(75, 9) + SourceIndex(0) name (f) -4 >Emitted(80, 10) Source(75, 10) + SourceIndex(0) name (f) -5 >Emitted(80, 13) Source(75, 13) + SourceIndex(0) name (f) -6 >Emitted(80, 15) Source(75, 15) + SourceIndex(0) name (f) -7 >Emitted(80, 16) Source(75, 16) + SourceIndex(0) name (f) +1->Emitted(77, 5) Source(75, 5) + SourceIndex(0) name (f) +2 >Emitted(77, 6) Source(75, 6) + SourceIndex(0) name (f) +3 >Emitted(77, 9) Source(75, 9) + SourceIndex(0) name (f) +4 >Emitted(77, 10) Source(75, 10) + SourceIndex(0) name (f) +5 >Emitted(77, 13) Source(75, 13) + SourceIndex(0) name (f) +6 >Emitted(77, 15) Source(75, 15) + SourceIndex(0) name (f) +7 >Emitted(77, 16) Source(75, 16) + SourceIndex(0) name (f) --- >>> eval("y"); 1 >^^^^ @@ -1424,12 +1415,12 @@ sourceFile:sourceMapValidationStatements.ts 4 > "y" 5 > ) 6 > ; -1 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) name (f) -2 >Emitted(81, 9) Source(76, 9) + SourceIndex(0) name (f) -3 >Emitted(81, 10) Source(76, 10) + SourceIndex(0) name (f) -4 >Emitted(81, 13) Source(76, 13) + SourceIndex(0) name (f) -5 >Emitted(81, 14) Source(76, 14) + SourceIndex(0) name (f) -6 >Emitted(81, 15) Source(76, 15) + SourceIndex(0) name (f) +1 >Emitted(78, 5) Source(76, 5) + SourceIndex(0) name (f) +2 >Emitted(78, 9) Source(76, 9) + SourceIndex(0) name (f) +3 >Emitted(78, 10) Source(76, 10) + SourceIndex(0) name (f) +4 >Emitted(78, 13) Source(76, 13) + SourceIndex(0) name (f) +5 >Emitted(78, 14) Source(76, 14) + SourceIndex(0) name (f) +6 >Emitted(78, 15) Source(76, 15) + SourceIndex(0) name (f) --- >>> return; 1 >^^^^ @@ -1439,9 +1430,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 > return 3 > ; -1 >Emitted(82, 5) Source(77, 5) + SourceIndex(0) name (f) -2 >Emitted(82, 11) Source(77, 11) + SourceIndex(0) name (f) -3 >Emitted(82, 12) Source(77, 12) + SourceIndex(0) name (f) +1 >Emitted(79, 5) Source(77, 5) + SourceIndex(0) name (f) +2 >Emitted(79, 11) Source(77, 11) + SourceIndex(0) name (f) +3 >Emitted(79, 12) Source(77, 12) + SourceIndex(0) name (f) --- >>>} 1 > @@ -1450,8 +1441,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 >} -1 >Emitted(83, 1) Source(78, 1) + SourceIndex(0) name (f) -2 >Emitted(83, 2) Source(78, 2) + SourceIndex(0) name (f) +1 >Emitted(80, 1) Source(78, 1) + SourceIndex(0) name (f) +2 >Emitted(80, 2) Source(78, 2) + SourceIndex(0) name (f) --- >>>var b = function () { 1-> @@ -1464,10 +1455,10 @@ sourceFile:sourceMapValidationStatements.ts 2 >var 3 > b 4 > = -1->Emitted(84, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(84, 5) Source(79, 5) + SourceIndex(0) -3 >Emitted(84, 6) Source(79, 6) + SourceIndex(0) -4 >Emitted(84, 9) Source(79, 9) + SourceIndex(0) +1->Emitted(81, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(81, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(81, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(81, 9) Source(79, 9) + SourceIndex(0) --- >>> var x = 10; 1->^^^^ @@ -1483,12 +1474,12 @@ sourceFile:sourceMapValidationStatements.ts 4 > = 5 > 10 6 > ; -1->Emitted(85, 5) Source(80, 5) + SourceIndex(0) -2 >Emitted(85, 9) Source(80, 9) + SourceIndex(0) -3 >Emitted(85, 10) Source(80, 10) + SourceIndex(0) -4 >Emitted(85, 13) Source(80, 13) + SourceIndex(0) -5 >Emitted(85, 15) Source(80, 15) + SourceIndex(0) -6 >Emitted(85, 16) Source(80, 16) + SourceIndex(0) +1->Emitted(82, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(82, 9) Source(80, 9) + SourceIndex(0) +3 >Emitted(82, 10) Source(80, 10) + SourceIndex(0) +4 >Emitted(82, 13) Source(80, 13) + SourceIndex(0) +5 >Emitted(82, 15) Source(80, 15) + SourceIndex(0) +6 >Emitted(82, 16) Source(80, 16) + SourceIndex(0) --- >>> x = x + 1; 1 >^^^^ @@ -1506,13 +1497,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > + 6 > 1 7 > ; -1 >Emitted(86, 5) Source(81, 5) + SourceIndex(0) -2 >Emitted(86, 6) Source(81, 6) + SourceIndex(0) -3 >Emitted(86, 9) Source(81, 9) + SourceIndex(0) -4 >Emitted(86, 10) Source(81, 10) + SourceIndex(0) -5 >Emitted(86, 13) Source(81, 13) + SourceIndex(0) -6 >Emitted(86, 14) Source(81, 14) + SourceIndex(0) -7 >Emitted(86, 15) Source(81, 15) + SourceIndex(0) +1 >Emitted(83, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(83, 6) Source(81, 6) + SourceIndex(0) +3 >Emitted(83, 9) Source(81, 9) + SourceIndex(0) +4 >Emitted(83, 10) Source(81, 10) + SourceIndex(0) +5 >Emitted(83, 13) Source(81, 13) + SourceIndex(0) +6 >Emitted(83, 14) Source(81, 14) + SourceIndex(0) +7 >Emitted(83, 15) Source(81, 15) + SourceIndex(0) --- >>>}; 1 > @@ -1523,9 +1514,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 >} 3 > ; -1 >Emitted(87, 1) Source(82, 1) + SourceIndex(0) -2 >Emitted(87, 2) Source(82, 2) + SourceIndex(0) -3 >Emitted(87, 3) Source(82, 3) + SourceIndex(0) +1 >Emitted(84, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(84, 2) Source(82, 2) + SourceIndex(0) +3 >Emitted(84, 3) Source(82, 3) + SourceIndex(0) --- >>>f(); 1-> @@ -1538,9 +1529,9 @@ sourceFile:sourceMapValidationStatements.ts 2 >f 3 > () 4 > ; -1->Emitted(88, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(88, 2) Source(83, 2) + SourceIndex(0) -3 >Emitted(88, 4) Source(83, 4) + SourceIndex(0) -4 >Emitted(88, 5) Source(83, 5) + SourceIndex(0) +1->Emitted(85, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(85, 2) Source(83, 2) + SourceIndex(0) +3 >Emitted(85, 4) Source(83, 4) + SourceIndex(0) +4 >Emitted(85, 5) Source(83, 5) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationStatements.js.map \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt index dc3446cb368..db23c2a19f6 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number': +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. Type 'void' is not assignable to type 'number'. @@ -11,7 +11,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara static bar(x: number): number { C.bar = () => { } // error ~~~~~ -!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number': +!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. !!! error TS2322: Type 'void' is not assignable to type 'number'. C.bar = (x) => x; // ok C.bar = (x: number) => 1; // ok diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt index bb2ba1747a4..59626540806 100644 --- a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2322: Type 'C' is not assignable to type 'A': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2322: Type 'C' is not assignable to type 'A'. Property 'name' is missing in type 'C'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2322: Type 'typeof B' is not assignable to type 'A': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2322: Type 'typeof B' is not assignable to type 'A'. Property 'name' is missing in type 'typeof B'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2322: Type 'C' is not assignable to type 'B': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2322: Type 'C' is not assignable to type 'B'. Property 'name' is missing in type 'C'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2322: Type 'typeof B' is not assignable to type 'B': +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2322: Type 'typeof B' is not assignable to type 'B'. Property 'name' is missing in type 'typeof B'. @@ -22,21 +22,21 @@ tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment. var a: A = new B(); a = new C(); // error name is missing ~ -!!! error TS2322: Type 'C' is not assignable to type 'A': +!!! error TS2322: Type 'C' is not assignable to type 'A'. !!! error TS2322: Property 'name' is missing in type 'C'. a = B; // error name is missing ~ -!!! error TS2322: Type 'typeof B' is not assignable to type 'A': +!!! error TS2322: Type 'typeof B' is not assignable to type 'A'. !!! error TS2322: Property 'name' is missing in type 'typeof B'. a = C; var b: B = new C(); // error name is missing ~ -!!! error TS2322: Type 'C' is not assignable to type 'B': +!!! error TS2322: Type 'C' is not assignable to type 'B'. !!! error TS2322: Property 'name' is missing in type 'C'. b = B; // error name is missing ~ -!!! error TS2322: Type 'typeof B' is not assignable to type 'B': +!!! error TS2322: Type 'typeof B' is not assignable to type 'B'. !!! error TS2322: Property 'name' is missing in type 'typeof B'. b = C; b = a; diff --git a/tests/baselines/reference/stringIndexerAssignments1.errors.txt b/tests/baselines/reference/stringIndexerAssignments1.errors.txt index 63e8430b7f4..3939ceba1bb 100644 --- a/tests/baselines/reference/stringIndexerAssignments1.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }': +tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. Index signature is missing in type '{ one: string; }'. -tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }': - Types of property 'one' are incompatible: +tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -11,11 +11,11 @@ tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ on var b: { one: number; two: string; }; x = a; ~ -!!! error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }': +!!! error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. !!! error TS2322: Index signature is missing in type '{ one: string; }'. x = b; // error ~ -!!! error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAssignments2.errors.txt b/tests/baselines/reference/stringIndexerAssignments2.errors.txt index 73e108f824f..256a9820a0c 100644 --- a/tests/baselines/reference/stringIndexerAssignments2.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/stringIndexerAssignments2.ts(19,1): error TS2322: Type 'C2' is not assignable to type 'C1': +tests/cases/compiler/stringIndexerAssignments2.ts(19,1): error TS2322: Type 'C2' is not assignable to type 'C1'. Index signature is missing in type 'C2'. -tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2322: Type 'C3' is not assignable to type 'C1': - Types of property 'one' are incompatible: +tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2322: Type 'C3' is not assignable to type 'C1'. + Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -26,10 +26,10 @@ tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2322: Type 'C3' x = a; ~ -!!! error TS2322: Type 'C2' is not assignable to type 'C1': +!!! error TS2322: Type 'C2' is not assignable to type 'C1'. !!! error TS2322: Index signature is missing in type 'C2'. x = b; ~ -!!! error TS2322: Type 'C3' is not assignable to type 'C1': -!!! error TS2322: Types of property 'one' are incompatible: +!!! error TS2322: Type 'C3' is not assignable to type 'C1'. +!!! error TS2322: Types of property 'one' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index 8039cdf01f0..e4e8de59185 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -24,9 +24,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }': - Index signatures are incompatible: - Type 'string | number | MyString | (() => void)' is not assignable to type 'string': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. + Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -160,9 +160,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: string; } = { ~ -!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'string | number | MyString | (() => void)' is not assignable to type 'string': +!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', b: 1, diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt index 4ac335c2465..faef7905453 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt @@ -4,9 +4,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(24,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(31,5): error TS2411: Property 'c' of type 'number' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(32,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }': - Index signatures are incompatible: - Type 'typeof A' is not assignable to type 'A': +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. + Index signatures are incompatible. + Type 'typeof A' is not assignable to type 'A'. Property 'foo' is missing in type 'typeof A'. @@ -60,9 +60,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: A } = { ~ -!!! error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }': -!!! error TS2322: Index signatures are incompatible: -!!! error TS2322: Type 'typeof A' is not assignable to type 'A': +!!! error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'typeof A' is not assignable to type 'A'. !!! error TS2322: Property 'foo' is missing in type 'typeof A'. a: A, b: B diff --git a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt index bdb3c9a056f..042d8227b78 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(7,7): error TS2416: Class 'D1' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(7,7): error TS2415: Class 'D1' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(95,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -13,9 +13,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D1 extends C3 { ~~ -!!! error TS2416: Class 'D1' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D1' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. foo: U; // error } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt index 1cf24d3c809..eeedf58ab73 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt @@ -1,111 +1,111 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(7,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,7): error TS2416: Class 'D2' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,7): error TS2415: Class 'D2' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(14,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,7): error TS2416: Class 'D3' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,7): error TS2415: Class 'D3' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(19,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(22,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(31,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(31,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,7): error TS2416: Class 'D6' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,7): error TS2415: Class 'D6' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(38,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,7): error TS2416: Class 'D7' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,7): error TS2415: Class 'D7' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(43,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,7): error TS2416: Class 'D8' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,7): error TS2415: Class 'D8' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(50,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(53,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(53,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,7): error TS2416: Class 'D10' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,7): error TS2415: Class 'D10' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(60,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,7): error TS2416: Class 'D11' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,7): error TS2415: Class 'D11' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(67,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,7): error TS2416: Class 'D12' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,7): error TS2415: Class 'D12' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(72,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(75,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(75,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,7): error TS2416: Class 'D14' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,7): error TS2415: Class 'D14' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(85,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(88,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(88,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,7): error TS2416: Class 'D16' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,7): error TS2415: Class 'D16' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(95,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,7): error TS2416: Class 'D17' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,7): error TS2415: Class 'D17' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(100,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,7): error TS2416: Class 'D18' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,7): error TS2415: Class 'D18' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(107,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,7): error TS2416: Class 'D19' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,7): error TS2415: Class 'D19' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(112,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(115,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(115,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,7): error TS2416: Class 'D21' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,7): error TS2415: Class 'D21' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(122,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,7): error TS2416: Class 'D22' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,7): error TS2415: Class 'D22' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(129,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,7): error TS2416: Class 'D23' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,7): error TS2415: Class 'D23' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(134,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,7): error TS2416: Class 'D24' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,7): error TS2415: Class 'D24' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -114,20 +114,20 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(142,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(149,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(149,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,7): error TS2416: Class 'D27' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,7): error TS2415: Class 'D27' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(156,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,7): error TS2416: Class 'D28' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,7): error TS2415: Class 'D28' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(161,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,7): error TS2416: Class 'D29' incorrectly extends base class 'C3': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,7): error TS2415: Class 'D29' incorrectly extends base class 'C3'. + Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -150,9 +150,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D2 extends C3 { ~~ -!!! error TS2416: Class 'D2' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D2' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; @@ -163,9 +163,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D3 extends C3 { ~~ -!!! error TS2416: Class 'D3' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D3' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; @@ -196,9 +196,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D6 extends C3 { ~~ -!!! error TS2416: Class 'D6' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D6' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -211,9 +211,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D7 extends C3 { ~~ -!!! error TS2416: Class 'D7' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Class 'D7' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -228,9 +228,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of V and itself class D8 extends C3 { ~~ -!!! error TS2416: Class 'D8' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D8' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -252,9 +252,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D10 extends C3 { ~~~ -!!! error TS2416: Class 'D10' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Class 'D10' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -269,9 +269,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of itself class D11 extends C3 { ~~~ -!!! error TS2416: Class 'D11' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D11' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -284,9 +284,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D12 extends C3 { ~~~ -!!! error TS2416: Class 'D12' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D12' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -311,9 +311,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // should all work class D14 extends C3 { ~~~ -!!! error TS2416: Class 'D14' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'Date'. +!!! error TS2415: Class 'D14' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Date'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -335,9 +335,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D16 extends C3 { ~~~ -!!! error TS2416: Class 'D16' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D16' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -350,9 +350,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D17 extends C3 { ~~~ -!!! error TS2416: Class 'D17' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Class 'D17' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -367,9 +367,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of V, Date and itself class D18 extends C3 { ~~~ -!!! error TS2416: Class 'D18' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'Date'. +!!! error TS2415: Class 'D18' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Date'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -382,9 +382,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D19 extends C3 { ~~~ -!!! error TS2416: Class 'D19' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D19' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -406,9 +406,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D21 extends C3 { ~~~ -!!! error TS2416: Class 'D21' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Class 'D21' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -423,9 +423,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // only a subtype of itself and Date class D22 extends C3 { ~~~ -!!! error TS2416: Class 'D22' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'Date'. +!!! error TS2415: Class 'D22' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Date'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -438,9 +438,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D23 extends C3 { ~~~ -!!! error TS2416: Class 'D23' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D23' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -453,9 +453,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D24 extends C3 { ~~~ -!!! error TS2416: Class 'D24' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D24' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -488,9 +488,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D27 extends C3 { ~~~ -!!! error TS2416: Class 'D27' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'Date' is not assignable to type 'T'. +!!! error TS2415: Class 'D27' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'Date' is not assignable to type 'T'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -503,9 +503,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D28 extends C3 { ~~~ -!!! error TS2416: Class 'D28' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'Date' is not assignable to type 'U'. +!!! error TS2415: Class 'D28' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'Date' is not assignable to type 'U'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ @@ -518,9 +518,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D29 extends C3 { ~~~ -!!! error TS2416: Class 'D29' incorrectly extends base class 'C3': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'Date' is not assignable to type 'V'. +!!! error TS2415: Class 'D29' incorrectly extends base class 'C3'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'Date' is not assignable to type 'V'. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt index 872cb8ef965..a9b025ccc77 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.errors.txt @@ -1,22 +1,22 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(45,7): error TS2416: Class 'D3' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: - Type 'V' is not assignable to type 'Foo': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(45,7): error TS2415: Class 'D3' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. + Type 'V' is not assignable to type 'Foo'. Property 'foo' is missing in type '{}'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(47,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'Foo'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(55,7): error TS2416: Class 'D5' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(55,7): error TS2415: Class 'D5' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(57,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(60,7): error TS2416: Class 'D6' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(60,7): error TS2415: Class 'D6' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(62,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(65,7): error TS2416: Class 'D7' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(65,7): error TS2415: Class 'D7' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(67,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(75,7): error TS2416: Class 'D9' incorrectly extends base class 'B1': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(75,7): error TS2415: Class 'D9' incorrectly extends base class 'B1'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints4.ts(77,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. @@ -68,10 +68,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D3 extends B1 { ~~ -!!! error TS2416: Class 'D3' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'Foo': -!!! error TS2416: Property 'foo' is missing in type '{}'. +!!! error TS2415: Class 'D3' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'Foo'. +!!! error TS2415: Property 'foo' is missing in type '{}'. [x: string]: Foo; foo: V; // error ~~~~~~~ @@ -85,9 +85,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D5 extends B1 { ~~ -!!! error TS2416: Class 'D5' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D5' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. [x: string]: T; foo: U; // error ~~~~~~~ @@ -96,9 +96,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D6 extends B1 { ~~ -!!! error TS2416: Class 'D6' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D6' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. [x: string]: T; foo: V; // error ~~~~~~~ @@ -107,9 +107,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D7 extends B1 { ~~ -!!! error TS2416: Class 'D7' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D7' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. [x: string]: U; foo: T; // error ~~~~~~~ @@ -123,9 +123,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D9 extends B1 { ~~ -!!! error TS2416: Class 'D9' incorrectly extends base class 'B1': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D9' incorrectly extends base class 'B1'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. [x: string]: U; foo: V; // error ~~~~~~~ diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt index f4b1d7ef041..867b622cf1a 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt @@ -4,22 +4,22 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,11): error TS2416: Class 'D2' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,11): error TS2415: Class 'D2' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,11): error TS2416: Class 'D3' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,11): error TS2415: Class 'D3' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(73,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,11): error TS2416: Class 'D4' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,11): error TS2415: Class 'D4' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -28,22 +28,22 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,11): error TS2416: Class 'D6' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,11): error TS2415: Class 'D6' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(88,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,11): error TS2416: Class 'D7' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,11): error TS2415: Class 'D7' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(93,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,11): error TS2416: Class 'D8' incorrectly extends base class 'Base': - Types of property 'foo' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,11): error TS2415: Class 'D8' incorrectly extends base class 'Base'. + Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. @@ -167,9 +167,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D2, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D2' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Class 'D2' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'T'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -184,9 +184,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D3, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D3' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Class 'D3' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'T'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -201,9 +201,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D4, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D4' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Class 'D4' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'U'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -229,9 +229,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D6, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D6' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Class 'D6' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'U'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -246,9 +246,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D7, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D7' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Class 'D7' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'V'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ @@ -263,9 +263,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf class D8, U extends Foo, V extends Foo> extends Base { ~~ -!!! error TS2416: Class 'D8' incorrectly extends base class 'Base': -!!! error TS2416: Types of property 'foo' are incompatible: -!!! error TS2416: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Class 'D8' incorrectly extends base class 'Base'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'V'. ~~~~~~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt index 918d219cec5..b5d23da2241 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type '(x: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. @@ -27,9 +27,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: number) => number' is not assignable to type '() => number'. a: (x: number) => number; // error, too many required params } @@ -61,9 +61,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. a3: (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt index 4392862d189..f4a141ff390 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithRestParameters.errors.txt @@ -1,57 +1,57 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(18,11): error TS2429: Interface 'I1C' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: - Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'args' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(18,11): error TS2430: Interface 'I1C' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. + Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'args' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(34,11): error TS2429: Interface 'I3B' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: - Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': - Types of parameters 'x' and 'args' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(34,11): error TS2430: Interface 'I3B' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. + Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. + Types of parameters 'x' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(60,11): error TS2429: Interface 'I6C' incorrectly extends interface 'Base': - Types of property 'a2' are incompatible: - Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(60,11): error TS2430: Interface 'I6C' incorrectly extends interface 'Base'. + Types of property 'a2' are incompatible. + Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(90,11): error TS2429: Interface 'I10B' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(90,11): error TS2430: Interface 'I10B' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(94,11): error TS2429: Interface 'I10C' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'z' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(94,11): error TS2430: Interface 'I10C' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(98,11): error TS2429: Interface 'I10D' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'x' and 'x' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(98,11): error TS2430: Interface 'I10D' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(102,11): error TS2429: Interface 'I10E' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: - Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': - Types of parameters 'z' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(102,11): error TS2430: Interface 'I10E' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. + Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Types of parameters 'z' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(110,11): error TS2429: Interface 'I12' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(110,11): error TS2430: Interface 'I12' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(118,11): error TS2429: Interface 'I14' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'y' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(118,11): error TS2430: Interface 'I14' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(126,11): error TS2429: Interface 'I16' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'args' and 'z' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(126,11): error TS2430: Interface 'I16' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(130,11): error TS2429: Interface 'I17' incorrectly extends interface 'Base': - Types of property 'a4' are incompatible: - Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': - Types of parameters 'args' and 'y' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithRestParameters.ts(130,11): error TS2430: Interface 'I17' incorrectly extends interface 'Base'. + Types of property 'a4' are incompatible. + Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. + Types of parameters 'args' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -75,11 +75,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I1C extends Base { ~~~ -!!! error TS2429: Interface 'I1C' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'args' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I1C' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a: (...args: string[]) => number; // error, type mismatch } @@ -97,11 +97,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3B extends Base { ~~~ -!!! error TS2429: Interface 'I3B' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number': -!!! error TS2429: Types of parameters 'x' and 'args' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I3B' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2430: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a: (x?: string) => number; // error, incompatible type } @@ -129,11 +129,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I6C extends Base { ~~~ -!!! error TS2429: Interface 'I6C' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a2' are incompatible: -!!! error TS2429: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'z' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I6C' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a2' are incompatible. +!!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a2: (x: number, ...args: string[]) => number; // error } @@ -165,41 +165,41 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10B extends Base { ~~~~ -!!! error TS2429: Interface 'I10B' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I10B' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a3: (x: number, y?: number, z?: number) => number; // error } interface I10C extends Base { ~~~~ -!!! error TS2429: Interface 'I10C' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'z' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I10C' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a3: (x: number, ...z: number[]) => number; // error } interface I10D extends Base { ~~~~ -!!! error TS2429: Interface 'I10D' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'x' and 'x' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I10D' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a3: (x: string, y?: string, z?: string) => number; // error, incompatible types } interface I10E extends Base { ~~~~ -!!! error TS2429: Interface 'I10E' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'z' and 'z' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I10E' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: number, ...z: string[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'z' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a3: (x: number, ...z: string[]) => number; // error } @@ -209,11 +209,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I12 extends Base { ~~~ -!!! error TS2429: Interface 'I12' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I12' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (x?: number, y?: number) => number; // error, type mismatch } @@ -223,11 +223,11 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I14 extends Base { ~~~ -!!! error TS2429: Interface 'I14' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'y' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I14' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (x: number, y?: number) => number; // error, second param has type mismatch } @@ -237,21 +237,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I16 extends Base { ~~~ -!!! error TS2429: Interface 'I16' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'z' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I16' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'number'. a4: (x: number, ...args: string[]) => number; // error, rest param has type mismatch } interface I17 extends Base { ~~~ -!!! error TS2429: Interface 'I17' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a4' are incompatible: -!!! error TS2429: Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number': -!!! error TS2429: Types of parameters 'args' and 'y' are incompatible: -!!! error TS2429: Type 'number' is not assignable to type 'string'. +!!! error TS2430: Interface 'I17' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a4' are incompatible. +!!! error TS2430: Type '(...args: number[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2430: Types of parameters 'args' and 'y' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a4: (...args: number[]) => number; // error } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt index b42e93b0f3b..d3c399477d6 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithCallSignaturesWithSpecializedSignatures.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'. Type 'string' is not assignable to type 'number'. @@ -76,10 +76,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: string) => string' is not assignable to type '{ (x: 'a'): number; (x: string): number; }'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: (x: string) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt index 916813a4306..e041b1cdce0 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(19,11): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type 'new (x: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithOptionalParameters.ts(49,11): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. @@ -27,9 +27,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: number) => number' is not assignable to type 'new () => number'. a: new (x: number) => number; // error, too many required params } @@ -61,9 +61,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. a3: new (x: number, y: number) => number; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt index c0ae6d2b9f2..03cc6de0ca4 100644 --- a/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt +++ b/tests/baselines/reference/subtypingWithConstructSignaturesWithSpecializedSignatures.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2429: Interface 'I2' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: - Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts(70,15): error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. + Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'. Type 'string' is not assignable to type 'number'. @@ -76,10 +76,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW // S's interface I2 extends Base2 { ~~ -!!! error TS2429: Interface 'I2' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }': -!!! error TS2429: Type 'string' is not assignable to type 'number'. +!!! error TS2430: Interface 'I2' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: string) => string' is not assignable to type '{ new (x: 'a'): number; new (x: string): number; }'. +!!! error TS2430: Type 'string' is not assignable to type 'number'. // N's a: new (x: string) => string; // error because base returns non-void; } diff --git a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt index 31582f29bdc..e8f50236cba 100644 --- a/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericCallSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. @@ -40,9 +40,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. a: (x: T) => T; // error, too many required params } @@ -74,9 +74,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. a3: (x: T, y: T) => T; // error, too many required params } @@ -136,9 +136,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. a: (x: T) => T; } @@ -170,9 +170,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. a3: (x: T, y: T) => T; } @@ -232,9 +232,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type '(x: T) => T' is not assignable to type '() => T'. a: (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -266,9 +266,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: T) => T'. a3: (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt index 2759801416a..27066058238 100644 --- a/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/subtypingWithGenericConstructSignaturesWithOptionalParameters.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(20,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base'. + Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(50,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base'. + Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(108,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(138,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2429: Interface 'I3' incorrectly extends interface 'Base2': - Types of property 'a' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(196,15): error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. + Types of property 'a' are incompatible. Type 'new (x: T) => T' is not assignable to type 'new () => T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2429: Interface 'I10' incorrectly extends interface 'Base2': - Types of property 'a3' are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts(226,15): error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. + Types of property 'a3' are incompatible. Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. @@ -40,9 +40,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. a: new (x: T) => T; // error, too many required params } @@ -74,9 +74,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. a3: new (x: T, y: T) => T; // error, too many required params } @@ -136,9 +136,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. a: new (x: T) => T; } @@ -170,9 +170,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. a3: new (x: T, y: T) => T; } @@ -232,9 +232,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I3 extends Base2 { ~~ -!!! error TS2429: Interface 'I3' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a' are incompatible: -!!! error TS2429: Type 'new (x: T) => T' is not assignable to type 'new () => T'. +!!! error TS2430: Interface 'I3' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a' are incompatible. +!!! error TS2430: Type 'new (x: T) => T' is not assignable to type 'new () => T'. a: new (x: T) => T; // error, not identical and contextual signature instatiation can't make inference from T to T } @@ -266,9 +266,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface I10 extends Base2 { ~~~ -!!! error TS2429: Interface 'I10' incorrectly extends interface 'Base2': -!!! error TS2429: Types of property 'a3' are incompatible: -!!! error TS2429: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. +!!! error TS2430: Interface 'I10' incorrectly extends interface 'Base2'. +!!! error TS2430: Types of property 'a3' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: T) => T'. a3: new (x: T, y: T) => T; // error, too many required params } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt index f56a8c31fa4..e5ff0d47ca3 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -40,17 +40,17 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: number]: Derived; // error, BUG? } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: number]: Derived2; // error, BUG? } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt index d8a33c93c81..01b581b7306 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer2.errors.txt @@ -1,17 +1,16 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(11,11): error TS2429: Interface 'B' incorrectly extends interface 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(24,25): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(32,15): error TS2429: Interface 'B3' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(24,25): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(32,15): error TS2430: Interface 'B3' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(36,15): error TS2429: Interface 'B4' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(36,15): error TS2430: Interface 'B4' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(40,15): error TS2429: Interface 'B5' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. [x: number]: Base; // error } @@ -46,8 +45,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. [x: number]: Derived; // error } @@ -57,25 +55,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'T'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'T'. [x: number]: Base; // error } interface B4 extends A { ~~ -!!! error TS2429: Interface 'B4' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived' is not assignable to type 'T'. +!!! error TS2430: Interface 'B4' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived' is not assignable to type 'T'. [x: number]: Derived; // error } interface B5 extends A { ~~ -!!! error TS2429: Interface 'B5' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2430: Interface 'B5' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived2' is not assignable to type 'T'. [x: number]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt index 2b20970cc7f..4da8bc0290a 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.errors.txt @@ -1,17 +1,16 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(24,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(24,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(40,11): error TS2416: Class 'B5' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'Base'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'Base'. [x: number]: Base; // error } @@ -46,8 +45,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. [x: number]: Derived; // error } @@ -57,25 +55,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'T'. [x: number]: Base; // error } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: number]: Derived; // error } class B5 extends A { ~~ -!!! error TS2416: Class 'B5' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B5' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: number]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt index cbc5236edec..f3c9cc25a10 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Derived'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,11): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'string' is not assignable to type 'T'. @@ -26,10 +26,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'String'. [x: number]: string; // error } @@ -40,21 +40,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: number]: string; // error } class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'T'. [x: number]: string; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt index 818a9591309..be4afeafcde 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer5.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(11,7): error TS2421: Class 'B' incorrectly implements interface 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(11,7): error TS2420: Class 'B' incorrectly implements interface 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(32,11): error TS2421: Class 'B3' incorrectly implements interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(36,11): error TS2421: Class 'B4' incorrectly implements interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(36,11): error TS2420: Class 'B4' incorrectly implements interface 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(40,11): error TS2421: Class 'B5' incorrectly implements interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer5.ts(40,11): error TS2420: Class 'B5' incorrectly implements interface 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -26,10 +26,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B implements A { ~ -!!! error TS2421: Class 'B' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Base' is not assignable to type 'Derived': -!!! error TS2421: Property 'bar' is missing in type 'Base'. +!!! error TS2420: Class 'B' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2420: Property 'bar' is missing in type 'Base'. [x: string]: Base; // error } @@ -52,25 +52,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 implements A { ~~ -!!! error TS2421: Class 'B3' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Base' is not assignable to type 'T'. +!!! error TS2420: Class 'B3' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Base' is not assignable to type 'T'. [x: string]: Base; // error } class B4 implements A { ~~ -!!! error TS2421: Class 'B4' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Derived' is not assignable to type 'T'. +!!! error TS2420: Class 'B4' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } class B5 implements A { ~~ -!!! error TS2421: Class 'B5' incorrectly implements interface 'A': -!!! error TS2421: Index signatures are incompatible: -!!! error TS2421: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2420: Class 'B5' incorrectly implements interface 'A'. +!!! error TS2420: Index signatures are incompatible. +!!! error TS2420: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt index fa1d3c43fa4..e292c0867a7 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt @@ -1,27 +1,22 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(12,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(22,7): error TS2416: Class 'B2' incorrectly extends base class 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(32,7): error TS2416: Class 'B3' incorrectly extends base class 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(43,11): error TS2416: Class 'B' incorrectly extends base class 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(53,11): error TS2416: Class 'B2' incorrectly extends base class 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(63,11): error TS2416: Class 'B3' incorrectly extends base class 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(12,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(22,7): error TS2415: Class 'B2' incorrectly extends base class 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(32,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(43,11): error TS2415: Class 'B' incorrectly extends base class 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(53,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(63,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts (6 errors) ==== @@ -38,10 +33,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Types of property 'bar' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Types of property 'bar' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } @@ -53,10 +48,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Types of property '2.0' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Types of property '2.0' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. 1: Derived; // ok 2: string; // error } @@ -68,10 +62,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Types of property ''2.0'' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Types of property ''2.0'' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. '1': Derived; // ok '2.0': string; // error } @@ -84,10 +77,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Types of property 'bar' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Types of property 'bar' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. foo: Derived2; // ok bar: string; // error } @@ -99,10 +91,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Types of property '2.0' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Types of property '2.0' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. 1: Derived2; // ok 2: string; // error } @@ -114,10 +105,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Types of property ''2.0'' are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Types of property ''2.0'' are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. '1': Derived2; // ok '2.0': string; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt index 73421a09015..3d46a6e5dc2 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt @@ -1,27 +1,22 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(17,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(27,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(37,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(50,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(60,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'string' is not assignable to type 'Base': - Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(70,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(50,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(60,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'string' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(70,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'string' is not assignable to type 'Base'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts (6 errors) ==== @@ -43,10 +38,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. +!!! error TS2430: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } @@ -58,10 +53,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. 1: Derived; // ok 2: string; // error } @@ -73,10 +67,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. '1': Derived; // ok '2.0': string; // error } @@ -91,10 +84,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. foo?: Derived; // ok bar?: string; // error } @@ -106,10 +98,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. 1?: Derived; // ok 2?: string; // error } @@ -121,10 +112,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'string' is not assignable to type 'Base': -!!! error TS2429: Property 'foo' is missing in type 'String'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'string' is not assignable to type 'Base'. '1'?: Derived; // ok '2.0'?: string; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt index 47d34e19b31..eaea4db7d62 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers3.errors.txt @@ -1,27 +1,22 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(17,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(27,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(37,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(49,15): error TS2429: Interface 'B' incorrectly extends interface 'A': - Types of property 'bar' are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(59,15): error TS2429: Interface 'B2' incorrectly extends interface 'A2': - Types of property '2.0' are incompatible: - Type 'Base' is not assignable to type 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(69,15): error TS2429: Interface 'B3' incorrectly extends interface 'A3': - Types of property ''2.0'' are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(37,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(49,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Types of property 'bar' are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(59,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. + Types of property '2.0' are incompatible. + Type 'Base' is not assignable to type 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts(69,15): error TS2430: Interface 'B3' incorrectly extends interface 'A3'. + Types of property ''2.0'' are incompatible. + Type 'Base' is not assignable to type 'Derived'. ==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers3.ts (6 errors) ==== @@ -43,10 +38,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. foo: Derived; // ok bar: Base; // error } @@ -58,10 +53,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. 1: Derived; // ok 2: Base; // error } @@ -73,10 +67,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. '1': Derived; // ok '2.0': Base; // error } @@ -90,10 +83,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Types of property 'bar' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'bar' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. foo?: Derived; // ok bar?: Base; // error } @@ -105,10 +97,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B2 extends A2 { ~~ -!!! error TS2429: Interface 'B2' incorrectly extends interface 'A2': -!!! error TS2429: Types of property '2.0' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B2' incorrectly extends interface 'A2'. +!!! error TS2430: Types of property '2.0' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. 1?: Derived; // ok 2?: Base; // error } @@ -120,10 +111,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A3 { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A3': -!!! error TS2429: Types of property ''2.0'' are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A3'. +!!! error TS2430: Types of property ''2.0'' are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. '1'?: Derived; // ok '2.0'?: Base; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt index 3f646666ad1..7fd025721ec 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(16,11): error TS2421: Class 'B' incorrectly implements interface 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(16,11): error TS2420: Class 'B' incorrectly implements interface 'A'. Property 'foo' is missing in type 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(24,11): error TS2421: Class 'B2' incorrectly implements interface 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(24,11): error TS2420: Class 'B2' incorrectly implements interface 'A2'. Property '1' is missing in type 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(32,11): error TS2421: Class 'B3' incorrectly implements interface 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers5.ts(32,11): error TS2420: Class 'B3' incorrectly implements interface 'A3'. Property ''1'' is missing in type 'B3'. @@ -24,8 +24,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B implements A { ~ -!!! error TS2421: Class 'B' incorrectly implements interface 'A': -!!! error TS2421: Property 'foo' is missing in type 'B'. +!!! error TS2420: Class 'B' incorrectly implements interface 'A'. +!!! error TS2420: Property 'foo' is missing in type 'B'. fooo: Derived; // error } @@ -35,8 +35,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 implements A2 { ~~ -!!! error TS2421: Class 'B2' incorrectly implements interface 'A2': -!!! error TS2421: Property '1' is missing in type 'B2'. +!!! error TS2420: Class 'B2' incorrectly implements interface 'A2'. +!!! error TS2420: Property '1' is missing in type 'B2'. 2: Derived; // error } @@ -46,8 +46,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 implements A3 { ~~ -!!! error TS2421: Class 'B3' incorrectly implements interface 'A3': -!!! error TS2421: Property ''1'' is missing in type 'B3'. +!!! error TS2420: Class 'B3' incorrectly implements interface 'A3'. +!!! error TS2420: Property ''1'' is missing in type 'B3'. '1.0': Derived; // error } } diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt index 09dfa1696df..50646f64eae 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(15,7): error TS2416: Class 'B' incorrectly extends base class 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(15,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'B' but not in type 'A'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(23,7): error TS2416: Class 'B2' incorrectly extends base class 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(23,7): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'B2' but not in type 'A2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(31,7): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility.ts(31,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'B3' but not in type 'A3'. @@ -23,8 +23,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Property 'foo' is private in type 'B' but not in type 'A'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Property 'foo' is private in type 'B' but not in type 'A'. private foo: Derived; // error } @@ -34,8 +34,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Property '1' is private in type 'B2' but not in type 'A2'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Property '1' is private in type 'B2' but not in type 'A2'. private 1: Derived; // error } @@ -45,7 +45,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property ''1'' is private in type 'B3' but not in type 'A3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property ''1'' is private in type 'B3' but not in type 'A3'. private '1': Derived; // error } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt index 9af7e894b27..083e96eaf5f 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(16,11): error TS2416: Class 'B' incorrectly extends base class 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(16,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'A' but not in type 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(24,11): error TS2416: Class 'B2' incorrectly extends base class 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(24,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'A2' but not in type 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'A3' but not in type 'B3'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(42,11): error TS2416: Class 'B' incorrectly extends base class 'A': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(42,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Property 'foo' is private in type 'A' but not in type 'B'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(50,11): error TS2416: Class 'B2' incorrectly extends base class 'A2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(50,11): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Property '1' is private in type 'A2' but not in type 'B2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2416: Class 'B3' incorrectly extends base class 'A3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersAccessibility2.ts(58,11): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property ''1'' is private in type 'A3' but not in type 'B3'. @@ -30,8 +30,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Property 'foo' is private in type 'A' but not in type 'B'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Property 'foo' is private in type 'A' but not in type 'B'. public foo: Derived; // error } @@ -41,8 +41,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Property '1' is private in type 'A2' but not in type 'B2'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Property '1' is private in type 'A2' but not in type 'B2'. public 1: Derived; // error } @@ -52,8 +52,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property ''1'' is private in type 'A3' but not in type 'B3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property ''1'' is private in type 'A3' but not in type 'B3'. public '1': Derived; // error } } @@ -65,8 +65,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Property 'foo' is private in type 'A' but not in type 'B'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Property 'foo' is private in type 'A' but not in type 'B'. foo: Derived; // error } @@ -76,8 +76,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B2 extends A2 { ~~ -!!! error TS2416: Class 'B2' incorrectly extends base class 'A2': -!!! error TS2416: Property '1' is private in type 'A2' but not in type 'B2'. +!!! error TS2415: Class 'B2' incorrectly extends base class 'A2'. +!!! error TS2415: Property '1' is private in type 'A2' but not in type 'B2'. 1: Derived; // error } @@ -87,8 +87,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A3 { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A3': -!!! error TS2416: Property ''1'' is private in type 'A3' but not in type 'B3'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A3'. +!!! error TS2415: Property ''1'' is private in type 'A3' but not in type 'B3'. '1': Derived; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt index ac17303572d..89d5ef7915c 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(10,11): error TS2429: Interface 'S' incorrectly extends interface 'T': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(10,11): error TS2430: Interface 'S' incorrectly extends interface 'T'. Property 'Foo' is optional in type 'S' but required in type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(18,11): error TS2429: Interface 'S2' incorrectly extends interface 'T2': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(18,11): error TS2430: Interface 'S2' incorrectly extends interface 'T2'. Property '1' is optional in type 'S2' but required in type 'T2'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(26,11): error TS2429: Interface 'S3' incorrectly extends interface 'T3': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality2.ts(26,11): error TS2430: Interface 'S3' incorrectly extends interface 'T3'. Property ''1'' is optional in type 'S3' but required in type 'T3'. @@ -18,8 +18,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface S extends T { ~ -!!! error TS2429: Interface 'S' incorrectly extends interface 'T': -!!! error TS2429: Property 'Foo' is optional in type 'S' but required in type 'T'. +!!! error TS2430: Interface 'S' incorrectly extends interface 'T'. +!!! error TS2430: Property 'Foo' is optional in type 'S' but required in type 'T'. Foo?: Derived // error } @@ -29,8 +29,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface S2 extends T2 { ~~ -!!! error TS2429: Interface 'S2' incorrectly extends interface 'T2': -!!! error TS2429: Property '1' is optional in type 'S2' but required in type 'T2'. +!!! error TS2430: Interface 'S2' incorrectly extends interface 'T2'. +!!! error TS2430: Property '1' is optional in type 'S2' but required in type 'T2'. 1?: Derived; // error } @@ -40,8 +40,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface S3 extends T3 { ~~ -!!! error TS2429: Interface 'S3' incorrectly extends interface 'T3': -!!! error TS2429: Property ''1'' is optional in type 'S3' but required in type 'T3'. +!!! error TS2430: Interface 'S3' incorrectly extends interface 'T3'. +!!! error TS2430: Property ''1'' is optional in type 'S3' but required in type 'T3'. '1'?: Derived; // error } diff --git a/tests/baselines/reference/subtypingWithStringIndexer.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer.errors.txt index db7e6bd7d47..4ad0f665425 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -40,17 +40,17 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } diff --git a/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt index 7116f4d14af..cfe8f2b8e1d 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer2.errors.txt @@ -1,17 +1,16 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(11,11): error TS2429: Interface 'B' incorrectly extends interface 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(11,11): error TS2430: Interface 'B' incorrectly extends interface 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(24,25): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(32,15): error TS2429: Interface 'B3' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(24,25): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(32,15): error TS2430: Interface 'B3' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(36,15): error TS2429: Interface 'B4' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(36,15): error TS2430: Interface 'B4' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(40,15): error TS2429: Interface 'B5' incorrectly extends interface 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer2.ts(40,15): error TS2430: Interface 'B5' incorrectly extends interface 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~ -!!! error TS2429: Interface 'B' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'Derived': -!!! error TS2429: Property 'bar' is missing in type 'Base'. +!!! error TS2430: Interface 'B' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2430: Property 'bar' is missing in type 'Base'. [x: string]: Base; // error } @@ -46,8 +45,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. [x: string]: Derived; // error } @@ -57,25 +55,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW interface B3 extends A { ~~ -!!! error TS2429: Interface 'B3' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Base' is not assignable to type 'T'. +!!! error TS2430: Interface 'B3' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Base' is not assignable to type 'T'. [x: string]: Base; // error } interface B4 extends A { ~~ -!!! error TS2429: Interface 'B4' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived' is not assignable to type 'T'. +!!! error TS2430: Interface 'B4' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } interface B5 extends A { ~~ -!!! error TS2429: Interface 'B5' incorrectly extends interface 'A': -!!! error TS2429: Index signatures are incompatible: -!!! error TS2429: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2430: Interface 'B5' incorrectly extends interface 'A'. +!!! error TS2430: Index signatures are incompatible. +!!! error TS2430: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt index 333e5a39c84..91c9f7fd47e 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer3.errors.txt @@ -1,17 +1,16 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'Base' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(24,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': - Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(32,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(24,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(32,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Base' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(36,11): error TS2416: Class 'B4' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(36,11): error TS2415: Class 'B4' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(40,11): error TS2416: Class 'B5' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer3.ts(40,11): error TS2415: Class 'B5' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. @@ -28,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'Base'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'Base'. [x: string]: Base; // error } @@ -46,8 +45,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. [x: string]: Derived; // error } @@ -57,25 +55,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Base' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Base' is not assignable to type 'T'. [x: string]: Base; // error } class B4 extends A { ~~ -!!! error TS2416: Class 'B4' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived' is not assignable to type 'T'. +!!! error TS2415: Class 'B4' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived' is not assignable to type 'T'. [x: string]: Derived; // error } class B5 extends A { ~~ -!!! error TS2416: Class 'B5' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2415: Class 'B5' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'Derived2' is not assignable to type 'T'. [x: string]: Derived2; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt index e788ede4656..6df716791c2 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(11,7): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Derived'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,11): error TS2416: Class 'B' incorrectly extends base class 'A': - Index signatures are incompatible: - Type 'string' is not assignable to type 'Base': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. + Index signatures are incompatible. + Type 'string' is not assignable to type 'Base'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,21): error TS2343: Type 'Base' does not satisfy the constraint 'Derived': +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,21): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2416: Class 'B3' incorrectly extends base class 'A': - Index signatures are incompatible: +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. + Index signatures are incompatible. Type 'string' is not assignable to type 'T'. @@ -26,10 +26,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Derived': -!!! error TS2416: Property 'bar' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Derived'. +!!! error TS2415: Property 'bar' is missing in type 'String'. [x: string]: string; // error } @@ -40,21 +40,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW class B extends A { ~ -!!! error TS2416: Class 'B' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'Base': -!!! error TS2416: Property 'foo' is missing in type 'String'. +!!! error TS2415: Class 'B' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'Base'. +!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~~~~ -!!! error TS2343: Type 'Base' does not satisfy the constraint 'Derived': -!!! error TS2343: Property 'bar' is missing in type 'Base'. +!!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. +!!! error TS2344: Property 'bar' is missing in type 'Base'. [x: string]: string; // error } class B3 extends A { ~~ -!!! error TS2416: Class 'B3' incorrectly extends base class 'A': -!!! error TS2416: Index signatures are incompatible: -!!! error TS2416: Type 'string' is not assignable to type 'T'. +!!! error TS2415: Class 'B3' incorrectly extends base class 'A'. +!!! error TS2415: Index signatures are incompatible. +!!! error TS2415: Type 'string' is not assignable to type 'T'. [x: string]: string; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/superCallAssignResult.errors.txt b/tests/baselines/reference/superCallAssignResult.errors.txt index 5a710c2327a..bc9e2a0dc55 100644 --- a/tests/baselines/reference/superCallAssignResult.errors.txt +++ b/tests/baselines/reference/superCallAssignResult.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2323: Type 'number' is not assignable to type 'void'. +tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type 'number' is not assignable to type 'void'. ==== tests/cases/compiler/superCallAssignResult.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2323: Type 'number' var x = super(5); // Should be of type void, not E. x = 5; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. } } \ No newline at end of file diff --git a/tests/baselines/reference/switchAssignmentCompat.errors.txt b/tests/baselines/reference/switchAssignmentCompat.errors.txt index c4695a6e8eb..6a2755365ab 100644 --- a/tests/baselines/reference/switchAssignmentCompat.errors.txt +++ b/tests/baselines/reference/switchAssignmentCompat.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2323: Type 'typeof Foo' is not assignable to type 'number'. +tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2322: Type 'typeof Foo' is not assignable to type 'number'. ==== tests/cases/compiler/switchAssignmentCompat.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2323: Type 'typeof switch (0) { case Foo: break; // Error expected ~~~ -!!! error TS2323: Type 'typeof Foo' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof Foo' is not assignable to type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/switchAssignmentCompat.js b/tests/baselines/reference/switchAssignmentCompat.js index 28384f8a271..7b3f2af80bb 100644 --- a/tests/baselines/reference/switchAssignmentCompat.js +++ b/tests/baselines/reference/switchAssignmentCompat.js @@ -13,6 +13,5 @@ var Foo = (function () { return Foo; })(); switch (0) { - case Foo: - break; + case Foo: break; } diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt index f5f5c6a3c64..de739af007d 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2323: Type 'typeof Foo' is not assignable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2323: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2322: Type 'typeof Foo' is not assignable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2322: Type 'boolean' is not assignable to type 'number'. ==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ==== @@ -9,14 +9,14 @@ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2323: T switch (0) { case Foo: break; // Error ~~~ -!!! error TS2323: Type 'typeof Foo' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof Foo' is not assignable to type 'number'. case "sss": break; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. case 123: break; // No Error case true: break; // Error ~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. } var s: any = 0; diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js index f8d5b446a8d..a35dc633e35 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js @@ -25,23 +25,15 @@ var Foo = (function () { return Foo; })(); switch (0) { - case Foo: - break; - case "sss": - break; - case 123: - break; - case true: - break; + case Foo: break; + case "sss": break; + case 123: break; + case true: break; } var s = 0; switch (s) { - case Foo: - break; - case "sss": - break; - case 123: - break; - case true: - break; + case Foo: break; + case "sss": break; + case 123: break; + case true: break; } diff --git a/tests/baselines/reference/switchFallThroughs.js b/tests/baselines/reference/switchFallThroughs.js index b38c6b6f0ab..53f221bd467 100644 --- a/tests/baselines/reference/switchFallThroughs.js +++ b/tests/baselines/reference/switchFallThroughs.js @@ -26,10 +26,9 @@ function R1(index) { var a = 'a'; return a; case 3: - case 4: - { - return 'b'; - } + case 4: { + return 'b'; + } case 5: default: return 'c'; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt new file mode 100644 index 00000000000..c4a34fccd95 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -0,0 +1,190 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(23,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(27,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(29,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(33,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(34,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(35,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(39,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(40,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(41,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(45,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(46,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(47,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(51,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(52,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(53,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(57,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(58,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(81,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(86,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(90,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts (30 errors) ==== + + + // Generic tag with one parameter + function noParams(n: T) { } + noParams ``; + ~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with parameter which does not use type parameter + function noGenericParams(n: string[]) { } + noGenericParams ``; + ~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with multiple type parameters and only one used in parameter type annotation + function someGenerics1a(n: T, m: number) { } + someGenerics1a `${3}`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + function someGenerics1b(n: string[], m: U) { } + someGenerics1b `${3}`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with argument of function type whose parameter is of type parameter type + function someGenerics2a(strs: string[], n: (x: T) => void) { } + someGenerics2a `${(n: string) => n}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } + someGenerics2b `${ (n: string, x: number) => n }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter + function someGenerics3(strs: string[], producer: () => T) { } + someGenerics3 `${() => ''}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics3 `${() => undefined}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics3 `${() => 3}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type + function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } + someGenerics4 `${4}${ () => null }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics4 `${''}${ () => 3 }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics4 `${ null }${ null }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type + function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } + someGenerics5 `${ 4 } ${ () => null }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics5 `${ '' }${ () => 3 }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics5 `${null}${null}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with multiple arguments of function types that each have parameters of the same generic type + function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } + someGenerics6 `${ n => n }${ n => n}${ n => n}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics6 `${ n => n }${ n => n}${ n => n}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with multiple arguments of function types that each have parameters of different generic type + function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } + someGenerics7 `${ n => n }${ n => n }${ n => n }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics7 `${ n => n }${ n => n }${ n => n }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with argument of generic function type + function someGenerics8(strs: string[], n: T): T { return n; } + var x = someGenerics8 `${ someGenerics7 }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + x `${null}${null}${null}`; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic tag with multiple parameters of generic type passed arguments with no best common type + function someGenerics9(strs: string[], a: T, b: T, c: T): T { + return null; + } + var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + var a9a: {}; + + // Generic tag with multiple parameters of generic type passed arguments with multiple best common types + interface A91 { + x: number; + y?: string; + } + interface A92 { + x: number; + z?: Date; + } + + var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. + var a9e: {}; + + // Generic tag with multiple parameters of generic type passed arguments with a single best common type + var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var a9d: { x: number; }; + + // Generic tag with multiple parameters of generic type where one argument is of type 'any' + var anyVar: any; + var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var a: any; + + // Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' + var arr = someGenerics9 `${ [] }${ null }${ undefined }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var arr: any[]; + + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt new file mode 100644 index 00000000000..170c10c7381 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt @@ -0,0 +1,105 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(63,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts (2 errors) ==== + + // Generic tag with one parameter + function noParams(n: T) { } + noParams ``; + + // Generic tag with parameter which does not use type parameter + function noGenericParams(n: string[]) { } + noGenericParams ``; + + // Generic tag with multiple type parameters and only one used in parameter type annotation + function someGenerics1a(n: T, m: number) { } + someGenerics1a `${3}`; + + function someGenerics1b(n: string[], m: U) { } + someGenerics1b `${3}`; + + // Generic tag with argument of function type whose parameter is of type parameter type + function someGenerics2a(strs: string[], n: (x: T) => void) { } + someGenerics2a `${(n: string) => n}`; + + function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } + someGenerics2b `${ (n: string, x: number) => n }`; + + // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter + function someGenerics3(strs: string[], producer: () => T) { } + someGenerics3 `${() => ''}`; + someGenerics3 `${() => undefined}`; + someGenerics3 `${() => 3}`; + + // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type + function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } + someGenerics4 `${4}${ () => null }`; + someGenerics4 `${''}${ () => 3 }`; + someGenerics4 `${ null }${ null }`; + + // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type + function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } + someGenerics5 `${ 4 } ${ () => null }`; + someGenerics5 `${ '' }${ () => 3 }`; + someGenerics5 `${null}${null}`; + + // Generic tag with multiple arguments of function types that each have parameters of the same generic type + function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } + someGenerics6 `${ n => n }${ n => n}${ n => n}`; + someGenerics6 `${ n => n }${ n => n}${ n => n}`; + someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; + + // Generic tag with multiple arguments of function types that each have parameters of different generic type + function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } + someGenerics7 `${ n => n }${ n => n }${ n => n }`; + someGenerics7 `${ n => n }${ n => n }${ n => n }`; + someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; + + // Generic tag with argument of generic function type + function someGenerics8(strs: string[], n: T): T { return n; } + var x = someGenerics8 `${ someGenerics7 }`; + x `${null}${null}${null}`; + + // Generic tag with multiple parameters of generic type passed arguments with no best common type + function someGenerics9(strs: string[], a: T, b: T, c: T): T { + return null; + } + var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + var a9a: {}; + + // Generic tag with multiple parameters of generic type passed arguments with multiple best common types + interface A91 { + x: number; + y?: string; + } + interface A92 { + x: number; + z?: Date; + } + + var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. + var a9e: {}; + + // Generic tag with multiple parameters of generic type passed arguments with a single best common type + var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; + var a9d: { x: number; }; + + // Generic tag with multiple parameters of generic type where one argument is of type 'any' + var anyVar: any; + var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; + var a: any; + + // Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' + var arr = someGenerics9 `${ [] }${ null }${ undefined }`; + var arr: any[]; + + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js new file mode 100644 index 00000000000..b88eadfd80b --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.js @@ -0,0 +1,171 @@ +//// [taggedTemplateStringsTypeArgumentInferenceES6.ts] + +// Generic tag with one parameter +function noParams(n: T) { } +noParams ``; + +// Generic tag with parameter which does not use type parameter +function noGenericParams(n: string[]) { } +noGenericParams ``; + +// Generic tag with multiple type parameters and only one used in parameter type annotation +function someGenerics1a(n: T, m: number) { } +someGenerics1a `${3}`; + +function someGenerics1b(n: string[], m: U) { } +someGenerics1b `${3}`; + +// Generic tag with argument of function type whose parameter is of type parameter type +function someGenerics2a(strs: string[], n: (x: T) => void) { } +someGenerics2a `${(n: string) => n}`; + +function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } +someGenerics2b `${ (n: string, x: number) => n }`; + +// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter +function someGenerics3(strs: string[], producer: () => T) { } +someGenerics3 `${() => ''}`; +someGenerics3 `${() => undefined}`; +someGenerics3 `${() => 3}`; + +// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type +function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } +someGenerics4 `${4}${ () => null }`; +someGenerics4 `${''}${ () => 3 }`; +someGenerics4 `${ null }${ null }`; + +// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type +function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } +someGenerics5 `${ 4 } ${ () => null }`; +someGenerics5 `${ '' }${ () => 3 }`; +someGenerics5 `${null}${null}`; + +// Generic tag with multiple arguments of function types that each have parameters of the same generic type +function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } +someGenerics6 `${ n => n }${ n => n}${ n => n}`; +someGenerics6 `${ n => n }${ n => n}${ n => n}`; +someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; + +// Generic tag with multiple arguments of function types that each have parameters of different generic type +function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } +someGenerics7 `${ n => n }${ n => n }${ n => n }`; +someGenerics7 `${ n => n }${ n => n }${ n => n }`; +someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; + +// Generic tag with argument of generic function type +function someGenerics8(strs: string[], n: T): T { return n; } +var x = someGenerics8 `${ someGenerics7 }`; +x `${null}${null}${null}`; + +// Generic tag with multiple parameters of generic type passed arguments with no best common type +function someGenerics9(strs: string[], a: T, b: T, c: T): T { + return null; +} +var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; +var a9a: {}; + +// Generic tag with multiple parameters of generic type passed arguments with multiple best common types +interface A91 { + x: number; + y?: string; +} +interface A92 { + x: number; + z?: Date; +} + +var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; +var a9e: {}; + +// Generic tag with multiple parameters of generic type passed arguments with a single best common type +var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; +var a9d: { x: number; }; + +// Generic tag with multiple parameters of generic type where one argument is of type 'any' +var anyVar: any; +var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; +var a: any; + +// Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' +var arr = someGenerics9 `${ [] }${ null }${ undefined }`; +var arr: any[]; + + + +//// [taggedTemplateStringsTypeArgumentInferenceES6.js] +// Generic tag with one parameter +function noParams(n) { +} +noParams ``; +// Generic tag with parameter which does not use type parameter +function noGenericParams(n) { +} +noGenericParams ``; +// Generic tag with multiple type parameters and only one used in parameter type annotation +function someGenerics1a(n, m) { +} +someGenerics1a `${3}`; +function someGenerics1b(n, m) { +} +someGenerics1b `${3}`; +// Generic tag with argument of function type whose parameter is of type parameter type +function someGenerics2a(strs, n) { +} +someGenerics2a `${function (n) { return n; }}`; +function someGenerics2b(strs, n) { +} +someGenerics2b `${function (n, x) { return n; }}`; +// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter +function someGenerics3(strs, producer) { +} +someGenerics3 `${function () { return ''; }}`; +someGenerics3 `${function () { return undefined; }}`; +someGenerics3 `${function () { return 3; }}`; +// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type +function someGenerics4(strs, n, f) { +} +someGenerics4 `${4}${function () { return null; }}`; +someGenerics4 `${''}${function () { return 3; }}`; +someGenerics4 `${null}${null}`; +// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type +function someGenerics5(strs, n, f) { +} +someGenerics5 `${4} ${function () { return null; }}`; +someGenerics5 `${''}${function () { return 3; }}`; +someGenerics5 `${null}${null}`; +// Generic tag with multiple arguments of function types that each have parameters of the same generic type +function someGenerics6(strs, a, b, c) { +} +someGenerics6 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; +someGenerics6 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; +someGenerics6 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; +// Generic tag with multiple arguments of function types that each have parameters of different generic type +function someGenerics7(strs, a, b, c) { +} +someGenerics7 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; +someGenerics7 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; +someGenerics7 `${function (n) { return n; }}${function (n) { return n; }}${function (n) { return n; }}`; +// Generic tag with argument of generic function type +function someGenerics8(strs, n) { + return n; +} +var x = someGenerics8 `${someGenerics7}`; +x `${null}${null}${null}`; +// Generic tag with multiple parameters of generic type passed arguments with no best common type +function someGenerics9(strs, a, b, c) { + return null; +} +var a9a = someGenerics9 `${''}${0}${[]}`; +var a9a; +var a9e = someGenerics9 `${undefined}${{ x: 6, z: new Date() }}${{ x: 6, y: '' }}`; +var a9e; +// Generic tag with multiple parameters of generic type passed arguments with a single best common type +var a9d = someGenerics9 `${{ x: 3 }}${{ x: 6 }}${{ x: 6 }}`; +var a9d; +// Generic tag with multiple parameters of generic type where one argument is of type 'any' +var anyVar; +var a = someGenerics9 `${7}${anyVar}${4}`; +var a; +// Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' +var arr = someGenerics9 `${[]}${null}${undefined}`; +var arr; diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt new file mode 100644 index 00000000000..cf915f36dd8 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -0,0 +1,90 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (18 errors) ==== + interface I { + (stringParts: string[], ...rest: boolean[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; + } + + var f: I; + + f `abc` + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc`.member + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`.member; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc`["member"]; + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`["member"]; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc`[0].member `abc${1}def${2}ghi`; + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f.thisIsNotATag(`abc`); + + f.thisIsNotATag(`abc${1}def${2}ghi`); + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt new file mode 100644 index 00000000000..89b48b0193c --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt @@ -0,0 +1,53 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(24,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (6 errors) ==== + interface I { + (stringParts: string[], ...rest: boolean[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; + } + + var f: I; + + f `abc` + + f `abc${1}def${2}ghi`; + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc`.member + + f `abc${1}def${2}ghi`.member; + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc`["member"]; + + f `abc${1}def${2}ghi`["member"]; + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc`[0].member `abc${1}def${2}ghi`; + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. + + f.thisIsNotATag(`abc`); + + f.thisIsNotATag(`abc${1}def${2}ghi`); \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.js b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.js new file mode 100644 index 00000000000..8b636356068 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.js @@ -0,0 +1,47 @@ +//// [taggedTemplateStringsWithIncompatibleTypedTagsES6.ts] +interface I { + (stringParts: string[], ...rest: boolean[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; +} + +var f: I; + +f `abc` + +f `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`[0].member `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + +f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); + +//// [taggedTemplateStringsWithIncompatibleTypedTagsES6.js] +var f; +f `abc`; +f `abc${1}def${2}ghi`; +f `abc`.member; +f `abc${1}def${2}ghi`.member; +f `abc`["member"]; +f `abc${1}def${2}ghi`["member"]; +f `abc`[0].member `abc${1}def${2}ghi`; +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; +f `abc${true}def${true}ghi`["member"].member `abc${1}def${2}ghi`; +f.thisIsNotATag(`abc`); +f.thisIsNotATag(`abc${1}def${2}ghi`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt new file mode 100644 index 00000000000..f6300855a1c --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts (1 errors) ==== + interface I { + (strs: string[], ...subs: number[]): I; + member: { + new (s: string): { + new (n: number): { + new (): boolean; + } + } + }; + } + var f: I; + + var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; + ~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.js b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.js new file mode 100644 index 00000000000..b985860f065 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.js @@ -0,0 +1,20 @@ +//// [taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts] +interface I { + (strs: string[], ...subs: number[]): I; + member: { + new (s: string): { + new (n: number): { + new (): boolean; + } + } + }; +} +var f: I; + +var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; + + + +//// [taggedTemplateStringsWithManyCallAndMemberExpressionsES6.js] +var f; +var x = new new new f `abc${0}def`.member("hello")(42) === true; diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types new file mode 100644 index 00000000000..29a429a1435 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts === +interface I { +>I : I + + (strs: string[], ...subs: number[]): I; +>strs : string[] +>subs : number[] +>I : I + + member: { +>member : new (s: string) => new (n: number) => new () => boolean + + new (s: string): { +>s : string + + new (n: number): { +>n : number + + new (): boolean; + } + } + }; +} +var f: I; +>f : I +>I : I + +var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; +>x : boolean +>new new new f `abc${ 0 }def`.member("hello")(42) === true : boolean +>new new new f `abc${ 0 }def`.member("hello")(42) : boolean +>new new f `abc${ 0 }def`.member("hello")(42) : new () => boolean +>new f `abc${ 0 }def`.member("hello") : new (n: number) => new () => boolean +>f `abc${ 0 }def`.member : new (s: string) => new (n: number) => new () => boolean +>f : I +>member : new (s: string) => new (n: number) => new () => boolean + + diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt new file mode 100644 index 00000000000..d49ec4b716d --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -0,0 +1,55 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(16,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(17,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(18,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(20,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts (10 errors) ==== + function foo(strs: string[]): number; + function foo(strs: string[], x: number): string; + function foo(strs: string[], x: number, y: number): boolean; + function foo(strs: string[], x: number, y: string): {}; + function foo(...stuff: any[]): any { + return undefined; + } + + var a = foo([]); // number + var b = foo([], 1); // string + var c = foo([], 1, 2); // boolean + var d = foo([], 1, true); // boolean (with error) + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. + var e = foo([], 1, "2"); // {} + var f = foo([], 1, 2, 3); // any (with error) + ~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + var u = foo ``; // number + ~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var v = foo `${1}`; // string + ~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var w = foo `${1}${2}`; // boolean + ~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var x = foo `${1}${true}`; // boolean (with error) + ~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. + var y = foo `${1}${"2"}`; // {} + ~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var z = foo `${1}${2}${3}`; // any (with error) + ~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt new file mode 100644 index 00000000000..53361f2052d --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -0,0 +1,37 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts (4 errors) ==== + function foo(strs: string[]): number; + function foo(strs: string[], x: number): string; + function foo(strs: string[], x: number, y: number): boolean; + function foo(strs: string[], x: number, y: string): {}; + function foo(...stuff: any[]): any { + return undefined; + } + + var a = foo([]); // number + var b = foo([], 1); // string + var c = foo([], 1, 2); // boolean + var d = foo([], 1, true); // boolean (with error) + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. + var e = foo([], 1, "2"); // {} + var f = foo([], 1, 2, 3); // any (with error) + ~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + var u = foo ``; // number + var v = foo `${1}`; // string + var w = foo `${1}${2}`; // boolean + var x = foo `${1}${true}`; // boolean (with error) + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. + var y = foo `${1}${"2"}`; // {} + var z = foo `${1}${2}${3}`; // any (with error) + ~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.js new file mode 100644 index 00000000000..a2a96168fd8 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.js @@ -0,0 +1,44 @@ +//// [taggedTemplateStringsWithOverloadResolution1_ES6.ts] +function foo(strs: string[]): number; +function foo(strs: string[], x: number): string; +function foo(strs: string[], x: number, y: number): boolean; +function foo(strs: string[], x: number, y: string): {}; +function foo(...stuff: any[]): any { + return undefined; +} + +var a = foo([]); // number +var b = foo([], 1); // string +var c = foo([], 1, 2); // boolean +var d = foo([], 1, true); // boolean (with error) +var e = foo([], 1, "2"); // {} +var f = foo([], 1, 2, 3); // any (with error) + +var u = foo ``; // number +var v = foo `${1}`; // string +var w = foo `${1}${2}`; // boolean +var x = foo `${1}${true}`; // boolean (with error) +var y = foo `${1}${"2"}`; // {} +var z = foo `${1}${2}${3}`; // any (with error) + + +//// [taggedTemplateStringsWithOverloadResolution1_ES6.js] +function foo() { + var stuff = []; + for (var _i = 0; _i < arguments.length; _i++) { + stuff[_i - 0] = arguments[_i]; + } + return undefined; +} +var a = foo([]); // number +var b = foo([], 1); // string +var c = foo([], 1, 2); // boolean +var d = foo([], 1, true); // boolean (with error) +var e = foo([], 1, "2"); // {} +var f = foo([], 1, 2, 3); // any (with error) +var u = foo ``; // number +var v = foo `${1}`; // string +var w = foo `${1}${2}`; // boolean +var x = foo `${1}${true}`; // boolean (with error) +var y = foo `${1}${"2"}`; // {} +var z = foo `${1}${2}${3}`; // any (with error) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt new file mode 100644 index 00000000000..fcde15afc27 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(8,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(17,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts (2 errors) ==== + + function foo1(strs: TemplateStringsArray, x: number): string; + function foo1(strs: string[], x: number): number; + function foo1(...stuff: any[]): any { + return undefined; + } + + var a = foo1 `${1}`; // string + ~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var b = foo1([], 1); // number + + function foo2(strs: string[], x: number): number; + function foo2(strs: TemplateStringsArray, x: number): string; + function foo2(...stuff: any[]): any { + return undefined; + } + + var c = foo2 `${1}`; // number + ~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var d = foo2([], 1); // number \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.js new file mode 100644 index 00000000000..44da93f8041 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.js @@ -0,0 +1,38 @@ +//// [taggedTemplateStringsWithOverloadResolution2_ES6.ts] +function foo1(strs: TemplateStringsArray, x: number): string; +function foo1(strs: string[], x: number): number; +function foo1(...stuff: any[]): any { + return undefined; +} + +var a = foo1 `${1}`; // string +var b = foo1([], 1); // number + +function foo2(strs: string[], x: number): number; +function foo2(strs: TemplateStringsArray, x: number): string; +function foo2(...stuff: any[]): any { + return undefined; +} + +var c = foo2 `${1}`; // number +var d = foo2([], 1); // number + +//// [taggedTemplateStringsWithOverloadResolution2_ES6.js] +function foo1() { + var stuff = []; + for (var _i = 0; _i < arguments.length; _i++) { + stuff[_i - 0] = arguments[_i]; + } + return undefined; +} +var a = foo1 `${1}`; // string +var b = foo1([], 1); // number +function foo2() { + var stuff = []; + for (var _i = 0; _i < arguments.length; _i++) { + stuff[_i - 0] = arguments[_i]; + } + return undefined; +} +var c = foo2 `${1}`; // number +var d = foo2([], 1); // number diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types new file mode 100644 index 00000000000..d9d918b37bd --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types @@ -0,0 +1,59 @@ +=== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts === +function foo1(strs: TemplateStringsArray, x: number): string; +>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } +>strs : TemplateStringsArray +>TemplateStringsArray : TemplateStringsArray +>x : number + +function foo1(strs: string[], x: number): number; +>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } +>strs : string[] +>x : number + +function foo1(...stuff: any[]): any { +>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } +>stuff : any[] + + return undefined; +>undefined : undefined +} + +var a = foo1 `${1}`; // string +>a : string +>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } + +var b = foo1([], 1); // number +>b : number +>foo1([], 1) : number +>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } +>[] : undefined[] + +function foo2(strs: string[], x: number): number; +>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } +>strs : string[] +>x : number + +function foo2(strs: TemplateStringsArray, x: number): string; +>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } +>strs : TemplateStringsArray +>TemplateStringsArray : TemplateStringsArray +>x : number + +function foo2(...stuff: any[]): any { +>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } +>stuff : any[] + + return undefined; +>undefined : undefined +} + +var c = foo2 `${1}`; // number +>c : number +>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } + +var d = foo2([], 1); // number +>d : number +>foo2([], 1) : number +>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } +>[] : undefined[] + diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt new file mode 100644 index 00000000000..dd943e518f3 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -0,0 +1,160 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(7,17): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(16,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(17,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(23,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(34,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(35,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(36,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(40,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(41,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(42,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(54,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(55,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(56,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(57,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(60,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(71,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(19,4): error TS2339: Property 'foo' does not exist on type 'Date'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,18): error TS2339: Property 'toFixed' does not exist on type 'string'. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts (28 errors) ==== + + // Ambiguous call picks the first overload in declaration order + function fn1(strs: TemplateStringsArray, s: string): string; + function fn1(strs: TemplateStringsArray, n: number): number; + function fn1() { return null; } + + var s: string = fn1 `${ undefined }`; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // No candidate overloads found + fn1 `${ {} }`; // Error + ~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~ +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + + function fn2(strs: TemplateStringsArray, s: string, n: number): number; + function fn2(strs: TemplateStringsArray, n: number, t: T): T; + function fn2() { return undefined; } + + var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var d2 = fn2 `${ 0 }${ undefined }`; // any + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + d1.foo(); // error + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'Date'. + d2(); // no error (typed as any) + + // Generic and non-generic overload where generic overload is the only candidate + fn2 `${ 0 }${ '' }`; // OK + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic and non-generic overload where non-generic overload is the only candidate + fn2 `${ '' }${ 0 }`; // OK + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic overloads with differing arity + function fn3(strs: TemplateStringsArray, n: T): string; + function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; + function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; + function fn3() { return null; } + + var s = fn3 `${ 3 }`; + ~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var s = fn3 `${'' }${ 3 }${ '' }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var n = fn3 `${ 5 }${ 5 }${ 5 }`; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var n: number; + + // Generic overloads with differing arity tagging with arguments matching each overload type parameter count + var s = fn3 `${ 4 }` + ~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var s = fn3 `${ '' }${ '' }${ '' }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + var n = fn3 `${ '' }${ '' }${ 3 }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic overloads with differing arity tagging with argument count that doesn't match any overload + fn3 ``; // Error + ~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + // Generic overloads with constraints + function fn4(strs: TemplateStringsArray, n: T, m: U); + function fn4(strs: TemplateStringsArray, n: T, m: U); + function fn4(strs: TemplateStringsArray) + function fn4() { } + + // Generic overloads with constraints tagged with types that satisfy the constraints + fn4 `${ '' }${ 3 }`; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + fn4 `${ 3 }${ '' }`; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + fn4 `${ 3 }${ undefined }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + fn4 `${ '' }${ null }`; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic overloads with constraints called with type arguments that do not satisfy the constraints + fn4 `${ null }${ null }`; // Error + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints + fn4 `${ true }${ null }`; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. + fn4 `${ null }${ true }`; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. + + // Non - generic overloads where contextual typing of function arguments has errors + function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; + function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; + function fn5() { return undefined; } + fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~ +!!! error TS2339: Property 'toFixed' does not exist on type 'string'. + fn5 `${ (n) => n.substr(0) }`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt new file mode 100644 index 00000000000..e65acdee835 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -0,0 +1,93 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts (6 errors) ==== + // Ambiguous call picks the first overload in declaration order + function fn1(strs: TemplateStringsArray, s: string): string; + function fn1(strs: TemplateStringsArray, n: number): number; + function fn1() { return null; } + + var s: string = fn1 `${ undefined }`; + + // No candidate overloads found + fn1 `${ {} }`; // Error + ~~ +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. + + function fn2(strs: TemplateStringsArray, s: string, n: number): number; + function fn2(strs: TemplateStringsArray, n: number, t: T): T; + function fn2() { return undefined; } + + var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed + var d2 = fn2 `${ 0 }${ undefined }`; // any + + d1.foo(); // error + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'Date'. + d2(); // no error (typed as any) + + // Generic and non-generic overload where generic overload is the only candidate + fn2 `${ 0 }${ '' }`; // OK + + // Generic and non-generic overload where non-generic overload is the only candidate + fn2 `${ '' }${ 0 }`; // OK + + // Generic overloads with differing arity + function fn3(strs: TemplateStringsArray, n: T): string; + function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; + function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; + function fn3() { return null; } + + var s = fn3 `${ 3 }`; + var s = fn3 `${'' }${ 3 }${ '' }`; + var n = fn3 `${ 5 }${ 5 }${ 5 }`; + var n: number; + + // Generic overloads with differing arity tagging with arguments matching each overload type parameter count + var s = fn3 `${ 4 }` + var s = fn3 `${ '' }${ '' }${ '' }`; + var n = fn3 `${ '' }${ '' }${ 3 }`; + + // Generic overloads with differing arity tagging with argument count that doesn't match any overload + fn3 ``; // Error + ~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + + // Generic overloads with constraints + function fn4(strs: TemplateStringsArray, n: T, m: U); + function fn4(strs: TemplateStringsArray, n: T, m: U); + function fn4(strs: TemplateStringsArray) + function fn4() { } + + // Generic overloads with constraints tagged with types that satisfy the constraints + fn4 `${ '' }${ 3 }`; + fn4 `${ 3 }${ '' }`; + fn4 `${ 3 }${ undefined }`; + fn4 `${ '' }${ null }`; + + // Generic overloads with constraints called with type arguments that do not satisfy the constraints + fn4 `${ null }${ null }`; // Error + + // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints + fn4 `${ true }${ null }`; + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. + fn4 `${ null }${ true }`; + ~~~~ +!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. + + // Non - generic overloads where contextual typing of function arguments has errors + function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; + function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; + function fn5() { return undefined; } + fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. + ~~~~~~~ +!!! error TS2339: Property 'toFixed' does not exist on type 'string'. + fn5 `${ (n) => n.substr(0) }`; + + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js new file mode 100644 index 00000000000..48af9403a79 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.js @@ -0,0 +1,122 @@ +//// [taggedTemplateStringsWithOverloadResolution3_ES6.ts] +// Ambiguous call picks the first overload in declaration order +function fn1(strs: TemplateStringsArray, s: string): string; +function fn1(strs: TemplateStringsArray, n: number): number; +function fn1() { return null; } + +var s: string = fn1 `${ undefined }`; + +// No candidate overloads found +fn1 `${ {} }`; // Error + +function fn2(strs: TemplateStringsArray, s: string, n: number): number; +function fn2(strs: TemplateStringsArray, n: number, t: T): T; +function fn2() { return undefined; } + +var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed +var d2 = fn2 `${ 0 }${ undefined }`; // any + +d1.foo(); // error +d2(); // no error (typed as any) + +// Generic and non-generic overload where generic overload is the only candidate +fn2 `${ 0 }${ '' }`; // OK + +// Generic and non-generic overload where non-generic overload is the only candidate +fn2 `${ '' }${ 0 }`; // OK + +// Generic overloads with differing arity +function fn3(strs: TemplateStringsArray, n: T): string; +function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; +function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; +function fn3() { return null; } + +var s = fn3 `${ 3 }`; +var s = fn3 `${'' }${ 3 }${ '' }`; +var n = fn3 `${ 5 }${ 5 }${ 5 }`; +var n: number; + +// Generic overloads with differing arity tagging with arguments matching each overload type parameter count +var s = fn3 `${ 4 }` +var s = fn3 `${ '' }${ '' }${ '' }`; +var n = fn3 `${ '' }${ '' }${ 3 }`; + +// Generic overloads with differing arity tagging with argument count that doesn't match any overload +fn3 ``; // Error + +// Generic overloads with constraints +function fn4(strs: TemplateStringsArray, n: T, m: U); +function fn4(strs: TemplateStringsArray, n: T, m: U); +function fn4(strs: TemplateStringsArray) +function fn4() { } + +// Generic overloads with constraints tagged with types that satisfy the constraints +fn4 `${ '' }${ 3 }`; +fn4 `${ 3 }${ '' }`; +fn4 `${ 3 }${ undefined }`; +fn4 `${ '' }${ null }`; + +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +fn4 `${ null }${ null }`; // Error + +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +fn4 `${ true }${ null }`; +fn4 `${ null }${ true }`; + +// Non - generic overloads where contextual typing of function arguments has errors +function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; +function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; +function fn5() { return undefined; } +fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. +fn5 `${ (n) => n.substr(0) }`; + + + +//// [taggedTemplateStringsWithOverloadResolution3_ES6.js] +function fn1() { + return null; +} +var s = fn1 `${undefined}`; +// No candidate overloads found +fn1 `${{}}`; // Error +function fn2() { + return undefined; +} +var d1 = fn2 `${0}${undefined}`; // contextually typed +var d2 = fn2 `${0}${undefined}`; // any +d1.foo(); // error +d2(); // no error (typed as any) +// Generic and non-generic overload where generic overload is the only candidate +fn2 `${0}${''}`; // OK +// Generic and non-generic overload where non-generic overload is the only candidate +fn2 `${''}${0}`; // OK +function fn3() { + return null; +} +var s = fn3 `${3}`; +var s = fn3 `${''}${3}${''}`; +var n = fn3 `${5}${5}${5}`; +var n; +// Generic overloads with differing arity tagging with arguments matching each overload type parameter count +var s = fn3 `${4}`; +var s = fn3 `${''}${''}${''}`; +var n = fn3 `${''}${''}${3}`; +// Generic overloads with differing arity tagging with argument count that doesn't match any overload +fn3 ``; // Error +function fn4() { +} +// Generic overloads with constraints tagged with types that satisfy the constraints +fn4 `${''}${3}`; +fn4 `${3}${''}`; +fn4 `${3}${undefined}`; +fn4 `${''}${null}`; +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +fn4 `${null}${null}`; // Error +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +fn4 `${true}${null}`; +fn4 `${null}${true}`; +function fn5() { + return undefined; +} +fn5 `${function (n) { return n.toFixed(); }}`; // will error; 'n' should have type 'string'. +fn5 `${function (n) { return n.substr(0); }}`; diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt new file mode 100644 index 00000000000..a15e0cbb49b --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt @@ -0,0 +1,64 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts (12 errors) ==== + var f: any; + + f `abc` + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f.g.h `abc` + ~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f.g.h `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc`.member + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`.member; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc`["member"]; + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`["member"]; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f.thisIsNotATag(`abc`); + + f.thisIsNotATag(`abc${1}def${2}ghi`); \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.js b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.js new file mode 100644 index 00000000000..997e1277442 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.js @@ -0,0 +1,40 @@ +//// [taggedTemplateStringsWithTagsTypedAsAnyES6.ts] +var f: any; +f `abc` + +f `abc${1}def${2}ghi`; + +f.g.h `abc` + +f.g.h `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); + +//// [taggedTemplateStringsWithTagsTypedAsAnyES6.js] +var f; +f `abc`; +f `abc${1}def${2}ghi`; +f.g.h `abc`; +f.g.h `abc${1}def${2}ghi`; +f `abc`.member; +f `abc${1}def${2}ghi`.member; +f `abc`["member"]; +f `abc${1}def${2}ghi`["member"]; +f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; +f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; +f.thisIsNotATag(`abc`); +f.thisIsNotATag(`abc${1}def${2}ghi`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types new file mode 100644 index 00000000000..bb651fe1d25 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types @@ -0,0 +1,66 @@ +=== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAnyES6.ts === +var f: any; +>f : any + +f `abc` +>f : any + +f `abc${1}def${2}ghi`; +>f : any + +f.g.h `abc` +>f.g.h : any +>f.g : any +>f : any +>g : any +>h : any + +f.g.h `abc${1}def${2}ghi`; +>f.g.h : any +>f.g : any +>f : any +>g : any +>h : any + +f `abc`.member +>f `abc`.member : any +>f : any +>member : any + +f `abc${1}def${2}ghi`.member; +>f `abc${1}def${2}ghi`.member : any +>f : any +>member : any + +f `abc`["member"]; +>f `abc`["member"] : any +>f : any + +f `abc${1}def${2}ghi`["member"]; +>f `abc${1}def${2}ghi`["member"] : any +>f : any + +f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; +>f `abc`["member"].someOtherTag : any +>f `abc`["member"] : any +>f : any +>someOtherTag : any + +f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; +>f `abc${1}def${2}ghi`["member"].someOtherTag : any +>f `abc${1}def${2}ghi`["member"] : any +>f : any +>someOtherTag : any + +f.thisIsNotATag(`abc`); +>f.thisIsNotATag(`abc`) : any +>f.thisIsNotATag : any +>f : any +>thisIsNotATag : any + +f.thisIsNotATag(`abc${1}def${2}ghi`); +>f.thisIsNotATag(`abc${1}def${2}ghi`) : any +>f.thisIsNotATag : any +>f : any +>thisIsNotATag : any + diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt new file mode 100644 index 00000000000..0e4f7a63223 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt @@ -0,0 +1,64 @@ +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts (10 errors) ==== + interface I { + (stringParts: string[], ...rest: number[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; + } + + var f: I; + + f `abc` + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc`.member + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`.member; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc`["member"]; + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`["member"]; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc`[0].member `abc${1}def${2}ghi`; + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + + f.thisIsNotATag(`abc`); + + f.thisIsNotATag(`abc${1}def${2}ghi`); + \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.js b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.js new file mode 100644 index 00000000000..9eefc46ec30 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.js @@ -0,0 +1,45 @@ +//// [taggedTemplateStringsWithTypedTagsES6.ts] +interface I { + (stringParts: string[], ...rest: number[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; +} + +var f: I; + +f `abc` + +f `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`[0].member `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); + + +//// [taggedTemplateStringsWithTypedTagsES6.js] +var f; +f `abc`; +f `abc${1}def${2}ghi`; +f `abc`.member; +f `abc${1}def${2}ghi`.member; +f `abc`["member"]; +f `abc${1}def${2}ghi`["member"]; +f `abc`[0].member `abc${1}def${2}ghi`; +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; +f.thisIsNotATag(`abc`); +f.thisIsNotATag(`abc${1}def${2}ghi`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types new file mode 100644 index 00000000000..e0b16ebe392 --- /dev/null +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types @@ -0,0 +1,82 @@ +=== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts === +interface I { +>I : I + + (stringParts: string[], ...rest: number[]): I; +>stringParts : string[] +>rest : number[] +>I : I + + g: I; +>g : I +>I : I + + h: I; +>h : I +>I : I + + member: I; +>member : I +>I : I + + thisIsNotATag(x: string): void +>thisIsNotATag : (x: string) => void +>x : string + + [x: number]: I; +>x : number +>I : I +} + +var f: I; +>f : I +>I : I + +f `abc` +>f : I + +f `abc${1}def${2}ghi`; +>f : I + +f `abc`.member +>f `abc`.member : I +>f : I +>member : I + +f `abc${1}def${2}ghi`.member; +>f `abc${1}def${2}ghi`.member : I +>f : I +>member : I + +f `abc`["member"]; +>f `abc`["member"] : I +>f : I + +f `abc${1}def${2}ghi`["member"]; +>f `abc${1}def${2}ghi`["member"] : I +>f : I + +f `abc`[0].member `abc${1}def${2}ghi`; +>f `abc`[0].member : I +>f `abc`[0] : I +>f : I +>member : I + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; +>f `abc${1}def${2}ghi`["member"].member : I +>f `abc${1}def${2}ghi`["member"] : I +>f : I +>member : I + +f.thisIsNotATag(`abc`); +>f.thisIsNotATag(`abc`) : void +>f.thisIsNotATag : (x: string) => void +>f : I +>thisIsNotATag : (x: string) => void + +f.thisIsNotATag(`abc${1}def${2}ghi`); +>f.thisIsNotATag(`abc${1}def${2}ghi`) : void +>f.thisIsNotATag : (x: string) => void +>f : I +>thisIsNotATag : (x: string) => void + diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt new file mode 100644 index 00000000000..51e362deb5d --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1126: Unexpected end of text. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts (1 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, not enough parameters. + f `123qdawdrqw + +!!! error TS1126: Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt new file mode 100644 index 00000000000..1aa00658d80 --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1126: Unexpected end of text. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts (1 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, not enough parameters, at EOF. + f ` + +!!! error TS1126: Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.errors.txt new file mode 100644 index 00000000000..56a557e1a8c --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions1.ts(6,17): error TS1109: Expression expected. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions1.ts (1 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, not enough parameters. + f `123qdawdrqw${ + +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.errors.txt new file mode 100644 index 00000000000..065cc2f4787 --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions2.ts(6,18): error TS1109: Expression expected. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions2.ts(6,21): error TS1109: Expression expected. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions2.ts (2 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, enough parameters. + f `123qdawdrqw${ }${ + ~ +!!! error TS1109: Expression expected. + +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt new file mode 100644 index 00000000000..deb8b166699 --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,23): error TS1109: Expression expected. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts (2 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, not enough parameters. + f `123qdawdrqw${ 1 }${ + +!!! error TS1109: Expression expected. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.errors.txt new file mode 100644 index 00000000000..49d55dc2bfd --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(6,24): error TS1109: Expression expected. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(6,28): error TS1109: Expression expected. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts (3 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, but too many parameters. + f `123qdawdrqw${ 1 }${ }${ + ~ +!!! error TS1109: Expression expected. + +!!! error TS1109: Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.errors.txt new file mode 100644 index 00000000000..27a6263c391 --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(6,30): error TS1109: Expression expected. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts (2 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, but too many parameters. + f `123qdawdrqw${ 1 }${ 2 }${ + +!!! error TS1109: Expression expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt new file mode 100644 index 00000000000..d8a045b0615 --- /dev/null +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,23): error TS1109: Expression expected. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. + + +==== tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts (2 errors) ==== + + function f(x: TemplateStringsArray, y: string, z: string) { + } + + // Incomplete call, not enough parameters, at EOF. + f `123qdawdrqw${ 1 }${ + +!!! error TS1109: Expression expected. + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeBaseCalls.errors.txt b/tests/baselines/reference/targetTypeBaseCalls.errors.txt index 60a98d2244e..37a00c9798d 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.errors.txt +++ b/tests/baselines/reference/targetTypeBaseCalls.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/targetTypeBaseCalls.ts (3 errors) ==== @@ -14,17 +14,17 @@ tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2323: Type 'number' foo(function(s) { s = 5 }); // Error, can’t assign number to string ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. new Foo(function(s) { s = 5 }); // error, if types are applied correctly ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // error, if types are applied correctly ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeTest3.errors.txt b/tests/baselines/reference/targetTypeTest3.errors.txt index 41b2d027fb5..f5dab732ed3 100644 --- a/tests/baselines/reference/targetTypeTest3.errors.txt +++ b/tests/baselines/reference/targetTypeTest3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | number)[]' is not assignable to type 'string[]': - Type 'string | number' is not assignable to type 'string': +tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'. + Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -9,8 +9,8 @@ tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | numb var a : string[] = [1,2,"3"]; // should produce an error ~ -!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string[]': -!!! error TS2322: Type 'string | number' is not assignable to type 'string': +!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/targetTypeVoidFunc.errors.txt b/tests/baselines/reference/targetTypeVoidFunc.errors.txt index b084bf10aef..14c3cb37c3a 100644 --- a/tests/baselines/reference/targetTypeVoidFunc.errors.txt +++ b/tests/baselines/reference/targetTypeVoidFunc.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/targetTypeVoidFunc.ts(2,12): error TS2323: Type '() => void' is not assignable to type 'new () => number'. +tests/cases/compiler/targetTypeVoidFunc.ts(2,12): error TS2322: Type '() => void' is not assignable to type 'new () => number'. ==== tests/cases/compiler/targetTypeVoidFunc.ts (1 errors) ==== function f1(): { new (): number; } { return function () { return; } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'new () => number'. +!!! error TS2322: Type '() => void' is not assignable to type 'new () => number'. }; var x = f1(); diff --git a/tests/baselines/reference/templateStringInArray.js b/tests/baselines/reference/templateStringInArray.js new file mode 100644 index 00000000000..97d0b1a636b --- /dev/null +++ b/tests/baselines/reference/templateStringInArray.js @@ -0,0 +1,5 @@ +//// [templateStringInArray.ts] +var x = [1, 2, `abc${ 123 }def`]; + +//// [templateStringInArray.js] +var x = [1, 2, ("abc" + 123 + "def")]; diff --git a/tests/baselines/reference/templateStringInArray.types b/tests/baselines/reference/templateStringInArray.types new file mode 100644 index 00000000000..ef727f59b24 --- /dev/null +++ b/tests/baselines/reference/templateStringInArray.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInArray.ts === +var x = [1, 2, `abc${ 123 }def`]; +>x : (string | number)[] +>[1, 2, `abc${ 123 }def`] : (string | number)[] + diff --git a/tests/baselines/reference/templateStringInArrowFunction.js b/tests/baselines/reference/templateStringInArrowFunction.js new file mode 100644 index 00000000000..4c4890633e1 --- /dev/null +++ b/tests/baselines/reference/templateStringInArrowFunction.js @@ -0,0 +1,5 @@ +//// [templateStringInArrowFunction.ts] +var x = x => `abc${ x }def`; + +//// [templateStringInArrowFunction.js] +var x = function (x) { return ("abc" + x + "def"); }; diff --git a/tests/baselines/reference/templateStringInArrowFunction.types b/tests/baselines/reference/templateStringInArrowFunction.types new file mode 100644 index 00000000000..2c157815897 --- /dev/null +++ b/tests/baselines/reference/templateStringInArrowFunction.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringInArrowFunction.ts === +var x = x => `abc${ x }def`; +>x : (x: any) => string +>x => `abc${ x }def` : (x: any) => string +>x : any +>x : any + diff --git a/tests/baselines/reference/templateStringInArrowFunctionES6.js b/tests/baselines/reference/templateStringInArrowFunctionES6.js new file mode 100644 index 00000000000..633b96e9da4 --- /dev/null +++ b/tests/baselines/reference/templateStringInArrowFunctionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInArrowFunctionES6.ts] +var x = x => `abc${ x }def`; + +//// [templateStringInArrowFunctionES6.js] +var x = function (x) { return `abc${x}def`; }; diff --git a/tests/baselines/reference/templateStringInArrowFunctionES6.types b/tests/baselines/reference/templateStringInArrowFunctionES6.types new file mode 100644 index 00000000000..5f66590d490 --- /dev/null +++ b/tests/baselines/reference/templateStringInArrowFunctionES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringInArrowFunctionES6.ts === +var x = x => `abc${ x }def`; +>x : (x: any) => string +>x => `abc${ x }def` : (x: any) => string +>x : any +>x : any + diff --git a/tests/baselines/reference/templateStringInBinaryAddition.js b/tests/baselines/reference/templateStringInBinaryAddition.js new file mode 100644 index 00000000000..0e1f728005c --- /dev/null +++ b/tests/baselines/reference/templateStringInBinaryAddition.js @@ -0,0 +1,5 @@ +//// [templateStringInBinaryAddition.ts] +var x = 10 + `abc${ 10 }def`; + +//// [templateStringInBinaryAddition.js] +var x = 10 + ("abc" + 10 + "def"); diff --git a/tests/baselines/reference/templateStringInBinaryAddition.types b/tests/baselines/reference/templateStringInBinaryAddition.types new file mode 100644 index 00000000000..f722ff696f4 --- /dev/null +++ b/tests/baselines/reference/templateStringInBinaryAddition.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInBinaryAddition.ts === +var x = 10 + `abc${ 10 }def`; +>x : string +>10 + `abc${ 10 }def` : string + diff --git a/tests/baselines/reference/templateStringInBinaryAdditionES6.js b/tests/baselines/reference/templateStringInBinaryAdditionES6.js new file mode 100644 index 00000000000..7a40d4cc54f --- /dev/null +++ b/tests/baselines/reference/templateStringInBinaryAdditionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInBinaryAdditionES6.ts] +var x = 10 + `abc${ 10 }def`; + +//// [templateStringInBinaryAdditionES6.js] +var x = 10 + `abc${10}def`; diff --git a/tests/baselines/reference/templateStringInBinaryAdditionES6.types b/tests/baselines/reference/templateStringInBinaryAdditionES6.types new file mode 100644 index 00000000000..b421d7dc70e --- /dev/null +++ b/tests/baselines/reference/templateStringInBinaryAdditionES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInBinaryAdditionES6.ts === +var x = 10 + `abc${ 10 }def`; +>x : string +>10 + `abc${ 10 }def` : string + diff --git a/tests/baselines/reference/templateStringInConditional.js b/tests/baselines/reference/templateStringInConditional.js new file mode 100644 index 00000000000..8ffcf24e5f4 --- /dev/null +++ b/tests/baselines/reference/templateStringInConditional.js @@ -0,0 +1,5 @@ +//// [templateStringInConditional.ts] +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; + +//// [templateStringInConditional.js] +var x = "abc" + " " + "def" ? "abc" + " " + "def" : "abc" + " " + "def"; diff --git a/tests/baselines/reference/templateStringInConditional.types b/tests/baselines/reference/templateStringInConditional.types new file mode 100644 index 00000000000..b4ff36b3891 --- /dev/null +++ b/tests/baselines/reference/templateStringInConditional.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInConditional.ts === +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; +>x : string +>`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string + diff --git a/tests/baselines/reference/templateStringInConditionalES6.js b/tests/baselines/reference/templateStringInConditionalES6.js new file mode 100644 index 00000000000..d212b5c7717 --- /dev/null +++ b/tests/baselines/reference/templateStringInConditionalES6.js @@ -0,0 +1,5 @@ +//// [templateStringInConditionalES6.ts] +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; + +//// [templateStringInConditionalES6.js] +var x = `abc${" "}def` ? `abc${" "}def` : `abc${" "}def`; diff --git a/tests/baselines/reference/templateStringInConditionalES6.types b/tests/baselines/reference/templateStringInConditionalES6.types new file mode 100644 index 00000000000..c211ced2583 --- /dev/null +++ b/tests/baselines/reference/templateStringInConditionalES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInConditionalES6.ts === +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; +>x : string +>`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string + diff --git a/tests/baselines/reference/templateStringInDeleteExpression.js b/tests/baselines/reference/templateStringInDeleteExpression.js new file mode 100644 index 00000000000..e8da2e2ba32 --- /dev/null +++ b/tests/baselines/reference/templateStringInDeleteExpression.js @@ -0,0 +1,5 @@ +//// [templateStringInDeleteExpression.ts] +delete `abc${0}abc`; + +//// [templateStringInDeleteExpression.js] +delete ("abc" + 0 + "abc"); diff --git a/tests/baselines/reference/templateStringInDeleteExpression.types b/tests/baselines/reference/templateStringInDeleteExpression.types new file mode 100644 index 00000000000..88693e5a9bb --- /dev/null +++ b/tests/baselines/reference/templateStringInDeleteExpression.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/templates/templateStringInDeleteExpression.ts === +delete `abc${0}abc`; +>delete `abc${0}abc` : boolean + diff --git a/tests/baselines/reference/templateStringInDeleteExpressionES6.js b/tests/baselines/reference/templateStringInDeleteExpressionES6.js new file mode 100644 index 00000000000..19f5d51b021 --- /dev/null +++ b/tests/baselines/reference/templateStringInDeleteExpressionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInDeleteExpressionES6.ts] +delete `abc${0}abc`; + +//// [templateStringInDeleteExpressionES6.js] +delete `abc${0}abc`; diff --git a/tests/baselines/reference/templateStringInDeleteExpressionES6.types b/tests/baselines/reference/templateStringInDeleteExpressionES6.types new file mode 100644 index 00000000000..d67d4d8c703 --- /dev/null +++ b/tests/baselines/reference/templateStringInDeleteExpressionES6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/templates/templateStringInDeleteExpressionES6.ts === +delete `abc${0}abc`; +>delete `abc${0}abc` : boolean + diff --git a/tests/baselines/reference/templateStringInDivision.errors.txt b/tests/baselines/reference/templateStringInDivision.errors.txt new file mode 100644 index 00000000000..32cc4830399 --- /dev/null +++ b/tests/baselines/reference/templateStringInDivision.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInDivision.ts(1,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es6/templates/templateStringInDivision.ts (1 errors) ==== + var x = `abc${ 1 }def` / 1; + ~~~~~~~~~~~~~~ +!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInDivision.js b/tests/baselines/reference/templateStringInDivision.js new file mode 100644 index 00000000000..d624d73f6bb --- /dev/null +++ b/tests/baselines/reference/templateStringInDivision.js @@ -0,0 +1,5 @@ +//// [templateStringInDivision.ts] +var x = `abc${ 1 }def` / 1; + +//// [templateStringInDivision.js] +var x = ("abc" + 1 + "def") / 1; diff --git a/tests/baselines/reference/templateStringInEqualityChecks.js b/tests/baselines/reference/templateStringInEqualityChecks.js new file mode 100644 index 00000000000..54f5fa610c2 --- /dev/null +++ b/tests/baselines/reference/templateStringInEqualityChecks.js @@ -0,0 +1,8 @@ +//// [templateStringInEqualityChecks.ts] +var x = `abc${0}abc` === `abc` || + `abc` !== `abc${0}abc` && + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; + +//// [templateStringInEqualityChecks.js] +var x = "abc" + 0 + "abc" === "abc" || "abc" !== "abc" + 0 + "abc" && "abc" + 0 + "abc" == "abc0abc" && "abc0abc" !== "abc" + 0 + "abc"; diff --git a/tests/baselines/reference/templateStringInEqualityChecks.types b/tests/baselines/reference/templateStringInEqualityChecks.types new file mode 100644 index 00000000000..a942d4bce98 --- /dev/null +++ b/tests/baselines/reference/templateStringInEqualityChecks.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts === +var x = `abc${0}abc` === `abc` || +>x : boolean +>`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean +>`abc${0}abc` === `abc` : boolean + + `abc` !== `abc${0}abc` && +>`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean +>`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" : boolean +>`abc` !== `abc${0}abc` : boolean + + `abc${0}abc` == "abc0abc" && +>`abc${0}abc` == "abc0abc" : boolean + + "abc0abc" !== `abc${0}abc`; +>"abc0abc" !== `abc${0}abc` : boolean + diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.js b/tests/baselines/reference/templateStringInEqualityChecksES6.js new file mode 100644 index 00000000000..317db1ab366 --- /dev/null +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.js @@ -0,0 +1,8 @@ +//// [templateStringInEqualityChecksES6.ts] +var x = `abc${0}abc` === `abc` || + `abc` !== `abc${0}abc` && + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; + +//// [templateStringInEqualityChecksES6.js] +var x = `abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc`; diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.types b/tests/baselines/reference/templateStringInEqualityChecksES6.types new file mode 100644 index 00000000000..ffe300ccd38 --- /dev/null +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts === +var x = `abc${0}abc` === `abc` || +>x : boolean +>`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean +>`abc${0}abc` === `abc` : boolean + + `abc` !== `abc${0}abc` && +>`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean +>`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" : boolean +>`abc` !== `abc${0}abc` : boolean + + `abc${0}abc` == "abc0abc" && +>`abc${0}abc` == "abc0abc" : boolean + + "abc0abc" !== `abc${0}abc`; +>"abc0abc" !== `abc${0}abc` : boolean + diff --git a/tests/baselines/reference/templateStringInFunctionExpression.js b/tests/baselines/reference/templateStringInFunctionExpression.js new file mode 100644 index 00000000000..9711b2edc3a --- /dev/null +++ b/tests/baselines/reference/templateStringInFunctionExpression.js @@ -0,0 +1,11 @@ +//// [templateStringInFunctionExpression.ts] +var x = function y() { + `abc${ 0 }def` + return `abc${ 0 }def`; +}; + +//// [templateStringInFunctionExpression.js] +var x = function y() { + "abc" + 0 + "def"; + return "abc" + 0 + "def"; +}; diff --git a/tests/baselines/reference/templateStringInFunctionExpression.types b/tests/baselines/reference/templateStringInFunctionExpression.types new file mode 100644 index 00000000000..1ec389488ec --- /dev/null +++ b/tests/baselines/reference/templateStringInFunctionExpression.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/templates/templateStringInFunctionExpression.ts === +var x = function y() { +>x : () => string +>function y() { `abc${ 0 }def` return `abc${ 0 }def`;} : () => string +>y : () => string + + `abc${ 0 }def` + return `abc${ 0 }def`; +}; diff --git a/tests/baselines/reference/templateStringInFunctionExpressionES6.js b/tests/baselines/reference/templateStringInFunctionExpressionES6.js new file mode 100644 index 00000000000..e7cffe1471b --- /dev/null +++ b/tests/baselines/reference/templateStringInFunctionExpressionES6.js @@ -0,0 +1,11 @@ +//// [templateStringInFunctionExpressionES6.ts] +var x = function y() { + `abc${ 0 }def` + return `abc${ 0 }def`; +}; + +//// [templateStringInFunctionExpressionES6.js] +var x = function y() { + `abc${0}def`; + return `abc${0}def`; +}; diff --git a/tests/baselines/reference/templateStringInFunctionExpressionES6.types b/tests/baselines/reference/templateStringInFunctionExpressionES6.types new file mode 100644 index 00000000000..a31558fbe37 --- /dev/null +++ b/tests/baselines/reference/templateStringInFunctionExpressionES6.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/templates/templateStringInFunctionExpressionES6.ts === +var x = function y() { +>x : () => string +>function y() { `abc${ 0 }def` return `abc${ 0 }def`;} : () => string +>y : () => string + + `abc${ 0 }def` + return `abc${ 0 }def`; +}; diff --git a/tests/baselines/reference/templateStringInFunctionParameterType.errors.txt b/tests/baselines/reference/templateStringInFunctionParameterType.errors.txt new file mode 100644 index 00000000000..e0c35e3f19f --- /dev/null +++ b/tests/baselines/reference/templateStringInFunctionParameterType.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,12): error TS1138: Parameter declaration expected. +tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,19): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts (4 errors) ==== + function f(`hello`); + ~~~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~ +!!! error TS2394: Overload signature is not compatible with function implementation. + ~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + function f(x: string); + function f(x: string) { + return x; + } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInFunctionParameterTypeES6.errors.txt b/tests/baselines/reference/templateStringInFunctionParameterTypeES6.errors.txt new file mode 100644 index 00000000000..948c9ccc6cd --- /dev/null +++ b/tests/baselines/reference/templateStringInFunctionParameterTypeES6.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,12): error TS1138: Parameter declaration expected. +tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,19): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,1): error TS2394: Overload signature is not compatible with function implementation. +tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts (4 errors) ==== + function f(`hello`); + ~~~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~ +!!! error TS2394: Overload signature is not compatible with function implementation. + ~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + function f(x: string); + function f(x: string) { + return x; + } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInInOperator.js b/tests/baselines/reference/templateStringInInOperator.js new file mode 100644 index 00000000000..c496e335dd4 --- /dev/null +++ b/tests/baselines/reference/templateStringInInOperator.js @@ -0,0 +1,5 @@ +//// [templateStringInInOperator.ts] +var x = `${ "hi" }` in { hi: 10, hello: 20}; + +//// [templateStringInInOperator.js] +var x = "" + "hi" in { hi: 10, hello: 20 }; diff --git a/tests/baselines/reference/templateStringInInOperator.types b/tests/baselines/reference/templateStringInInOperator.types new file mode 100644 index 00000000000..da35bdc499c --- /dev/null +++ b/tests/baselines/reference/templateStringInInOperator.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringInInOperator.ts === +var x = `${ "hi" }` in { hi: 10, hello: 20}; +>x : boolean +>`${ "hi" }` in { hi: 10, hello: 20} : boolean +>{ hi: 10, hello: 20} : { hi: number; hello: number; } +>hi : number +>hello : number + diff --git a/tests/baselines/reference/templateStringInInOperatorES6.js b/tests/baselines/reference/templateStringInInOperatorES6.js new file mode 100644 index 00000000000..bd4daef3b6d --- /dev/null +++ b/tests/baselines/reference/templateStringInInOperatorES6.js @@ -0,0 +1,5 @@ +//// [templateStringInInOperatorES6.ts] +var x = `${ "hi" }` in { hi: 10, hello: 20}; + +//// [templateStringInInOperatorES6.js] +var x = `${"hi"}` in { hi: 10, hello: 20 }; diff --git a/tests/baselines/reference/templateStringInInOperatorES6.types b/tests/baselines/reference/templateStringInInOperatorES6.types new file mode 100644 index 00000000000..7af0d7a2f48 --- /dev/null +++ b/tests/baselines/reference/templateStringInInOperatorES6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringInInOperatorES6.ts === +var x = `${ "hi" }` in { hi: 10, hello: 20}; +>x : boolean +>`${ "hi" }` in { hi: 10, hello: 20} : boolean +>{ hi: 10, hello: 20} : { hi: number; hello: number; } +>hi : number +>hello : number + diff --git a/tests/baselines/reference/templateStringInIndexExpression.js b/tests/baselines/reference/templateStringInIndexExpression.js new file mode 100644 index 00000000000..680cfb49f47 --- /dev/null +++ b/tests/baselines/reference/templateStringInIndexExpression.js @@ -0,0 +1,5 @@ +//// [templateStringInIndexExpression.ts] +`abc${0}abc`[`0`]; + +//// [templateStringInIndexExpression.js] +("abc" + 0 + "abc")["0"]; diff --git a/tests/baselines/reference/templateStringInIndexExpression.types b/tests/baselines/reference/templateStringInIndexExpression.types new file mode 100644 index 00000000000..a0270b850ab --- /dev/null +++ b/tests/baselines/reference/templateStringInIndexExpression.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/templates/templateStringInIndexExpression.ts === +`abc${0}abc`[`0`]; +>`abc${0}abc`[`0`] : any + diff --git a/tests/baselines/reference/templateStringInIndexExpressionES6.js b/tests/baselines/reference/templateStringInIndexExpressionES6.js new file mode 100644 index 00000000000..c1c87211a05 --- /dev/null +++ b/tests/baselines/reference/templateStringInIndexExpressionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInIndexExpressionES6.ts] +`abc${0}abc`[`0`]; + +//// [templateStringInIndexExpressionES6.js] +`abc${0}abc`[`0`]; diff --git a/tests/baselines/reference/templateStringInIndexExpressionES6.types b/tests/baselines/reference/templateStringInIndexExpressionES6.types new file mode 100644 index 00000000000..aceb22da529 --- /dev/null +++ b/tests/baselines/reference/templateStringInIndexExpressionES6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/templates/templateStringInIndexExpressionES6.ts === +`abc${0}abc`[`0`]; +>`abc${0}abc`[`0`] : any + diff --git a/tests/baselines/reference/templateStringInInstanceOf.errors.txt b/tests/baselines/reference/templateStringInInstanceOf.errors.txt new file mode 100644 index 00000000000..04d2584712b --- /dev/null +++ b/tests/baselines/reference/templateStringInInstanceOf.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInInstanceOf.ts(1,9): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + +==== tests/cases/conformance/es6/templates/templateStringInInstanceOf.ts (1 errors) ==== + var x = `abc${ 0 }def` instanceof String; + ~~~~~~~~~~~~~~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInInstanceOf.js b/tests/baselines/reference/templateStringInInstanceOf.js new file mode 100644 index 00000000000..ccf022cc703 --- /dev/null +++ b/tests/baselines/reference/templateStringInInstanceOf.js @@ -0,0 +1,5 @@ +//// [templateStringInInstanceOf.ts] +var x = `abc${ 0 }def` instanceof String; + +//// [templateStringInInstanceOf.js] +var x = "abc" + 0 + "def" instanceof String; diff --git a/tests/baselines/reference/templateStringInInstanceOfES6.errors.txt b/tests/baselines/reference/templateStringInInstanceOfES6.errors.txt new file mode 100644 index 00000000000..0fc8c81ab92 --- /dev/null +++ b/tests/baselines/reference/templateStringInInstanceOfES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInInstanceOfES6.ts(1,9): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + +==== tests/cases/conformance/es6/templates/templateStringInInstanceOfES6.ts (1 errors) ==== + var x = `abc${ 0 }def` instanceof String; + ~~~~~~~~~~~~~~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInInstanceOfES6.js b/tests/baselines/reference/templateStringInInstanceOfES6.js new file mode 100644 index 00000000000..793c183d137 --- /dev/null +++ b/tests/baselines/reference/templateStringInInstanceOfES6.js @@ -0,0 +1,5 @@ +//// [templateStringInInstanceOfES6.ts] +var x = `abc${ 0 }def` instanceof String; + +//// [templateStringInInstanceOfES6.js] +var x = `abc${0}def` instanceof String; diff --git a/tests/baselines/reference/templateStringInModuleName.errors.txt b/tests/baselines/reference/templateStringInModuleName.errors.txt new file mode 100644 index 00000000000..fb6188d9d9a --- /dev/null +++ b/tests/baselines/reference/templateStringInModuleName.errors.txt @@ -0,0 +1,38 @@ +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,21): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,24): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,1): error TS2304: Cannot find name 'declare'. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS2304: Cannot find name 'module'. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,1): error TS2304: Cannot find name 'declare'. +tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS2304: Cannot find name 'module'. + + +==== tests/cases/conformance/es6/templates/templateStringInModuleName.ts (10 errors) ==== + declare module `M1` { + ~~~~~~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + } + + declare module `M${2}` { + ~~~~~~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInModuleNameES6.errors.txt b/tests/baselines/reference/templateStringInModuleNameES6.errors.txt new file mode 100644 index 00000000000..228fd32357c --- /dev/null +++ b/tests/baselines/reference/templateStringInModuleNameES6.errors.txt @@ -0,0 +1,32 @@ +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,9): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,21): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,9): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,24): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,1): error TS2304: Cannot find name 'declare'. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,9): error TS2304: Cannot find name 'module'. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,1): error TS2304: Cannot find name 'declare'. +tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,9): error TS2304: Cannot find name 'module'. + + +==== tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts (8 errors) ==== + declare module `M1` { + ~~~~~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + } + + declare module `M${2}` { + ~~~~~~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +!!! error TS2304: Cannot find name 'module'. + } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInModulo.errors.txt b/tests/baselines/reference/templateStringInModulo.errors.txt new file mode 100644 index 00000000000..f9f0b0257d6 --- /dev/null +++ b/tests/baselines/reference/templateStringInModulo.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInModulo.ts(1,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es6/templates/templateStringInModulo.ts (1 errors) ==== + var x = 1 % `abc${ 1 }def`; + ~~~~~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInModulo.js b/tests/baselines/reference/templateStringInModulo.js new file mode 100644 index 00000000000..65d5ec7eaab --- /dev/null +++ b/tests/baselines/reference/templateStringInModulo.js @@ -0,0 +1,5 @@ +//// [templateStringInModulo.ts] +var x = 1 % `abc${ 1 }def`; + +//// [templateStringInModulo.js] +var x = 1 % ("abc" + 1 + "def"); diff --git a/tests/baselines/reference/templateStringInModuloES6.errors.txt b/tests/baselines/reference/templateStringInModuloES6.errors.txt new file mode 100644 index 00000000000..db410876b91 --- /dev/null +++ b/tests/baselines/reference/templateStringInModuloES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInModuloES6.ts(1,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es6/templates/templateStringInModuloES6.ts (1 errors) ==== + var x = 1 % `abc${ 1 }def`; + ~~~~~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInModuloES6.js b/tests/baselines/reference/templateStringInModuloES6.js new file mode 100644 index 00000000000..2fae209b85f --- /dev/null +++ b/tests/baselines/reference/templateStringInModuloES6.js @@ -0,0 +1,5 @@ +//// [templateStringInModuloES6.ts] +var x = 1 % `abc${ 1 }def`; + +//// [templateStringInModuloES6.js] +var x = 1 % `abc${1}def`; diff --git a/tests/baselines/reference/templateStringInMultiplication.errors.txt b/tests/baselines/reference/templateStringInMultiplication.errors.txt new file mode 100644 index 00000000000..11a4ea9985e --- /dev/null +++ b/tests/baselines/reference/templateStringInMultiplication.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInMultiplication.ts(1,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es6/templates/templateStringInMultiplication.ts (1 errors) ==== + var x = 1 * `abc${ 1 }def`; + ~~~~~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInMultiplication.js b/tests/baselines/reference/templateStringInMultiplication.js new file mode 100644 index 00000000000..e48db6e1715 --- /dev/null +++ b/tests/baselines/reference/templateStringInMultiplication.js @@ -0,0 +1,5 @@ +//// [templateStringInMultiplication.ts] +var x = 1 * `abc${ 1 }def`; + +//// [templateStringInMultiplication.js] +var x = 1 * ("abc" + 1 + "def"); diff --git a/tests/baselines/reference/templateStringInMultiplicationES6.errors.txt b/tests/baselines/reference/templateStringInMultiplicationES6.errors.txt new file mode 100644 index 00000000000..ee27091778f --- /dev/null +++ b/tests/baselines/reference/templateStringInMultiplicationES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInMultiplicationES6.ts(1,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + + +==== tests/cases/conformance/es6/templates/templateStringInMultiplicationES6.ts (1 errors) ==== + var x = 1 * `abc${ 1 }def`; + ~~~~~~~~~~~~~~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInMultiplicationES6.js b/tests/baselines/reference/templateStringInMultiplicationES6.js new file mode 100644 index 00000000000..f890e900301 --- /dev/null +++ b/tests/baselines/reference/templateStringInMultiplicationES6.js @@ -0,0 +1,5 @@ +//// [templateStringInMultiplicationES6.ts] +var x = 1 * `abc${ 1 }def`; + +//// [templateStringInMultiplicationES6.js] +var x = 1 * `abc${1}def`; diff --git a/tests/baselines/reference/templateStringInNewOperator.errors.txt b/tests/baselines/reference/templateStringInNewOperator.errors.txt new file mode 100644 index 00000000000..eed7415e5d2 --- /dev/null +++ b/tests/baselines/reference/templateStringInNewOperator.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInNewOperator.ts(1,9): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + +==== tests/cases/conformance/es6/templates/templateStringInNewOperator.ts (1 errors) ==== + var x = new `abc${ 1 }def`; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInNewOperator.js b/tests/baselines/reference/templateStringInNewOperator.js new file mode 100644 index 00000000000..8d76d59f7ee --- /dev/null +++ b/tests/baselines/reference/templateStringInNewOperator.js @@ -0,0 +1,5 @@ +//// [templateStringInNewOperator.ts] +var x = new `abc${ 1 }def`; + +//// [templateStringInNewOperator.js] +var x = new ("abc" + 1 + "def"); diff --git a/tests/baselines/reference/templateStringInNewOperatorES6.errors.txt b/tests/baselines/reference/templateStringInNewOperatorES6.errors.txt new file mode 100644 index 00000000000..f4363d9ff20 --- /dev/null +++ b/tests/baselines/reference/templateStringInNewOperatorES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInNewOperatorES6.ts(1,9): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + +==== tests/cases/conformance/es6/templates/templateStringInNewOperatorES6.ts (1 errors) ==== + var x = new `abc${ 1 }def`; + ~~~~~~~~~~~~~~~~~~ +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInNewOperatorES6.js b/tests/baselines/reference/templateStringInNewOperatorES6.js new file mode 100644 index 00000000000..066978f736b --- /dev/null +++ b/tests/baselines/reference/templateStringInNewOperatorES6.js @@ -0,0 +1,5 @@ +//// [templateStringInNewOperatorES6.ts] +var x = new `abc${ 1 }def`; + +//// [templateStringInNewOperatorES6.js] +var x = new `abc${1}def`; diff --git a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt new file mode 100644 index 00000000000..b510e46ba6a --- /dev/null +++ b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt @@ -0,0 +1,29 @@ +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,5): error TS1136: Property assignment expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,8): error TS1005: ',' expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,10): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(4,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts (6 errors) ==== + var x = { + ~ + ~ + a: `abc${ 123 }def`, + ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~ + `b`: 321 + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~~~ +!!! error TS1134: Variable declaration expected. + ~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt b/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt new file mode 100644 index 00000000000..c633d61afb5 --- /dev/null +++ b/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,5): error TS1136: Property assignment expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,8): error TS1005: ',' expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,10): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(4,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts (5 errors) ==== + var x = { + ~ + a: `abc${ 123 }def`, + ~~~~~~~~~~~~~~~~~~~~~~~~ + `b`: 321 + ~~~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~~~ +!!! error TS1134: Variable declaration expected. + ~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInParentheses.js b/tests/baselines/reference/templateStringInParentheses.js new file mode 100644 index 00000000000..6c5c678bf4e --- /dev/null +++ b/tests/baselines/reference/templateStringInParentheses.js @@ -0,0 +1,5 @@ +//// [templateStringInParentheses.ts] +var x = (`abc${0}abc`); + +//// [templateStringInParentheses.js] +var x = ("abc" + 0 + "abc"); diff --git a/tests/baselines/reference/templateStringInParentheses.types b/tests/baselines/reference/templateStringInParentheses.types new file mode 100644 index 00000000000..7e597dc0108 --- /dev/null +++ b/tests/baselines/reference/templateStringInParentheses.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInParentheses.ts === +var x = (`abc${0}abc`); +>x : string +>(`abc${0}abc`) : string + diff --git a/tests/baselines/reference/templateStringInParenthesesES6.js b/tests/baselines/reference/templateStringInParenthesesES6.js new file mode 100644 index 00000000000..0776ea594d2 --- /dev/null +++ b/tests/baselines/reference/templateStringInParenthesesES6.js @@ -0,0 +1,5 @@ +//// [templateStringInParenthesesES6.ts] +var x = (`abc${0}abc`); + +//// [templateStringInParenthesesES6.js] +var x = (`abc${0}abc`); diff --git a/tests/baselines/reference/templateStringInParenthesesES6.types b/tests/baselines/reference/templateStringInParenthesesES6.types new file mode 100644 index 00000000000..3afb3530dee --- /dev/null +++ b/tests/baselines/reference/templateStringInParenthesesES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInParenthesesES6.ts === +var x = (`abc${0}abc`); +>x : string +>(`abc${0}abc`) : string + diff --git a/tests/baselines/reference/templateStringInPropertyAssignment.js b/tests/baselines/reference/templateStringInPropertyAssignment.js new file mode 100644 index 00000000000..99fb24712c0 --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyAssignment.js @@ -0,0 +1,9 @@ +//// [templateStringInPropertyAssignment.ts] +var x = { + a: `abc${ 123 }def${ 456 }ghi` +} + +//// [templateStringInPropertyAssignment.js] +var x = { + a: "abc" + 123 + "def" + 456 + "ghi" +}; diff --git a/tests/baselines/reference/templateStringInPropertyAssignment.types b/tests/baselines/reference/templateStringInPropertyAssignment.types new file mode 100644 index 00000000000..ff5ecb410db --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyAssignment.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringInPropertyAssignment.ts === +var x = { +>x : { a: string; } +>{ a: `abc${ 123 }def${ 456 }ghi`} : { a: string; } + + a: `abc${ 123 }def${ 456 }ghi` +>a : string +} diff --git a/tests/baselines/reference/templateStringInPropertyAssignmentES6.js b/tests/baselines/reference/templateStringInPropertyAssignmentES6.js new file mode 100644 index 00000000000..fc35c0a831a --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyAssignmentES6.js @@ -0,0 +1,9 @@ +//// [templateStringInPropertyAssignmentES6.ts] +var x = { + a: `abc${ 123 }def${ 456 }ghi` +} + +//// [templateStringInPropertyAssignmentES6.js] +var x = { + a: `abc${123}def${456}ghi` +}; diff --git a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types new file mode 100644 index 00000000000..fafc9f12a48 --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringInPropertyAssignmentES6.ts === +var x = { +>x : { a: string; } +>{ a: `abc${ 123 }def${ 456 }ghi`} : { a: string; } + + a: `abc${ 123 }def${ 456 }ghi` +>a : string +} diff --git a/tests/baselines/reference/templateStringInPropertyName1.errors.txt b/tests/baselines/reference/templateStringInPropertyName1.errors.txt new file mode 100644 index 00000000000..c0b89e02d68 --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyName1.errors.txt @@ -0,0 +1,26 @@ +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,5): error TS1136: Property assignment expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,8): error TS1005: ',' expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,10): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts (6 errors) ==== + var x = { + ~ + ~ + `a`: 321 + ~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~~~ +!!! error TS1134: Variable declaration expected. + ~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInPropertyName2.errors.txt b/tests/baselines/reference/templateStringInPropertyName2.errors.txt new file mode 100644 index 00000000000..d9302d25fa9 --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyName2.errors.txt @@ -0,0 +1,26 @@ +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,5): error TS1136: Property assignment expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,32): error TS1005: ',' expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,34): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts (6 errors) ==== + var x = { + ~ + ~ + `abc${ 123 }def${ 456 }ghi`: 321 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~~~ +!!! error TS1134: Variable declaration expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt b/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt new file mode 100644 index 00000000000..f6e1bfc4206 --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,5): error TS1136: Property assignment expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,8): error TS1005: ',' expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,10): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts (5 errors) ==== + var x = { + ~ + `a`: 321 + ~~~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~~~ +!!! error TS1134: Variable declaration expected. + ~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt b/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt new file mode 100644 index 00000000000..2ce2e8aac88 --- /dev/null +++ b/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,5): error TS1136: Property assignment expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,32): error TS1005: ',' expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,34): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts (5 errors) ==== + var x = { + ~ + `abc${ 123 }def${ 456 }ghi`: 321 + ~~~~~~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~~~ +!!! error TS1134: Variable declaration expected. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.js b/tests/baselines/reference/templateStringInSwitchAndCase.js new file mode 100644 index 00000000000..67f182f8012 --- /dev/null +++ b/tests/baselines/reference/templateStringInSwitchAndCase.js @@ -0,0 +1,15 @@ +//// [templateStringInSwitchAndCase.ts] +switch (`abc${0}abc`) { + case `abc`: + case `123`: + case `abc${0}abc`: + `def${1}def`; +} + +//// [templateStringInSwitchAndCase.js] +switch ("abc" + 0 + "abc") { + case "abc": + case "123": + case "abc" + 0 + "abc": + "def" + 1 + "def"; +} diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.types b/tests/baselines/reference/templateStringInSwitchAndCase.types new file mode 100644 index 00000000000..26ec05dbca6 --- /dev/null +++ b/tests/baselines/reference/templateStringInSwitchAndCase.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts === +switch (`abc${0}abc`) { +No type information for this code. case `abc`: +No type information for this code. case `123`: +No type information for this code. case `abc${0}abc`: +No type information for this code. `def${1}def`; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.js b/tests/baselines/reference/templateStringInSwitchAndCaseES6.js new file mode 100644 index 00000000000..b52cb48cfde --- /dev/null +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.js @@ -0,0 +1,15 @@ +//// [templateStringInSwitchAndCaseES6.ts] +switch (`abc${0}abc`) { + case `abc`: + case `123`: + case `abc${0}abc`: + `def${1}def`; +} + +//// [templateStringInSwitchAndCaseES6.js] +switch (`abc${0}abc`) { + case `abc`: + case `123`: + case `abc${0}abc`: + `def${1}def`; +} diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types new file mode 100644 index 00000000000..6bd8772ff49 --- /dev/null +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts === +switch (`abc${0}abc`) { +No type information for this code. case `abc`: +No type information for this code. case `123`: +No type information for this code. case `abc${0}abc`: +No type information for this code. `def${1}def`; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInTypeAssertion.js b/tests/baselines/reference/templateStringInTypeAssertion.js new file mode 100644 index 00000000000..94533248b6d --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeAssertion.js @@ -0,0 +1,5 @@ +//// [templateStringInTypeAssertion.ts] +var x = `abc${ 123 }def`; + +//// [templateStringInTypeAssertion.js] +var x = ("abc" + 123 + "def"); diff --git a/tests/baselines/reference/templateStringInTypeAssertion.types b/tests/baselines/reference/templateStringInTypeAssertion.types new file mode 100644 index 00000000000..006ba12c1c6 --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeAssertion.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInTypeAssertion.ts === +var x = `abc${ 123 }def`; +>x : any +>`abc${ 123 }def` : any + diff --git a/tests/baselines/reference/templateStringInTypeAssertionES6.js b/tests/baselines/reference/templateStringInTypeAssertionES6.js new file mode 100644 index 00000000000..08331911c7d --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeAssertionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInTypeAssertionES6.ts] +var x = `abc${ 123 }def`; + +//// [templateStringInTypeAssertionES6.js] +var x = `abc${123}def`; diff --git a/tests/baselines/reference/templateStringInTypeAssertionES6.types b/tests/baselines/reference/templateStringInTypeAssertionES6.types new file mode 100644 index 00000000000..26d7ccc2e60 --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeAssertionES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInTypeAssertionES6.ts === +var x = `abc${ 123 }def`; +>x : any +>`abc${ 123 }def` : any + diff --git a/tests/baselines/reference/templateStringInTypeOf.js b/tests/baselines/reference/templateStringInTypeOf.js new file mode 100644 index 00000000000..2543091df88 --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeOf.js @@ -0,0 +1,5 @@ +//// [templateStringInTypeOf.ts] +var x = typeof `abc${ 123 }def`; + +//// [templateStringInTypeOf.js] +var x = typeof ("abc" + 123 + "def"); diff --git a/tests/baselines/reference/templateStringInTypeOf.types b/tests/baselines/reference/templateStringInTypeOf.types new file mode 100644 index 00000000000..8b94bc7ea1a --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeOf.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInTypeOf.ts === +var x = typeof `abc${ 123 }def`; +>x : string +>typeof `abc${ 123 }def` : string + diff --git a/tests/baselines/reference/templateStringInTypeOfES6.js b/tests/baselines/reference/templateStringInTypeOfES6.js new file mode 100644 index 00000000000..e8566277449 --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeOfES6.js @@ -0,0 +1,5 @@ +//// [templateStringInTypeOfES6.ts] +var x = typeof `abc${ 123 }def`; + +//// [templateStringInTypeOfES6.js] +var x = typeof `abc${123}def`; diff --git a/tests/baselines/reference/templateStringInTypeOfES6.types b/tests/baselines/reference/templateStringInTypeOfES6.types new file mode 100644 index 00000000000..457af8de0de --- /dev/null +++ b/tests/baselines/reference/templateStringInTypeOfES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInTypeOfES6.ts === +var x = typeof `abc${ 123 }def`; +>x : string +>typeof `abc${ 123 }def` : string + diff --git a/tests/baselines/reference/templateStringInUnaryPlus.js b/tests/baselines/reference/templateStringInUnaryPlus.js new file mode 100644 index 00000000000..83f107b3ac2 --- /dev/null +++ b/tests/baselines/reference/templateStringInUnaryPlus.js @@ -0,0 +1,5 @@ +//// [templateStringInUnaryPlus.ts] +var x = +`abc${ 123 }def`; + +//// [templateStringInUnaryPlus.js] +var x = +("abc" + 123 + "def"); diff --git a/tests/baselines/reference/templateStringInUnaryPlus.types b/tests/baselines/reference/templateStringInUnaryPlus.types new file mode 100644 index 00000000000..4746f2c1fc7 --- /dev/null +++ b/tests/baselines/reference/templateStringInUnaryPlus.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInUnaryPlus.ts === +var x = +`abc${ 123 }def`; +>x : number +>+`abc${ 123 }def` : number + diff --git a/tests/baselines/reference/templateStringInUnaryPlusES6.js b/tests/baselines/reference/templateStringInUnaryPlusES6.js new file mode 100644 index 00000000000..efeed300f7c --- /dev/null +++ b/tests/baselines/reference/templateStringInUnaryPlusES6.js @@ -0,0 +1,5 @@ +//// [templateStringInUnaryPlusES6.ts] +var x = +`abc${ 123 }def`; + +//// [templateStringInUnaryPlusES6.js] +var x = +`abc${123}def`; diff --git a/tests/baselines/reference/templateStringInUnaryPlusES6.types b/tests/baselines/reference/templateStringInUnaryPlusES6.types new file mode 100644 index 00000000000..67ad03fc53c --- /dev/null +++ b/tests/baselines/reference/templateStringInUnaryPlusES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInUnaryPlusES6.ts === +var x = +`abc${ 123 }def`; +>x : number +>+`abc${ 123 }def` : number + diff --git a/tests/baselines/reference/templateStringInWhile.js b/tests/baselines/reference/templateStringInWhile.js new file mode 100644 index 00000000000..31f7dba45d1 --- /dev/null +++ b/tests/baselines/reference/templateStringInWhile.js @@ -0,0 +1,9 @@ +//// [templateStringInWhile.ts] +while (`abc${0}abc`) { + `def${1}def`; +} + +//// [templateStringInWhile.js] +while ("abc" + 0 + "abc") { + "def" + 1 + "def"; +} diff --git a/tests/baselines/reference/templateStringInWhile.types b/tests/baselines/reference/templateStringInWhile.types new file mode 100644 index 00000000000..1b080f31f1c --- /dev/null +++ b/tests/baselines/reference/templateStringInWhile.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInWhile.ts === +while (`abc${0}abc`) { +No type information for this code. `def${1}def`; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInWhileES6.js b/tests/baselines/reference/templateStringInWhileES6.js new file mode 100644 index 00000000000..a4f19b80d0a --- /dev/null +++ b/tests/baselines/reference/templateStringInWhileES6.js @@ -0,0 +1,9 @@ +//// [templateStringInWhileES6.ts] +while (`abc${0}abc`) { + `def${1}def`; +} + +//// [templateStringInWhileES6.js] +while (`abc${0}abc`) { + `def${1}def`; +} diff --git a/tests/baselines/reference/templateStringInWhileES6.types b/tests/baselines/reference/templateStringInWhileES6.types new file mode 100644 index 00000000000..d4ef3b02fe2 --- /dev/null +++ b/tests/baselines/reference/templateStringInWhileES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringInWhileES6.ts === +while (`abc${0}abc`) { +No type information for this code. `def${1}def`; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt new file mode 100644 index 00000000000..b70af797c5c --- /dev/null +++ b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS1003: Identifier expected. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,15): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts (5 errors) ==== + function* gen { + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~~~ +!!! error TS2304: Cannot find name 'gen'. + // Once this is supported, the inner expression does not need to be parenthesized. + var x = yield `abc${ x }def`; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.js b/tests/baselines/reference/templateStringWithEmbeddedAddition.js new file mode 100644 index 00000000000..2cf74941600 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedAddition.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedAddition.ts] +var x = `abc${ 10 + 10 }def`; + +//// [templateStringWithEmbeddedAddition.js] +var x = "abc" + (10 + 10) + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.types b/tests/baselines/reference/templateStringWithEmbeddedAddition.types new file mode 100644 index 00000000000..3a6bf864cb6 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedAddition.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedAddition.ts === +var x = `abc${ 10 + 10 }def`; +>x : string +>10 + 10 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.js b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.js new file mode 100644 index 00000000000..72beea32d57 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedAdditionES6.ts] +var x = `abc${ 10 + 10 }def`; + +//// [templateStringWithEmbeddedAdditionES6.js] +var x = `abc${10 + 10}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types new file mode 100644 index 00000000000..699162a3783 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedAdditionES6.ts === +var x = `abc${ 10 + 10 }def`; +>x : string +>10 + 10 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.js b/tests/baselines/reference/templateStringWithEmbeddedArray.js new file mode 100644 index 00000000000..1fb6512db47 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedArray.ts] +var x = `abc${ [1,2,3] }def`; + +//// [templateStringWithEmbeddedArray.js] +var x = "abc" + [1, 2, 3] + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.types b/tests/baselines/reference/templateStringWithEmbeddedArray.types new file mode 100644 index 00000000000..4c022d8a401 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedArray.ts === +var x = `abc${ [1,2,3] }def`; +>x : string +>[1,2,3] : number[] + diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js new file mode 100644 index 00000000000..804ef7a4e78 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedArrayES6.ts] +var x = `abc${ [1,2,3] }def`; + +//// [templateStringWithEmbeddedArrayES6.js] +var x = `abc${[1, 2, 3]}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types new file mode 100644 index 00000000000..06876fa3f0e --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrayES6.ts === +var x = `abc${ [1,2,3] }def`; +>x : string +>[1,2,3] : number[] + diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js new file mode 100644 index 00000000000..eb2579b0cc3 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedArrowFunction.ts] +var x = `abc${ x => x }def`; + +//// [templateStringWithEmbeddedArrowFunction.js] +var x = "abc" + function (x) { return x; } + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types new file mode 100644 index 00000000000..d6f25761999 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunction.ts === +var x = `abc${ x => x }def`; +>x : string +>x => x : (x: any) => any +>x : any +>x : any + diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js new file mode 100644 index 00000000000..f6f068aaa37 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedArrowFunctionES6.ts] +var x = `abc${ x => x }def`; + +//// [templateStringWithEmbeddedArrowFunctionES6.js] +var x = `abc${function (x) { return x; }}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types new file mode 100644 index 00000000000..748f457f22b --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunctionES6.ts === +var x = `abc${ x => x }def`; +>x : string +>x => x : (x: any) => any +>x : any +>x : any + diff --git a/tests/baselines/reference/templateStringWithEmbeddedComments.js b/tests/baselines/reference/templateStringWithEmbeddedComments.js new file mode 100644 index 00000000000..58a73e89ba7 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedComments.js @@ -0,0 +1,16 @@ +//// [templateStringWithEmbeddedComments.ts] +`head${ // single line comment +10 +} +middle${ +/* Multi- + * line + * comment + */ + 20 + // closing comment +} +tail`; + +//// [templateStringWithEmbeddedComments.js] +"head" + 10 + "\nmiddle" + 20 + "\ntail"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedComments.types b/tests/baselines/reference/templateStringWithEmbeddedComments.types new file mode 100644 index 00000000000..a375ef6ab6f --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedComments.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedComments.ts === +`head${ // single line comment +No type information for this code.10 +No type information for this code.} +No type information for this code.middle${ +No type information for this code./* Multi- +No type information for this code. * line +No type information for this code. * comment +No type information for this code. */ +No type information for this code. 20 +No type information for this code. // closing comment +No type information for this code.} +No type information for this code.tail`; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.js b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.js new file mode 100644 index 00000000000..c6b3649ad2a --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.js @@ -0,0 +1,16 @@ +//// [templateStringWithEmbeddedCommentsES6.ts] +`head${ // single line comment +10 +} +middle${ +/* Multi- + * line + * comment + */ + 20 + // closing comment +} +tail`; + +//// [templateStringWithEmbeddedCommentsES6.js] +"head" + 10 + "\nmiddle" + 20 + "\ntail"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types new file mode 100644 index 00000000000..0c79ee294d9 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedCommentsES6.ts === +`head${ // single line comment +No type information for this code.10 +No type information for this code.} +No type information for this code.middle${ +No type information for this code./* Multi- +No type information for this code. * line +No type information for this code. * comment +No type information for this code. */ +No type information for this code. 20 +No type information for this code. // closing comment +No type information for this code.} +No type information for this code.tail`; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditional.js b/tests/baselines/reference/templateStringWithEmbeddedConditional.js new file mode 100644 index 00000000000..5b03f56a019 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedConditional.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedConditional.ts] +var x = `abc${ true ? false : " " }def`; + +//// [templateStringWithEmbeddedConditional.js] +var x = "abc" + (true ? false : " ") + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditional.types b/tests/baselines/reference/templateStringWithEmbeddedConditional.types new file mode 100644 index 00000000000..de4249792e7 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedConditional.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditional.ts === +var x = `abc${ true ? false : " " }def`; +>x : string +>true ? false : " " : string | boolean + diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.js b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.js new file mode 100644 index 00000000000..f6cae50a511 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedConditionalES6.ts] +var x = `abc${ true ? false : " " }def`; + +//// [templateStringWithEmbeddedConditionalES6.js] +var x = `abc${true ? false : " "}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types new file mode 100644 index 00000000000..3fa96510f41 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditionalES6.ts === +var x = `abc${ true ? false : " " }def`; +>x : string +>true ? false : " " : string | boolean + diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivision.js b/tests/baselines/reference/templateStringWithEmbeddedDivision.js new file mode 100644 index 00000000000..f9996ae035d --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedDivision.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedDivision.ts] +var x = `abc${ 1 / 1 }def`; + +//// [templateStringWithEmbeddedDivision.js] +var x = "abc" + 1 / 1 + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivision.types b/tests/baselines/reference/templateStringWithEmbeddedDivision.types new file mode 100644 index 00000000000..e742733a23c --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedDivision.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivision.ts === +var x = `abc${ 1 / 1 }def`; +>x : string +>1 / 1 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.js b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.js new file mode 100644 index 00000000000..47715d3f31b --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedDivisionES6.ts] +var x = `abc${ 1 / 1 }def`; + +//// [templateStringWithEmbeddedDivisionES6.js] +var x = `abc${1 / 1}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types new file mode 100644 index 00000000000..20bdc9449d1 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivisionES6.ts === +var x = `abc${ 1 / 1 }def`; +>x : string +>1 / 1 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js new file mode 100644 index 00000000000..3447ff87ac3 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js @@ -0,0 +1,7 @@ +//// [templateStringWithEmbeddedFunctionExpression.ts] +var x = `abc${ function y() { return y; } }def`; + +//// [templateStringWithEmbeddedFunctionExpression.js] +var x = "abc" + function y() { + return y; +} + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types new file mode 100644 index 00000000000..e66313848a6 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpression.ts === +var x = `abc${ function y() { return y; } }def`; +>x : string +>function y() { return y; } : () => any +>y : () => any +>y : () => any + diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js new file mode 100644 index 00000000000..46e37c0ac18 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.js @@ -0,0 +1,7 @@ +//// [templateStringWithEmbeddedFunctionExpressionES6.ts] +var x = `abc${ function y() { return y; } }def`; + +//// [templateStringWithEmbeddedFunctionExpressionES6.js] +var x = `abc${function y() { + return y; +}}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types new file mode 100644 index 00000000000..e5c55c2736c --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpressionES6.ts === +var x = `abc${ function y() { return y; } }def`; +>x : string +>function y() { return y; } : () => any +>y : () => any +>y : () => any + diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.js b/tests/baselines/reference/templateStringWithEmbeddedInOperator.js new file mode 100644 index 00000000000..091843ea52e --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedInOperator.ts] +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; + +//// [templateStringWithEmbeddedInOperator.js] +var x = "abc" + ("hi" in { hi: 10, hello: 20 }) + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types new file mode 100644 index 00000000000..bff1ea66e1d --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperator.ts === +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; +>x : string +>"hi" in { hi: 10, hello: 20} : boolean +>{ hi: 10, hello: 20} : { hi: number; hello: number; } +>hi : number +>hello : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js new file mode 100644 index 00000000000..f6510c2fab9 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedInOperatorES6.ts] +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; + +//// [templateStringWithEmbeddedInOperatorES6.js] +var x = `abc${"hi" in { hi: 10, hello: 20 }}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types new file mode 100644 index 00000000000..6bba79af40d --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperatorES6.ts === +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; +>x : string +>"hi" in { hi: 10, hello: 20} : boolean +>{ hi: 10, hello: 20} : { hi: number; hello: number; } +>hi : number +>hello : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.errors.txt new file mode 100644 index 00000000000..08c8c21b5ee --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOf.ts(1,16): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + +==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOf.ts (1 errors) ==== + var x = `abc${ "hello" instanceof String }def`; + ~~~~~~~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js new file mode 100644 index 00000000000..009f6bf988d --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedInstanceOf.ts] +var x = `abc${ "hello" instanceof String }def`; + +//// [templateStringWithEmbeddedInstanceOf.js] +var x = "abc" + ("hello" instanceof String) + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.errors.txt new file mode 100644 index 00000000000..85ebb9966ca --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts(1,16): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + + +==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts (1 errors) ==== + var x = `abc${ "hello" instanceof String }def`; + ~~~~~~~ +!!! error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.js b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.js new file mode 100644 index 00000000000..16a2d2c6797 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedInstanceOfES6.ts] +var x = `abc${ "hello" instanceof String }def`; + +//// [templateStringWithEmbeddedInstanceOfES6.js] +var x = `abc${"hello" instanceof String}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.js b/tests/baselines/reference/templateStringWithEmbeddedModulo.js new file mode 100644 index 00000000000..6fe9be64314 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedModulo.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedModulo.ts] +var x = `abc${ 1 % 1 }def`; + +//// [templateStringWithEmbeddedModulo.js] +var x = "abc" + 1 % 1 + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.types b/tests/baselines/reference/templateStringWithEmbeddedModulo.types new file mode 100644 index 00000000000..0c24f566846 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedModulo.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedModulo.ts === +var x = `abc${ 1 % 1 }def`; +>x : string +>1 % 1 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.js b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.js new file mode 100644 index 00000000000..0226277d987 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedModuloES6.ts] +var x = `abc${ 1 % 1 }def`; + +//// [templateStringWithEmbeddedModuloES6.js] +var x = `abc${1 % 1}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types new file mode 100644 index 00000000000..02f42a956b9 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedModuloES6.ts === +var x = `abc${ 1 % 1 }def`; +>x : string +>1 % 1 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js new file mode 100644 index 00000000000..7ac4b1b534c --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedMultiplication.ts] +var x = `abc${ 7 * 6 }def`; + +//// [templateStringWithEmbeddedMultiplication.js] +var x = "abc" + 7 * 6 + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types new file mode 100644 index 00000000000..60c7bab0d1e --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplication.ts === +var x = `abc${ 7 * 6 }def`; +>x : string +>7 * 6 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.js b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.js new file mode 100644 index 00000000000..3624fe7878a --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedMultiplicationES6.ts] +var x = `abc${ 7 * 6 }def`; + +//// [templateStringWithEmbeddedMultiplicationES6.js] +var x = `abc${7 * 6}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types new file mode 100644 index 00000000000..5c078b9c1ed --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplicationES6.ts === +var x = `abc${ 7 * 6 }def`; +>x : string +>7 * 6 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js new file mode 100644 index 00000000000..480fbe2573d --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedNewOperator.ts] +var x = `abc${ new String("Hi") }def`; + +//// [templateStringWithEmbeddedNewOperator.js] +var x = "abc" + new String("Hi") + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types new file mode 100644 index 00000000000..00bf3533003 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperator.ts === +var x = `abc${ new String("Hi") }def`; +>x : string +>new String("Hi") : String +>String : { (value?: any): string; new (value?: any): String; prototype: String; fromCharCode(...codes: number[]): string; } + diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.js b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.js new file mode 100644 index 00000000000..8549e4c6e34 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedNewOperatorES6.ts] +var x = `abc${ new String("Hi") }def`; + +//// [templateStringWithEmbeddedNewOperatorES6.js] +var x = `abc${new String("Hi")}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types new file mode 100644 index 00000000000..36c28473d56 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts === +var x = `abc${ new String("Hi") }def`; +>x : string +>new String("Hi") : String +>String : { (value?: any): string; new (value?: any): String; prototype: String; fromCharCode(...codes: number[]): string; } + diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js new file mode 100644 index 00000000000..40ecf486245 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedObjectLiteral.ts] +var x = `abc${ { x: 10, y: 20 } }def`; + +//// [templateStringWithEmbeddedObjectLiteral.js] +var x = "abc" + { x: 10, y: 20 } + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types new file mode 100644 index 00000000000..0b053e532d8 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteral.ts === +var x = `abc${ { x: 10, y: 20 } }def`; +>x : string +>{ x: 10, y: 20 } : { x: number; y: number; } +>x : number +>y : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js new file mode 100644 index 00000000000..dbc3837e133 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedObjectLiteralES6.ts] +var x = `abc${ { x: 10, y: 20 } }def`; + +//// [templateStringWithEmbeddedObjectLiteralES6.js] +var x = `abc${{ x: 10, y: 20 }}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types new file mode 100644 index 00000000000..1cf1783fec8 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteralES6.ts === +var x = `abc${ { x: 10, y: 20 } }def`; +>x : string +>{ x: 10, y: 20 } : { x: number; y: number; } +>x : number +>y : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js new file mode 100644 index 00000000000..c0059dbb950 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedTemplateString.ts] +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; + +//// [templateStringWithEmbeddedTemplateString.js] +var x = "123" + "456 " + " | " + " 654" + "321 123" + "456 " + " | " + " 654" + "321"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types new file mode 100644 index 00000000000..f63f684222e --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateString.ts === +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; +>x : string + diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.js b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.js new file mode 100644 index 00000000000..0d1fec18af1 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedTemplateStringES6.ts] +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; + +//// [templateStringWithEmbeddedTemplateStringES6.js] +var x = `123${`456 ${" | "} 654`}321 123${`456 ${" | "} 654`}321`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types new file mode 100644 index 00000000000..05816bbcbce --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateStringES6.ts === +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; +>x : string + diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js new file mode 100644 index 00000000000..89d9ba6940c --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedTypeAssertionOnAddition.ts] +var x = `abc${ (10 + 10) }def`; + +//// [templateStringWithEmbeddedTypeAssertionOnAddition.js] +var x = "abc" + (10 + 10) + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types new file mode 100644 index 00000000000..8b0b5ab37d0 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAddition.ts === +var x = `abc${ (10 + 10) }def`; +>x : string +>(10 + 10) : any +>(10 + 10) : number +>10 + 10 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.js b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.js new file mode 100644 index 00000000000..c6422679f3f --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts] +var x = `abc${ (10 + 10) }def`; + +//// [templateStringWithEmbeddedTypeAssertionOnAdditionES6.js] +var x = `abc${(10 + 10)}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types new file mode 100644 index 00000000000..007fdb64736 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts === +var x = `abc${ (10 + 10) }def`; +>x : string +>(10 + 10) : any +>(10 + 10) : number +>10 + 10 : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js new file mode 100644 index 00000000000..10450707b11 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedTypeOfOperator.ts] +var x = `abc${ typeof "hi" }def`; + +//// [templateStringWithEmbeddedTypeOfOperator.js] +var x = "abc" + typeof "hi" + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types new file mode 100644 index 00000000000..ebf391981f1 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperator.ts === +var x = `abc${ typeof "hi" }def`; +>x : string +>typeof "hi" : string + diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.js b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.js new file mode 100644 index 00000000000..8d148744fae --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedTypeOfOperatorES6.ts] +var x = `abc${ typeof "hi" }def`; + +//// [templateStringWithEmbeddedTypeOfOperatorES6.js] +var x = `abc${typeof "hi"}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types new file mode 100644 index 00000000000..cf14a0a0880 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperatorES6.ts === +var x = `abc${ typeof "hi" }def`; +>x : string +>typeof "hi" : string + diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js new file mode 100644 index 00000000000..a4a9c1a8508 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedUnaryPlus.ts] +var x = `abc${ +Infinity }def`; + +//// [templateStringWithEmbeddedUnaryPlus.js] +var x = "abc" + +Infinity + "def"; diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types new file mode 100644 index 00000000000..62ffab420ad --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlus.ts === +var x = `abc${ +Infinity }def`; +>x : string +>+Infinity : number +>Infinity : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.js b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.js new file mode 100644 index 00000000000..4b42bc1083a --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithEmbeddedUnaryPlusES6.ts] +var x = `abc${ +Infinity }def`; + +//// [templateStringWithEmbeddedUnaryPlusES6.js] +var x = `abc${+Infinity}def`; diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types new file mode 100644 index 00000000000..7a002d79b6f --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlusES6.ts === +var x = `abc${ +Infinity }def`; +>x : string +>+Infinity : number +>Infinity : number + diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt new file mode 100644 index 00000000000..b9e803a8a14 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,9): error TS1003: Identifier expected. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1158: Invalid template literal; expected '}' +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1126: Unexpected end of text. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,20): error TS2304: Cannot find name 'yield'. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS2304: Cannot find name 'def'. + + +==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts (8 errors) ==== + function* gen { + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~~~ +!!! error TS2304: Cannot find name 'gen'. + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; + ~~ +!!! error TS1158: Invalid template literal; expected '}' + ~~~~~ + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + ~~~ +!!! error TS2304: Cannot find name 'def'. + } + ~ + + +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + +!!! error TS1126: Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt new file mode 100644 index 00000000000..6cae5332517 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt @@ -0,0 +1,29 @@ +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS1003: Identifier expected. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,17): error TS1005: ';' expected. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1158: Invalid template literal; expected '}' +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1126: Unexpected end of text. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,11): error TS2304: Cannot find name 'gen'. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,20): error TS2304: Cannot find name 'yield'. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,30): error TS2304: Cannot find name 'def'. + + +==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts (7 errors) ==== + function* gen() { + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~~~ +!!! error TS2304: Cannot find name 'gen'. + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; + ~~ +!!! error TS1158: Invalid template literal; expected '}' + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + ~~~ +!!! error TS2304: Cannot find name 'def'. + } + + +!!! error TS1126: Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js new file mode 100644 index 00000000000..8bc6e2c4206 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js @@ -0,0 +1,38 @@ +//// [templateStringWithEmptyLiteralPortions.ts] +var a = ``; + +var b = `${ 0 }`; + +var c = `1${ 0 }`; + +var d = `${ 0 }2`; + +var e = `1${ 0 }2`; + +var f = `${ 0 }${ 0 }`; + +var g = `1${ 0 }${ 0 }`; + +var h = `${ 0 }2${ 0 }`; + +var i = `1${ 0 }2${ 0 }`; + +var j = `${ 0 }${ 0 }3`; + +var k = `1${ 0 }${ 0 }3`; + +var l = `1${ 0 }2${ 0 }3`; + +//// [templateStringWithEmptyLiteralPortions.js] +var a = ""; +var b = "" + 0; +var c = "1" + 0; +var d = "" + 0 + "2"; +var e = "1" + 0 + "2"; +var f = "" + 0 + 0; +var g = "1" + 0 + 0; +var h = "" + 0 + "2" + 0; +var i = "1" + 0 + "2" + 0; +var j = "" + 0 + 0 + "3"; +var k = "1" + 0 + 0 + "3"; +var l = "1" + 0 + "2" + 0 + "3"; diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types new file mode 100644 index 00000000000..a44bab8fe44 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortions.ts === +var a = ``; +>a : string + +var b = `${ 0 }`; +>b : string + +var c = `1${ 0 }`; +>c : string + +var d = `${ 0 }2`; +>d : string + +var e = `1${ 0 }2`; +>e : string + +var f = `${ 0 }${ 0 }`; +>f : string + +var g = `1${ 0 }${ 0 }`; +>g : string + +var h = `${ 0 }2${ 0 }`; +>h : string + +var i = `1${ 0 }2${ 0 }`; +>i : string + +var j = `${ 0 }${ 0 }3`; +>j : string + +var k = `1${ 0 }${ 0 }3`; +>k : string + +var l = `1${ 0 }2${ 0 }3`; +>l : string + diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.js b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.js new file mode 100644 index 00000000000..f0e827cde63 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.js @@ -0,0 +1,38 @@ +//// [templateStringWithEmptyLiteralPortionsES6.ts] +var a = ``; + +var b = `${ 0 }`; + +var c = `1${ 0 }`; + +var d = `${ 0 }2`; + +var e = `1${ 0 }2`; + +var f = `${ 0 }${ 0 }`; + +var g = `1${ 0 }${ 0 }`; + +var h = `${ 0 }2${ 0 }`; + +var i = `1${ 0 }2${ 0 }`; + +var j = `${ 0 }${ 0 }3`; + +var k = `1${ 0 }${ 0 }3`; + +var l = `1${ 0 }2${ 0 }3`; + +//// [templateStringWithEmptyLiteralPortionsES6.js] +var a = ``; +var b = `${0}`; +var c = `1${0}`; +var d = `${0}2`; +var e = `1${0}2`; +var f = `${0}${0}`; +var g = `1${0}${0}`; +var h = `${0}2${0}`; +var i = `1${0}2${0}`; +var j = `${0}${0}3`; +var k = `1${0}${0}3`; +var l = `1${0}2${0}3`; diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types new file mode 100644 index 00000000000..4074831d410 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortionsES6.ts === +var a = ``; +>a : string + +var b = `${ 0 }`; +>b : string + +var c = `1${ 0 }`; +>c : string + +var d = `${ 0 }2`; +>d : string + +var e = `1${ 0 }2`; +>e : string + +var f = `${ 0 }${ 0 }`; +>f : string + +var g = `1${ 0 }${ 0 }`; +>g : string + +var h = `${ 0 }2${ 0 }`; +>h : string + +var i = `1${ 0 }2${ 0 }`; +>i : string + +var j = `${ 0 }${ 0 }3`; +>j : string + +var k = `1${ 0 }${ 0 }3`; +>k : string + +var l = `1${ 0 }2${ 0 }3`; +>l : string + diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js new file mode 100644 index 00000000000..233ab78a195 --- /dev/null +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js @@ -0,0 +1,5 @@ +//// [templateStringWithOpenCommentInStringPortion.ts] +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` + +//// [templateStringWithOpenCommentInStringPortion.js] +" /**head " + 10 + " // still middle " + 20 + " /* still tail "; diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types new file mode 100644 index 00000000000..66070a70ec7 --- /dev/null +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types @@ -0,0 +1,3 @@ +=== tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts === +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.js b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.js new file mode 100644 index 00000000000..45d2d86e97e --- /dev/null +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithOpenCommentInStringPortionES6.ts] +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` + +//// [templateStringWithOpenCommentInStringPortionES6.js] +` /**head ${10} // still middle ${20} /* still tail `; diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types new file mode 100644 index 00000000000..08b5484f3ab --- /dev/null +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types @@ -0,0 +1,3 @@ +=== tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts === +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.js b/tests/baselines/reference/templateStringWithPropertyAccess.js new file mode 100644 index 00000000000..9866b6bd53b --- /dev/null +++ b/tests/baselines/reference/templateStringWithPropertyAccess.js @@ -0,0 +1,5 @@ +//// [templateStringWithPropertyAccess.ts] +`abc${0}abc`.indexOf(`abc`); + +//// [templateStringWithPropertyAccess.js] +("abc" + 0 + "abc").indexOf("abc"); diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.types b/tests/baselines/reference/templateStringWithPropertyAccess.types new file mode 100644 index 00000000000..ae9dbb5249d --- /dev/null +++ b/tests/baselines/reference/templateStringWithPropertyAccess.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/templates/templateStringWithPropertyAccess.ts === +`abc${0}abc`.indexOf(`abc`); +>`abc${0}abc`.indexOf(`abc`) : number +>`abc${0}abc`.indexOf : (searchString: string, position?: number) => number +>indexOf : (searchString: string, position?: number) => number + diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.js b/tests/baselines/reference/templateStringWithPropertyAccessES6.js new file mode 100644 index 00000000000..72f3a16b5c4 --- /dev/null +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.js @@ -0,0 +1,5 @@ +//// [templateStringWithPropertyAccessES6.ts] +`abc${0}abc`.indexOf(`abc`); + +//// [templateStringWithPropertyAccessES6.js] +`abc${0}abc`.indexOf(`abc`); diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.types b/tests/baselines/reference/templateStringWithPropertyAccessES6.types new file mode 100644 index 00000000000..80ea8a0ef8b --- /dev/null +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/templates/templateStringWithPropertyAccessES6.ts === +`abc${0}abc`.indexOf(`abc`); +>`abc${0}abc`.indexOf(`abc`) : number +>`abc${0}abc`.indexOf : (searchString: string, position?: number) => number +>indexOf : (searchString: string, position?: number) => number + diff --git a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt new file mode 100644 index 00000000000..a5e05d986c1 --- /dev/null +++ b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt @@ -0,0 +1,25 @@ +tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(10,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +lib.d.ts(502,11): error TS2300: Duplicate identifier 'TemplateStringsArray'. +tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(2,7): error TS2300: Duplicate identifier 'TemplateStringsArray'. +tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(8,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. + Property 'raw' is missing in type '{ [x: number]: undefined; }'. + + +==== tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts (3 errors) ==== + + class TemplateStringsArray { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'TemplateStringsArray'. + } + + function f(x: TemplateStringsArray, y: number, z: number) { + } + + f({}, 10, 10); + ~~ +!!! error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. + + f `abcdef${ 1234 }${ 5678 }ghijkl`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt new file mode 100644 index 00000000000..6b2d29139ed --- /dev/null +++ b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(5,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. + Property 'raw' is missing in type '{ [x: number]: undefined; }'. + + +==== tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts (2 errors) ==== + + function f(x: TemplateStringsArray, y: number, z: number) { + } + + f({}, 10, 10); + ~~ +!!! error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. + + f `abcdef${ 1234 }${ 5678 }ghijkl`; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.errors.txt new file mode 100644 index 00000000000..8d5f554b42d --- /dev/null +++ b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.errors.txt @@ -0,0 +1,22 @@ +lib.d.ts(502,11): error TS2300: Duplicate identifier 'TemplateStringsArray'. +tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts(2,7): error TS2300: Duplicate identifier 'TemplateStringsArray'. +tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts(8,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. + Property 'raw' is missing in type '{ [x: number]: undefined; }'. + + +==== tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts (2 errors) ==== + + class TemplateStringsArray { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'TemplateStringsArray'. + } + + function f(x: TemplateStringsArray, y: number, z: number) { + } + + f({}, 10, 10); + ~~ +!!! error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. +!!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. + + f `abcdef${ 1234 }${ 5678 }ghijkl`; \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.js b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.js new file mode 100644 index 00000000000..22ce6831f00 --- /dev/null +++ b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.js @@ -0,0 +1,22 @@ +//// [templateStringsArrayTypeRedefinedInES6Mode.ts] + +class TemplateStringsArray { +} + +function f(x: TemplateStringsArray, y: number, z: number) { +} + +f({}, 10, 10); + +f `abcdef${ 1234 }${ 5678 }ghijkl`; + +//// [templateStringsArrayTypeRedefinedInES6Mode.js] +var TemplateStringsArray = (function () { + function TemplateStringsArray() { + } + return TemplateStringsArray; +})(); +function f(x, y, z) { +} +f({}, 10, 10); +f `abcdef${1234}${5678}ghijkl`; diff --git a/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt b/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt index ae4603a1adb..aa12f7039b0 100644 --- a/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt +++ b/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/thisWhenTypeCheckFails.ts(4,17): error TS2323: Type 'void' is not assignable to type 'string'. +tests/cases/compiler/thisWhenTypeCheckFails.ts(4,17): error TS2322: Type 'void' is not assignable to type 'string'. ==== tests/cases/compiler/thisWhenTypeCheckFails.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/thisWhenTypeCheckFails.ts(4,17): error TS2323: Type 'void' var k = () => { var s: string = this.n(); ~ -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. } } } diff --git a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt index 9b068b62e68..b502eaad7e5 100644 --- a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt +++ b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(5,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number': + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. @@ -14,12 +14,12 @@ tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS this.test([1, 2, "hi", 5, ]); ~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. this.test([1, 2, "hi", 5]); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number': +!!! error TS2345: Type 'string | number' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 8bf6cca4855..d1257be13ef 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -1,26 +1,26 @@ tests/cases/compiler/tupleTypes.ts(1,9): error TS1122: A tuple type element list cannot be empty. -tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]': +tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. Property '0' is missing in type 'undefined[]'. -tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]': +tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'. Property '1' is missing in type '[number]'. -tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]': - Types of property '0' are incompatible: +tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. + Types of property '0' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(41,1): error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. -tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]': - Types of property 'pop' are incompatible: - Type '() => string | number' is not assignable to type '() => number': - Type 'string | number' is not assignable to type 'number': +tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => string | number' is not assignable to type '() => number'. + Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]': - Types of property 'pop' are incompatible: - Type '() => {}' is not assignable to type '() => number': +tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. + Types of property 'pop' are incompatible. + Type '() => {}' is not assignable to type '() => number'. Type '{}' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]': - Types of property '1' are incompatible: +tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. + Types of property '1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is not assignable to type '[number, string]': - Types of property '1' are incompatible: +tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is not assignable to type '[number, string]'. + Types of property '1' are incompatible. Type '{}' is not assignable to type 'string'. @@ -42,17 +42,17 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n t = []; // Error ~ -!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]': +!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. !!! error TS2322: Property '0' is missing in type 'undefined[]'. t = [1]; // Error ~ -!!! error TS2322: Type '[number]' is not assignable to type '[number, string]': +!!! error TS2322: Type '[number]' is not assignable to type '[number, string]'. !!! error TS2322: Property '1' is missing in type '[number]'. t = [1, "hello"]; // Ok t = ["hello", 1]; // Error ~ -!!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property '0' are incompatible: +!!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property '0' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. t = [1, "hello", 2]; // Ok @@ -79,7 +79,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n tt = [undefined, undefined]; tt = []; // Error ~~ -!!! error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. var a: number[]; var a1: [number, string]; @@ -87,27 +87,27 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n var a3: [number, {}]; a = a1; // Error ~ -!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => string | number' is not assignable to type '() => number': -!!! error TS2322: Type 'string | number' is not assignable to type 'number': +!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. !!! error TS2322: Type 'string' is not assignable to type 'number'. a = a2; a = a3; // Error ~ -!!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]': -!!! error TS2322: Types of property 'pop' are incompatible: -!!! error TS2322: Type '() => {}' is not assignable to type '() => number': +!!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => {}' is not assignable to type '() => number'. !!! error TS2322: Type '{}' is not assignable to type 'number'. a1 = a2; // Error ~~ -!!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property '1' are incompatible: +!!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property '1' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a1 = a3; // Error ~~ -!!! error TS2322: Type '[number, {}]' is not assignable to type '[number, string]': -!!! error TS2322: Types of property '1' are incompatible: +!!! error TS2322: Type '[number, {}]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property '1' are incompatible. !!! error TS2322: Type '{}' is not assignable to type 'string'. a3 = a1; a3 = a2; diff --git a/tests/baselines/reference/typeAliases.js b/tests/baselines/reference/typeAliases.js new file mode 100644 index 00000000000..0cf0dd92402 --- /dev/null +++ b/tests/baselines/reference/typeAliases.js @@ -0,0 +1,126 @@ +//// [typeAliases.ts] +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. + +type T1 = number; +var x1: number; +var x1: T1; + +type T2 = string; +var x2: string; +var x2: T2; + +type T3 = boolean; +var x3: boolean; +var x3: T3; + +type T4 = void; +var x4: void; +var x4: T4; + +type T5 = any; +var x5: any; +var x5: T5; + +interface I6 { x : string } +type T6 = I6; +var x6: I6; +var x6: T6; + +class C7 { x: boolean } +type T7 = C7; +var x7: C7; +var x7: T7; + +type T8 = string | boolean; +var x8: string | boolean; +var x8: T8; + +type T9 = () => string; +var x9: () => string; +var x9: T9; + +type T10 = { x: number }; +var x10: { x: number }; +var x10: T10; + +type T11 = { new(): boolean }; +var x11: { new(): boolean }; +var x11: T11; + +interface I13 { x: string }; +type T13 = I13; +var x13_1: I13; +var x13_2: T13 + +declare function foo13(t1: T1, t2: T13): void; +foo13(x13_1, x13_2); +foo13(x13_2, x13_1); + +type T14 = string; +var x14: T14; + +declare function foo14_1(x: T14): void; + +declare function foo14_2(x: "click"): void; +declare function foo14_2(x: T14): void; + +type Meters = number + +enum E { x = 10 } + +declare function f15(a: string): boolean; +declare function f15(a: Meters): string; +f15(E.x).toLowerCase(); + +type StringAndBoolean = [string, boolean] +declare function f16(s: StringAndBoolean): string; +var x: [string, boolean]; +f16(x); + +var y: StringAndBoolean = ["1", false]; +y[0].toLowerCase(); + +//// [typeAliases.js] +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. +var x1; +var x1; +var x2; +var x2; +var x3; +var x3; +var x4; +var x4; +var x5; +var x5; +var x6; +var x6; +var C7 = (function () { + function C7() { + } + return C7; +})(); +var x7; +var x7; +var x8; +var x8; +var x9; +var x9; +var x10; +var x10; +var x11; +var x11; +; +var x13_1; +var x13_2; +foo13(x13_1, x13_2); +foo13(x13_2, x13_1); +var x14; +var E; +(function (E) { + E[E["x"] = 10] = "x"; +})(E || (E = {})); +f15(10 /* x */).toLowerCase(); +var x; +f16(x); +var y = ["1", false]; +y[0].toLowerCase(); diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types new file mode 100644 index 00000000000..f6e4afd571e --- /dev/null +++ b/tests/baselines/reference/typeAliases.types @@ -0,0 +1,241 @@ +=== tests/cases/conformance/types/typeAliases/typeAliases.ts === +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. + +type T1 = number; +>T1 : number + +var x1: number; +>x1 : number + +var x1: T1; +>x1 : number +>T1 : number + +type T2 = string; +>T2 : string + +var x2: string; +>x2 : string + +var x2: T2; +>x2 : string +>T2 : string + +type T3 = boolean; +>T3 : boolean + +var x3: boolean; +>x3 : boolean + +var x3: T3; +>x3 : boolean +>T3 : boolean + +type T4 = void; +>T4 : void + +var x4: void; +>x4 : void + +var x4: T4; +>x4 : void +>T4 : void + +type T5 = any; +>T5 : any + +var x5: any; +>x5 : any + +var x5: T5; +>x5 : any +>T5 : any + +interface I6 { x : string } +>I6 : I6 +>x : string + +type T6 = I6; +>T6 : I6 +>I6 : I6 + +var x6: I6; +>x6 : I6 +>I6 : I6 + +var x6: T6; +>x6 : I6 +>T6 : I6 + +class C7 { x: boolean } +>C7 : C7 +>x : boolean + +type T7 = C7; +>T7 : C7 +>C7 : C7 + +var x7: C7; +>x7 : C7 +>C7 : C7 + +var x7: T7; +>x7 : C7 +>T7 : C7 + +type T8 = string | boolean; +>T8 : string | boolean + +var x8: string | boolean; +>x8 : string | boolean + +var x8: T8; +>x8 : string | boolean +>T8 : string | boolean + +type T9 = () => string; +>T9 : () => string + +var x9: () => string; +>x9 : () => string + +var x9: T9; +>x9 : () => string +>T9 : () => string + +type T10 = { x: number }; +>T10 : { x: number; } +>x : number + +var x10: { x: number }; +>x10 : { x: number; } +>x : number + +var x10: T10; +>x10 : { x: number; } +>T10 : { x: number; } + +type T11 = { new(): boolean }; +>T11 : new () => boolean + +var x11: { new(): boolean }; +>x11 : new () => boolean + +var x11: T11; +>x11 : new () => boolean +>T11 : new () => boolean + +interface I13 { x: string }; +>I13 : I13 +>x : string + +type T13 = I13; +>T13 : I13 +>I13 : I13 + +var x13_1: I13; +>x13_1 : I13 +>I13 : I13 + +var x13_2: T13 +>x13_2 : I13 +>T13 : I13 + +declare function foo13(t1: T1, t2: T13): void; +>foo13 : (t1: T1, t2: I13) => void +>T1 : T1 +>I13 : I13 +>T2 : T2 +>T13 : I13 +>t1 : T1 +>T1 : T1 +>t2 : I13 +>T13 : I13 + +foo13(x13_1, x13_2); +>foo13(x13_1, x13_2) : void +>foo13 : (t1: T1, t2: I13) => void +>x13_1 : I13 +>x13_2 : I13 + +foo13(x13_2, x13_1); +>foo13(x13_2, x13_1) : void +>foo13 : (t1: T1, t2: I13) => void +>x13_2 : I13 +>x13_1 : I13 + +type T14 = string; +>T14 : string + +var x14: T14; +>x14 : string +>T14 : string + +declare function foo14_1(x: T14): void; +>foo14_1 : (x: string) => void +>x : string +>T14 : string + +declare function foo14_2(x: "click"): void; +>foo14_2 : { (x: "click"): void; (x: string): void; } +>x : "click" + +declare function foo14_2(x: T14): void; +>foo14_2 : { (x: "click"): void; (x: string): void; } +>x : string +>T14 : string + +type Meters = number +>Meters : number + +enum E { x = 10 } +>E : E +>x : E + +declare function f15(a: string): boolean; +>f15 : { (a: string): boolean; (a: number): string; } +>a : string + +declare function f15(a: Meters): string; +>f15 : { (a: string): boolean; (a: number): string; } +>a : number +>Meters : number + +f15(E.x).toLowerCase(); +>f15(E.x).toLowerCase() : string +>f15(E.x).toLowerCase : () => string +>f15(E.x) : string +>f15 : { (a: string): boolean; (a: number): string; } +>E.x : E +>E : typeof E +>x : E +>toLowerCase : () => string + +type StringAndBoolean = [string, boolean] +>StringAndBoolean : [string, boolean] + +declare function f16(s: StringAndBoolean): string; +>f16 : (s: [string, boolean]) => string +>s : [string, boolean] +>StringAndBoolean : [string, boolean] + +var x: [string, boolean]; +>x : [string, boolean] + +f16(x); +>f16(x) : string +>f16 : (s: [string, boolean]) => string +>x : [string, boolean] + +var y: StringAndBoolean = ["1", false]; +>y : [string, boolean] +>StringAndBoolean : [string, boolean] +>["1", false] : [string, boolean] + +y[0].toLowerCase(); +>y[0].toLowerCase() : string +>y[0].toLowerCase : () => string +>y[0] : string +>y : [string, boolean] +>toLowerCase : () => string + diff --git a/tests/baselines/reference/typeAliasesForObjectTypes.errors.txt b/tests/baselines/reference/typeAliasesForObjectTypes.errors.txt new file mode 100644 index 00000000000..d957b589953 --- /dev/null +++ b/tests/baselines/reference/typeAliasesForObjectTypes.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(14,8): error TS1005: '=' expected. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(14,12): error TS1005: '(' expected. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(4,22): error TS2312: An interface may only extend a class or another interface. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(5,21): error TS2422: A class may only implement another class or interface. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(10,6): error TS2300: Duplicate identifier 'T2'. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(11,6): error TS2300: Duplicate identifier 'T2'. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(14,19): error TS2304: Cannot find name 'T'. + + +==== tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts (7 errors) ==== + type T1 = { x: string } + + // An interface can be named in an extends or implements clause, but a type alias for an object type literal cannot. + interface I1 extends T1 { y: string } + ~~ +!!! error TS2312: An interface may only extend a class or another interface. + class C1 implements T1 { + ~~ +!!! error TS2422: A class may only implement another class or interface. + x: string; + } + + // An interface can have multiple merged declarations, but a type alias for an object type literal cannot. + type T2 = { x: string } + ~~ +!!! error TS2300: Duplicate identifier 'T2'. + type T2 = { y: number } + ~~ +!!! error TS2300: Duplicate identifier 'T2'. + + // An interface can have type parameters, but a type alias for an object type literal cannot. + type T3 = { x: T } + ~ +!!! error TS1005: '=' expected. + ~ +!!! error TS1005: '(' expected. + ~ +!!! error TS2304: Cannot find name 'T'. + \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2.errors.txt b/tests/baselines/reference/typeArgInference2.errors.txt index cf188972b7d..08fc2f4e232 100644 --- a/tests/baselines/reference/typeArgInference2.errors.txt +++ b/tests/baselines/reference/typeArgInference2.errors.txt @@ -1,4 +1,5 @@ -tests/cases/compiler/typeArgInference2.ts(12,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/typeArgInference2.ts(12,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ name: string; a: number; }' is not a valid type argument because it is not a supertype of candidate '{ name: string; b: number; }'. ==== tests/cases/compiler/typeArgInference2.ts (1 errors) ==== @@ -14,5 +15,6 @@ tests/cases/compiler/typeArgInference2.ts(12,10): error TS2346: Supplied paramet var z4 = foo({ name: "abc" }); // { name: string } var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ name: string; a: number; }' is not a valid type argument because it is not a supertype of candidate '{ name: string; b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInference2WithError.errors.txt b/tests/baselines/reference/typeArgInference2WithError.errors.txt index 83fa81b5524..8a191ed310e 100644 --- a/tests/baselines/reference/typeArgInference2WithError.errors.txt +++ b/tests/baselines/reference/typeArgInference2WithError.errors.txt @@ -1,4 +1,5 @@ -tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. ==== tests/cases/compiler/typeArgInference2WithError.ts (1 errors) ==== @@ -9,5 +10,6 @@ tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2346: Supplied declare function foo(x?: T, y?: T): T; var z7 = foo("abc", 5); // Error - ~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt index 27064866755..1131b6e1a68 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt @@ -1,6 +1,5 @@ -tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,6): error TS2343: Type 'Date' does not satisfy the constraint 'Number': - Property 'toFixed' is missing in type 'Date'. -tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,6): error TS2344: Type 'Date' does not satisfy the constraint 'Number'. +tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. ==== tests/cases/compiler/typeArgumentConstraintResolution1.ts (2 errors) ==== @@ -8,9 +7,8 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,6): error TS2344: T function foo1(test: string); function foo1(test: any) { } foo1(""); // should error - ~~~~ -!!! error TS2343: Type 'Date' does not satisfy the constraint 'Number': -!!! error TS2343: Property 'toFixed' is missing in type 'Date'. + ~~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. @@ -18,6 +16,6 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,6): error TS2344: T function foo2(test: string): T; function foo2(test: any): any { return null; } foo2(""); // Type Date does not satisfy the constraint 'Number' for type parameter 'T extends Number' - ~~~~ -!!! error TS2344: Type 'Date' does not satisfy the constraint 'Number'. + ~~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index dbff8b83854..e374de7b13a 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,5 +1,7 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,11): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. ==== tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts (2 errors) ==== @@ -71,8 +73,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11 return null; } var a9a = someGenerics9('', 0, []); - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; @@ -87,8 +90,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,11 z?: Date; } var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. var a9e: {}; var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); var a9f: A92; diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index 4f11cb6135e..c251f860adb 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -3,9 +3,11 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(71,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(81,45): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,56): error TS2304: Cannot find name 'window'. @@ -127,8 +129,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct } var someGenerics9: someGenerics9; var a9a = new someGenerics9('', 0, []); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. var a9a: {}; var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; @@ -145,8 +148,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct !!! error TS2304: Cannot find name 'Window'. } var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. var a9e: {}; diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt index c0ee4329c8d..72db7214c45 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraintAsCommonRoot.errors.txt @@ -1,4 +1,5 @@ -tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'Giraffe' is not a valid type argument because it is not a supertype of candidate 'Elephant'. ==== tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts (1 errors) ==== @@ -9,5 +10,6 @@ tests/cases/compiler/typeArgumentInferenceWithConstraintAsCommonRoot.ts(7,1): er var g: Giraffe; var e: Elephant; f(g, e); // valid because both Giraffe and Elephant satisfy the constraint. T is Animal - ~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'Giraffe' is not a valid type argument because it is not a supertype of candidate 'Elephant'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index c0dbf74f66e..a607bc2dc9d 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -8,9 +8,11 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(49,15): error TS2344: Type 'string' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(55,41): error TS2345: Argument of type '(n: string) => string' is not assignable to parameter of type '(b: number) => number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(85,9): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,11): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,52): error TS2304: Cannot find name 'window'. @@ -109,8 +111,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst return null; } var a9a = someGenerics9('', 0, []); - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; @@ -127,8 +130,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst !!! error TS2304: Cannot find name 'Window'. } var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~~~~~~~~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate '{ x: number; z: any; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. ~~~~~~ !!! error TS2304: Cannot find name 'window'. var a9e: {}; diff --git a/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt b/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt index c0d90304de0..1f1620ed3c1 100644 --- a/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt +++ b/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(10,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(10,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts (2 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(11,5): er var w: string = foo("hi"); // should error ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var z: number = foo("hi"); // should error ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeAssertions.errors.txt b/tests/baselines/reference/typeAssertions.errors.txt index 1ec22da4c57..ab5eb19ce2a 100644 --- a/tests/baselines/reference/typeAssertions.errors.txt +++ b/tests/baselines/reference/typeAssertions.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(5,5): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(31,12): error TS2353: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other: +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(31,12): error TS2352: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other. Property 'p' is missing in type 'SomeOther'. -tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(35,15): error TS2353: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other: +tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(35,15): error TS2352: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other. Property 'x' is missing in type 'SomeOther'. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(37,13): error TS2352: Neither type 'SomeDerived' nor type 'SomeOther' is assignable to the other. tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(38,13): error TS2352: Neither type 'SomeBase' nor type 'SomeOther' is assignable to the other. @@ -42,15 +42,15 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(38,13): err someBase = someBase; someBase = someOther; // Error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other: -!!! error TS2353: Property 'p' is missing in type 'SomeOther'. +!!! error TS2352: Neither type 'SomeOther' nor type 'SomeBase' is assignable to the other. +!!! error TS2352: Property 'p' is missing in type 'SomeOther'. someDerived = someDerived; someDerived = someBase; someDerived = someOther; // Error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2353: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other: -!!! error TS2353: Property 'x' is missing in type 'SomeOther'. +!!! error TS2352: Neither type 'SomeOther' nor type 'SomeDerived' is assignable to the other. +!!! error TS2352: Property 'x' is missing in type 'SomeOther'. someOther = someDerived; // Error ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt index dd7447d2148..e8c9bd6fc20 100644 --- a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt +++ b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2323: Type 'Object' is not assignable to type 'string'. +tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2322: Type 'Object' is not assignable to type 'string'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(4,15): error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error TS2304: Cannot find name 'derp'. @@ -8,10 +8,10 @@ tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error var functions = [function () { var k: string = 10; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. k = new Object(); ~ -!!! error TS2323: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. [1, 2, 3].NonexistantMethod(); ~~~~~~~~~~~~~~~~~ !!! error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'. diff --git a/tests/baselines/reference/typeComparisonCaching.errors.txt b/tests/baselines/reference/typeComparisonCaching.errors.txt new file mode 100644 index 00000000000..8a94bdf835c --- /dev/null +++ b/tests/baselines/reference/typeComparisonCaching.errors.txt @@ -0,0 +1,45 @@ +tests/cases/compiler/typeComparisonCaching.ts(26,1): error TS2322: Type 'B' is not assignable to type 'A'. + Types of property 's' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is not assignable to type 'C'. + Types of property 'q' are incompatible. + Type 'B' is not assignable to type 'A'. + + +==== tests/cases/compiler/typeComparisonCaching.ts (2 errors) ==== + // Check that we only cache results of type comparisons that are free of assumptions + + interface A { + p: C; + s: string; + } + + interface B { + p: D; + s: number; + } + + interface C { + q: A; + } + + interface D { + q: B; + } + + var a: A; + var b: B; + var c: C; + var d: D; + + a = b; + ~ +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 's' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + c = d; // Should not be allowed + ~ +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Types of property 'q' are incompatible. +!!! error TS2322: Type 'B' is not assignable to type 'A'. + \ No newline at end of file diff --git a/tests/baselines/reference/typeComparisonCaching.js b/tests/baselines/reference/typeComparisonCaching.js new file mode 100644 index 00000000000..7d5eb29d52d --- /dev/null +++ b/tests/baselines/reference/typeComparisonCaching.js @@ -0,0 +1,38 @@ +//// [typeComparisonCaching.ts] +// Check that we only cache results of type comparisons that are free of assumptions + +interface A { + p: C; + s: string; +} + +interface B { + p: D; + s: number; +} + +interface C { + q: A; +} + +interface D { + q: B; +} + +var a: A; +var b: B; +var c: C; +var d: D; + +a = b; +c = d; // Should not be allowed + + +//// [typeComparisonCaching.js] +// Check that we only cache results of type comparisons that are free of assumptions +var a; +var b; +var c; +var d; +a = b; +c = d; // Should not be allowed diff --git a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js new file mode 100644 index 00000000000..42bab3cdbe7 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.js @@ -0,0 +1,97 @@ +//// [typeGuardOfFormExpr1AndExpr2.ts] +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrNumOrBool: string | number | boolean; +var numOrBool: number | boolean; +class C { private p; } +var c: C; +var cOrBool: C| boolean; +var strOrNumOrBoolOrC: string | number | boolean | C; + +// A type guard of the form expr1 && expr2 +// - when true, narrows the type of x by expr1 when true and then by expr2 when true, or +// - when false, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when +// false, and T2 is the type of x narrowed by expr1 when true and then by expr2 when false. + +// (typeguard1 && typeguard2) +if (typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// (typeguard1 && typeguard2 && typeguard3) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBoolOrC !== "boolean") { + c = strOrNumOrBoolOrC; // C +} +else { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +} +// (typeguard1 && typeguard2 && typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBool === "boolean") { + cOrBool = strOrNumOrBoolOrC; // C | boolean + bool = strOrNumOrBool; // boolean +} +else { + var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C + var r2: string | number | boolean = strOrNumOrBool; +} +// (typeguard1) && simpleExpr +if (typeof strOrNumOrBool !== "string" && numOrBool !== strOrNumOrBool) { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + var r3: string | number | boolean = strOrNumOrBool; // string | number | boolean +} + +//// [typeGuardOfFormExpr1AndExpr2.js] +var str; +var bool; +var num; +var strOrNum; +var strOrNumOrBool; +var numOrBool; +var C = (function () { + function C() { + } + return C; +})(); +var c; +var cOrBool; +var strOrNumOrBoolOrC; +// A type guard of the form expr1 && expr2 +// - when true, narrows the type of x by expr1 when true and then by expr2 when true, or +// - when false, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when +// false, and T2 is the type of x narrowed by expr1 when true and then by expr2 when false. +// (typeguard1 && typeguard2) +if (typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// (typeguard1 && typeguard2 && typeguard3) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBoolOrC !== "boolean") { + c = strOrNumOrBoolOrC; // C +} +else { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +} +// (typeguard1 && typeguard2 && typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBool === "boolean") { + cOrBool = strOrNumOrBoolOrC; // C | boolean + bool = strOrNumOrBool; // boolean +} +else { + var r1 = strOrNumOrBoolOrC; // string | number | boolean | C + var r2 = strOrNumOrBool; +} +// (typeguard1) && simpleExpr +if (typeof strOrNumOrBool !== "string" && numOrBool !== strOrNumOrBool) { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + var r3 = strOrNumOrBool; // string | number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types new file mode 100644 index 00000000000..f599f1f7ddf --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormExpr1AndExpr2.types @@ -0,0 +1,140 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1AndExpr2.ts === +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var numOrBool: number | boolean; +>numOrBool : number | boolean + +class C { private p; } +>C : C +>p : any + +var c: C; +>c : C +>C : C + +var cOrBool: C| boolean; +>cOrBool : boolean | C +>C : C + +var strOrNumOrBoolOrC: string | number | boolean | C; +>strOrNumOrBoolOrC : string | number | boolean | C +>C : C + +// A type guard of the form expr1 && expr2 +// - when true, narrows the type of x by expr1 when true and then by expr2 when true, or +// - when false, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when +// false, and T2 is the type of x narrowed by expr1 when true and then by expr2 when false. + +// (typeguard1 && typeguard2) +if (typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") { +>typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number" : boolean +>typeof strOrNumOrBool !== "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>typeof strOrNumOrBool !== "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : number | boolean + + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +// (typeguard1 && typeguard2 && typeguard3) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBoolOrC !== "boolean") { +>typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBoolOrC !== "boolean" : boolean +>typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" : boolean +>typeof strOrNumOrBoolOrC !== "string" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : string | number | boolean | C +>typeof strOrNumOrBoolOrC !== "number" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : number | boolean | C +>typeof strOrNumOrBoolOrC !== "boolean" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : boolean | C + + c = strOrNumOrBoolOrC; // C +>c = strOrNumOrBoolOrC : C +>c : C +>strOrNumOrBoolOrC : C +} +else { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +>strOrNumOrBool = strOrNumOrBoolOrC : string | number | boolean +>strOrNumOrBool : string | number | boolean +>strOrNumOrBoolOrC : string | number | boolean +} +// (typeguard1 && typeguard2 && typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBool === "boolean") { +>typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBool === "boolean" : boolean +>typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" : boolean +>typeof strOrNumOrBoolOrC !== "string" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : string | number | boolean | C +>typeof strOrNumOrBoolOrC !== "number" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : number | boolean | C +>typeof strOrNumOrBool === "boolean" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + cOrBool = strOrNumOrBoolOrC; // C | boolean +>cOrBool = strOrNumOrBoolOrC : boolean | C +>cOrBool : boolean | C +>strOrNumOrBoolOrC : boolean | C + + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +else { + var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C +>r1 : string | number | boolean | C +>C : C +>strOrNumOrBoolOrC : string | number | boolean | C + + var r2: string | number | boolean = strOrNumOrBool; +>r2 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} +// (typeguard1) && simpleExpr +if (typeof strOrNumOrBool !== "string" && numOrBool !== strOrNumOrBool) { +>typeof strOrNumOrBool !== "string" && numOrBool !== strOrNumOrBool : boolean +>typeof strOrNumOrBool !== "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>numOrBool !== strOrNumOrBool : boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean + + numOrBool = strOrNumOrBool; // number | boolean +>numOrBool = strOrNumOrBool : number | boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean +} +else { + var r3: string | number | boolean = strOrNumOrBool; // string | number | boolean +>r3 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js new file mode 100644 index 00000000000..7e38232a738 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.js @@ -0,0 +1,97 @@ +//// [typeGuardOfFormExpr1OrExpr2.ts] +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrNumOrBool: string | number | boolean; +var numOrBool: number | boolean; +class C { private p; } +var c: C; +var cOrBool: C| boolean; +var strOrNumOrBoolOrC: string | number | boolean | C; + +// A type guard of the form expr1 || expr2 +// - when true, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when true, +// and T2 is the type of x narrowed by expr1 when false and then by expr2 when true, or +// - when false, narrows the type of x by expr1 when false and then by expr2 when false. + +// (typeguard1 || typeguard2) +if (typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// (typeguard1 || typeguard2 || typeguard3) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBoolOrC === "boolean") { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +} +else { + c = strOrNumOrBoolOrC; // C +} +// (typeguard1 || typeguard2 || typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBool !== "boolean") { + var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C + var r2: string | number | boolean = strOrNumOrBool; +} +else { + cOrBool = strOrNumOrBoolOrC; // C | boolean + bool = strOrNumOrBool; // boolean +} +// (typeguard1) || simpleExpr +if (typeof strOrNumOrBool === "string" || numOrBool !== strOrNumOrBool) { + var r3: string | number | boolean = strOrNumOrBool; // string | number | boolean +} +else { + numOrBool = strOrNumOrBool; // number | boolean +} + +//// [typeGuardOfFormExpr1OrExpr2.js] +var str; +var bool; +var num; +var strOrNum; +var strOrNumOrBool; +var numOrBool; +var C = (function () { + function C() { + } + return C; +})(); +var c; +var cOrBool; +var strOrNumOrBoolOrC; +// A type guard of the form expr1 || expr2 +// - when true, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when true, +// and T2 is the type of x narrowed by expr1 when false and then by expr2 when true, or +// - when false, narrows the type of x by expr1 when false and then by expr2 when false. +// (typeguard1 || typeguard2) +if (typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// (typeguard1 || typeguard2 || typeguard3) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBoolOrC === "boolean") { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +} +else { + c = strOrNumOrBoolOrC; // C +} +// (typeguard1 || typeguard2 || typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBool !== "boolean") { + var r1 = strOrNumOrBoolOrC; // string | number | boolean | C + var r2 = strOrNumOrBool; +} +else { + cOrBool = strOrNumOrBoolOrC; // C | boolean + bool = strOrNumOrBool; // boolean +} +// (typeguard1) || simpleExpr +if (typeof strOrNumOrBool === "string" || numOrBool !== strOrNumOrBool) { + var r3 = strOrNumOrBool; // string | number | boolean +} +else { + numOrBool = strOrNumOrBool; // number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types new file mode 100644 index 00000000000..95152a589e5 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormExpr1OrExpr2.types @@ -0,0 +1,140 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1OrExpr2.ts === +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var numOrBool: number | boolean; +>numOrBool : number | boolean + +class C { private p; } +>C : C +>p : any + +var c: C; +>c : C +>C : C + +var cOrBool: C| boolean; +>cOrBool : boolean | C +>C : C + +var strOrNumOrBoolOrC: string | number | boolean | C; +>strOrNumOrBoolOrC : string | number | boolean | C +>C : C + +// A type guard of the form expr1 || expr2 +// - when true, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when true, +// and T2 is the type of x narrowed by expr1 when false and then by expr2 when true, or +// - when false, narrows the type of x by expr1 when false and then by expr2 when false. + +// (typeguard1 || typeguard2) +if (typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") { +>typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number" : boolean +>typeof strOrNumOrBool === "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>typeof strOrNumOrBool === "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : number | boolean + + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +else { + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +// (typeguard1 || typeguard2 || typeguard3) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBoolOrC === "boolean") { +>typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBoolOrC === "boolean" : boolean +>typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" : boolean +>typeof strOrNumOrBoolOrC === "string" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : string | number | boolean | C +>typeof strOrNumOrBoolOrC === "number" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : number | boolean | C +>typeof strOrNumOrBoolOrC === "boolean" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : boolean | C + + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +>strOrNumOrBool = strOrNumOrBoolOrC : string | number | boolean +>strOrNumOrBool : string | number | boolean +>strOrNumOrBoolOrC : string | number | boolean +} +else { + c = strOrNumOrBoolOrC; // C +>c = strOrNumOrBoolOrC : C +>c : C +>strOrNumOrBoolOrC : C +} +// (typeguard1 || typeguard2 || typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBool !== "boolean") { +>typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBool !== "boolean" : boolean +>typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" : boolean +>typeof strOrNumOrBoolOrC === "string" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : string | number | boolean | C +>typeof strOrNumOrBoolOrC === "number" : boolean +>typeof strOrNumOrBoolOrC : string +>strOrNumOrBoolOrC : number | boolean | C +>typeof strOrNumOrBool !== "boolean" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C +>r1 : string | number | boolean | C +>C : C +>strOrNumOrBoolOrC : string | number | boolean | C + + var r2: string | number | boolean = strOrNumOrBool; +>r2 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} +else { + cOrBool = strOrNumOrBoolOrC; // C | boolean +>cOrBool = strOrNumOrBoolOrC : boolean | C +>cOrBool : boolean | C +>strOrNumOrBoolOrC : boolean | C + + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +// (typeguard1) || simpleExpr +if (typeof strOrNumOrBool === "string" || numOrBool !== strOrNumOrBool) { +>typeof strOrNumOrBool === "string" || numOrBool !== strOrNumOrBool : boolean +>typeof strOrNumOrBool === "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>numOrBool !== strOrNumOrBool : boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean + + var r3: string | number | boolean = strOrNumOrBool; // string | number | boolean +>r3 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} +else { + numOrBool = strOrNumOrBool; // number | boolean +>numOrBool = strOrNumOrBool : number | boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js new file mode 100644 index 00000000000..093e80cbb74 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -0,0 +1,74 @@ +//// [typeGuardOfFormInstanceOf.ts] +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. + +class C1 { + p1: string; +} +class C2 { + p2: number; +} +class D1 extends C1 { + p3: number; +} +var str: string; +var num: number; +var strOrNum: string | number; + +var c1Orc2: C1 | C2; +str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 +str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 +num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 + +var c2Ord1: C2 | D1; +num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 +num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 +str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 +var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 + +//// [typeGuardOfFormInstanceOf.js] +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var C2 = (function () { + function C2() { + } + return C2; +})(); +var D1 = (function (_super) { + __extends(D1, _super); + function D1() { + _super.apply(this, arguments); + } + return D1; +})(C1); +var str; +var num; +var strOrNum; +var c1Orc2; +str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 +str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 +num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 +var c2Ord1; +num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 +num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 +str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 +var r2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.types b/tests/baselines/reference/typeGuardOfFormInstanceOf.types new file mode 100644 index 00000000000..fb44482c86e --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.types @@ -0,0 +1,132 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts === +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. + +class C1 { +>C1 : C1 + + p1: string; +>p1 : string +} +class C2 { +>C2 : C2 + + p2: number; +>p2 : number +} +class D1 extends C1 { +>D1 : D1 +>C1 : C1 + + p3: number; +>p3 : number +} +var str: string; +>str : string + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var c1Orc2: C1 | C2; +>c1Orc2 : C1 | C2 +>C1 : C1 +>C2 : C2 + +str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 +>str = c1Orc2 instanceof C1 && c1Orc2.p1 : string +>str : string +>c1Orc2 instanceof C1 && c1Orc2.p1 : string +>c1Orc2 instanceof C1 : boolean +>c1Orc2 : C1 | C2 +>C1 : typeof C1 +>c1Orc2.p1 : string +>c1Orc2 : C1 +>p1 : string + +num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 +>num = c1Orc2 instanceof C2 && c1Orc2.p2 : number +>num : number +>c1Orc2 instanceof C2 && c1Orc2.p2 : number +>c1Orc2 instanceof C2 : boolean +>c1Orc2 : C1 | C2 +>C2 : typeof C2 +>c1Orc2.p2 : number +>c1Orc2 : C2 +>p2 : number + +str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 +>str = c1Orc2 instanceof D1 && c1Orc2.p1 : string +>str : string +>c1Orc2 instanceof D1 && c1Orc2.p1 : string +>c1Orc2 instanceof D1 : boolean +>c1Orc2 : C1 | C2 +>D1 : typeof D1 +>c1Orc2.p1 : string +>c1Orc2 : D1 +>p1 : string + +num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 +>num = c1Orc2 instanceof D1 && c1Orc2.p3 : number +>num : number +>c1Orc2 instanceof D1 && c1Orc2.p3 : number +>c1Orc2 instanceof D1 : boolean +>c1Orc2 : C1 | C2 +>D1 : typeof D1 +>c1Orc2.p3 : number +>c1Orc2 : D1 +>p3 : number + +var c2Ord1: C2 | D1; +>c2Ord1 : C2 | D1 +>C2 : C2 +>D1 : D1 + +num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 +>num = c2Ord1 instanceof C2 && c2Ord1.p2 : number +>num : number +>c2Ord1 instanceof C2 && c2Ord1.p2 : number +>c2Ord1 instanceof C2 : boolean +>c2Ord1 : C2 | D1 +>C2 : typeof C2 +>c2Ord1.p2 : number +>c2Ord1 : C2 +>p2 : number + +num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 +>num = c2Ord1 instanceof D1 && c2Ord1.p3 : number +>num : number +>c2Ord1 instanceof D1 && c2Ord1.p3 : number +>c2Ord1 instanceof D1 : boolean +>c2Ord1 : C2 | D1 +>D1 : typeof D1 +>c2Ord1.p3 : number +>c2Ord1 : D1 +>p3 : number + +str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 +>str = c2Ord1 instanceof D1 && c2Ord1.p1 : string +>str : string +>c2Ord1 instanceof D1 && c2Ord1.p1 : string +>c2Ord1 instanceof D1 : boolean +>c2Ord1 : C2 | D1 +>D1 : typeof D1 +>c2Ord1.p1 : string +>c2Ord1 : D1 +>p1 : string + +var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 +>r2 : C2 | D1 +>D1 : D1 +>C2 : C2 +>c2Ord1 instanceof C1 && c2Ord1 : C2 | D1 +>c2Ord1 instanceof C1 : boolean +>c2Ord1 : C2 | D1 +>C1 : typeof C1 +>c2Ord1 : C2 | D1 + diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOfOnInterface.js b/tests/baselines/reference/typeGuardOfFormInstanceOfOnInterface.js new file mode 100644 index 00000000000..2f40be79ac4 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormInstanceOfOnInterface.js @@ -0,0 +1,62 @@ +//// [typeGuardOfFormInstanceOfOnInterface.ts] +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. + +interface C1 { + (): C1; + prototype: C1; + p1: string; +} +interface C2 { + (): C2; + prototype: C2; + p2: number; +} +interface D1 extends C1 { + prototype: D1; + p3: number; +} +var str: string; +var num: number; +var strOrNum: string | number; + +var c1: C1; +var c2: C2; +var d1: D1; +var c1Orc2: C1 | C2; +str = c1Orc2 instanceof c1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof c2 && c1Orc2.p2; // C2 +str = c1Orc2 instanceof d1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof d1 && c1Orc2.p3; // D1 + +var c2Ord1: C2 | D1; +num = c2Ord1 instanceof c2 && c2Ord1.p2; // C2 +num = c2Ord1 instanceof d1 && c2Ord1.p3; // D1 +str = c2Ord1 instanceof d1 && c2Ord1.p1; // D1 +var r2: D1 | C2 = c2Ord1 instanceof c1 && c2Ord1; // C2 | D1 + +//// [typeGuardOfFormInstanceOfOnInterface.js] +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. +var str; +var num; +var strOrNum; +var c1; +var c2; +var d1; +var c1Orc2; +str = c1Orc2 instanceof c1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof c2 && c1Orc2.p2; // C2 +str = c1Orc2 instanceof d1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof d1 && c1Orc2.p3; // D1 +var c2Ord1; +num = c2Ord1 instanceof c2 && c2Ord1.p2; // C2 +num = c2Ord1 instanceof d1 && c2Ord1.p3; // D1 +str = c2Ord1 instanceof d1 && c2Ord1.p1; // D1 +var r2 = c2Ord1 instanceof c1 && c2Ord1; // C2 | D1 diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOfOnInterface.types b/tests/baselines/reference/typeGuardOfFormInstanceOfOnInterface.types new file mode 100644 index 00000000000..7bf67da1500 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormInstanceOfOnInterface.types @@ -0,0 +1,162 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOfOnInterface.ts === +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. + +interface C1 { +>C1 : C1 + + (): C1; +>C1 : C1 + + prototype: C1; +>prototype : C1 +>C1 : C1 + + p1: string; +>p1 : string +} +interface C2 { +>C2 : C2 + + (): C2; +>C2 : C2 + + prototype: C2; +>prototype : C2 +>C2 : C2 + + p2: number; +>p2 : number +} +interface D1 extends C1 { +>D1 : D1 +>C1 : C1 + + prototype: D1; +>prototype : D1 +>D1 : D1 + + p3: number; +>p3 : number +} +var str: string; +>str : string + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var c1: C1; +>c1 : C1 +>C1 : C1 + +var c2: C2; +>c2 : C2 +>C2 : C2 + +var d1: D1; +>d1 : D1 +>D1 : D1 + +var c1Orc2: C1 | C2; +>c1Orc2 : C1 | C2 +>C1 : C1 +>C2 : C2 + +str = c1Orc2 instanceof c1 && c1Orc2.p1; // C1 +>str = c1Orc2 instanceof c1 && c1Orc2.p1 : string +>str : string +>c1Orc2 instanceof c1 && c1Orc2.p1 : string +>c1Orc2 instanceof c1 : boolean +>c1Orc2 : C1 | C2 +>c1 : C1 +>c1Orc2.p1 : string +>c1Orc2 : C1 +>p1 : string + +num = c1Orc2 instanceof c2 && c1Orc2.p2; // C2 +>num = c1Orc2 instanceof c2 && c1Orc2.p2 : number +>num : number +>c1Orc2 instanceof c2 && c1Orc2.p2 : number +>c1Orc2 instanceof c2 : boolean +>c1Orc2 : C1 | C2 +>c2 : C2 +>c1Orc2.p2 : number +>c1Orc2 : C2 +>p2 : number + +str = c1Orc2 instanceof d1 && c1Orc2.p1; // C1 +>str = c1Orc2 instanceof d1 && c1Orc2.p1 : string +>str : string +>c1Orc2 instanceof d1 && c1Orc2.p1 : string +>c1Orc2 instanceof d1 : boolean +>c1Orc2 : C1 | C2 +>d1 : D1 +>c1Orc2.p1 : string +>c1Orc2 : D1 +>p1 : string + +num = c1Orc2 instanceof d1 && c1Orc2.p3; // D1 +>num = c1Orc2 instanceof d1 && c1Orc2.p3 : number +>num : number +>c1Orc2 instanceof d1 && c1Orc2.p3 : number +>c1Orc2 instanceof d1 : boolean +>c1Orc2 : C1 | C2 +>d1 : D1 +>c1Orc2.p3 : number +>c1Orc2 : D1 +>p3 : number + +var c2Ord1: C2 | D1; +>c2Ord1 : C2 | D1 +>C2 : C2 +>D1 : D1 + +num = c2Ord1 instanceof c2 && c2Ord1.p2; // C2 +>num = c2Ord1 instanceof c2 && c2Ord1.p2 : number +>num : number +>c2Ord1 instanceof c2 && c2Ord1.p2 : number +>c2Ord1 instanceof c2 : boolean +>c2Ord1 : C2 | D1 +>c2 : C2 +>c2Ord1.p2 : number +>c2Ord1 : C2 +>p2 : number + +num = c2Ord1 instanceof d1 && c2Ord1.p3; // D1 +>num = c2Ord1 instanceof d1 && c2Ord1.p3 : number +>num : number +>c2Ord1 instanceof d1 && c2Ord1.p3 : number +>c2Ord1 instanceof d1 : boolean +>c2Ord1 : C2 | D1 +>d1 : D1 +>c2Ord1.p3 : number +>c2Ord1 : D1 +>p3 : number + +str = c2Ord1 instanceof d1 && c2Ord1.p1; // D1 +>str = c2Ord1 instanceof d1 && c2Ord1.p1 : string +>str : string +>c2Ord1 instanceof d1 && c2Ord1.p1 : string +>c2Ord1 instanceof d1 : boolean +>c2Ord1 : C2 | D1 +>d1 : D1 +>c2Ord1.p1 : string +>c2Ord1 : D1 +>p1 : string + +var r2: D1 | C2 = c2Ord1 instanceof c1 && c2Ord1; // C2 | D1 +>r2 : C2 | D1 +>D1 : D1 +>C2 : C2 +>c2Ord1 instanceof c1 && c2Ord1 : C2 | D1 +>c2Ord1 instanceof c1 : boolean +>c2Ord1 : C2 | D1 +>c1 : C1 +>c2Ord1 : C2 | D1 + diff --git a/tests/baselines/reference/typeGuardOfFormNotExpr.js b/tests/baselines/reference/typeGuardOfFormNotExpr.js new file mode 100644 index 00000000000..62a1b3ff940 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormNotExpr.js @@ -0,0 +1,107 @@ +//// [typeGuardOfFormNotExpr.ts] +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrNumOrBool: string | number | boolean; +var numOrBool: number | boolean; + +// A type guard of the form !expr +// - when true, narrows the type of x by expr when false, or +// - when false, narrows the type of x by expr when true. + +// !typeguard1 +if (!(typeof strOrNum === "string")) { + num === strOrNum; // number +} +else { + str = strOrNum; // string +} +// !(typeguard1 || typeguard2) +if (!(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number")) { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// !(typeguard1) || !(typeguard2) +if (!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number")) { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// !(typeguard1 && typeguard2) +if (!(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number")) { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// !(typeguard1) && !(typeguard2) +if (!(typeof strOrNumOrBool === "string") && !(typeof strOrNumOrBool === "number")) { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// !(typeguard1) && simpleExpr +if (!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool) { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + var r1: string | number | boolean = strOrNumOrBool; // string | number | boolean +} + +//// [typeGuardOfFormNotExpr.js] +var str; +var bool; +var num; +var strOrNum; +var strOrNumOrBool; +var numOrBool; +// A type guard of the form !expr +// - when true, narrows the type of x by expr when false, or +// - when false, narrows the type of x by expr when true. +// !typeguard1 +if (!(typeof strOrNum === "string")) { + num === strOrNum; // number +} +else { + str = strOrNum; // string +} +// !(typeguard1 || typeguard2) +if (!(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number")) { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// !(typeguard1) || !(typeguard2) +if (!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number")) { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// !(typeguard1 && typeguard2) +if (!(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number")) { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// !(typeguard1) && !(typeguard2) +if (!(typeof strOrNumOrBool === "string") && !(typeof strOrNumOrBool === "number")) { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// !(typeguard1) && simpleExpr +if (!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool) { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + var r1 = strOrNumOrBool; // string | number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormNotExpr.types b/tests/baselines/reference/typeGuardOfFormNotExpr.types new file mode 100644 index 00000000000..22d1d71f412 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormNotExpr.types @@ -0,0 +1,160 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormNotExpr.ts === +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var numOrBool: number | boolean; +>numOrBool : number | boolean + +// A type guard of the form !expr +// - when true, narrows the type of x by expr when false, or +// - when false, narrows the type of x by expr when true. + +// !typeguard1 +if (!(typeof strOrNum === "string")) { +>!(typeof strOrNum === "string") : boolean +>(typeof strOrNum === "string") : boolean +>typeof strOrNum === "string" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + num === strOrNum; // number +>num === strOrNum : boolean +>num : number +>strOrNum : number +} +else { + str = strOrNum; // string +>str = strOrNum : string +>str : string +>strOrNum : string +} +// !(typeguard1 || typeguard2) +if (!(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number")) { +>!(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") : boolean +>(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") : boolean +>typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number" : boolean +>typeof strOrNumOrBool === "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>typeof strOrNumOrBool === "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : number | boolean + + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +// !(typeguard1) || !(typeguard2) +if (!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number")) { +>!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number") : boolean +>!(typeof strOrNumOrBool !== "string") : boolean +>(typeof strOrNumOrBool !== "string") : boolean +>typeof strOrNumOrBool !== "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>!(typeof strOrNumOrBool !== "number") : boolean +>(typeof strOrNumOrBool !== "number") : boolean +>typeof strOrNumOrBool !== "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : number | boolean + + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +else { + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +// !(typeguard1 && typeguard2) +if (!(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number")) { +>!(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") : boolean +>(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") : boolean +>typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number" : boolean +>typeof strOrNumOrBool !== "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>typeof strOrNumOrBool !== "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : number | boolean + + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +else { + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +// !(typeguard1) && !(typeguard2) +if (!(typeof strOrNumOrBool === "string") && !(typeof strOrNumOrBool === "number")) { +>!(typeof strOrNumOrBool === "string") && !(typeof strOrNumOrBool === "number") : boolean +>!(typeof strOrNumOrBool === "string") : boolean +>(typeof strOrNumOrBool === "string") : boolean +>typeof strOrNumOrBool === "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>!(typeof strOrNumOrBool === "number") : boolean +>(typeof strOrNumOrBool === "number") : boolean +>typeof strOrNumOrBool === "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : number | boolean + + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +// !(typeguard1) && simpleExpr +if (!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool) { +>!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool : boolean +>!(typeof strOrNumOrBool === "string") : boolean +>(typeof strOrNumOrBool === "string") : boolean +>typeof strOrNumOrBool === "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean +>numOrBool !== strOrNumOrBool : boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean + + numOrBool = strOrNumOrBool; // number | boolean +>numOrBool = strOrNumOrBool : number | boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean +} +else { + var r1: string | number | boolean = strOrNumOrBool; // string | number | boolean +>r1 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js new file mode 100644 index 00000000000..3b0ead5b3c7 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.js @@ -0,0 +1,177 @@ +//// [typeGuardOfFormTypeOfBoolean.ts] +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrBool === "boolean") { + bool = strOrBool; // boolean +} +else { + str = strOrBool; // string +} +if (typeof numOrBool === "boolean") { + bool = numOrBool; // boolean +} +else { + num = numOrBool; // number +} +if (typeof strOrNumOrBool === "boolean") { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +if (typeof boolOrC === "boolean") { + bool = boolOrC; // boolean +} +else { + c = boolOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum === "boolean") { + var z1: string | number = strOrNum; // string | number +} +else { + var z2: string | number = strOrNum; // string | number +} + + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrBool !== "boolean") { + str = strOrBool; // string +} +else { + bool = strOrBool; // boolean +} +if (typeof numOrBool !== "boolean") { + num = numOrBool; // number +} +else { + bool = numOrBool; // boolean +} +if (typeof strOrNumOrBool !== "boolean") { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +if (typeof boolOrC !== "boolean") { + c = boolOrC; // C +} +else { + bool = boolOrC; // boolean +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum !== "boolean") { + var z1: string | number = strOrNum; // string | number +} +else { + var z2: string | number = strOrNum; // string | number +} + + +//// [typeGuardOfFormTypeOfBoolean.js] +var C = (function () { + function C() { + } + return C; +})(); +; +var str; +var bool; +var num; +var strOrNum; +var strOrBool; +var numOrBool; +var strOrNumOrBool; +var strOrC; +var numOrC; +var boolOrC; +var c; +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrBool === "boolean") { + bool = strOrBool; // boolean +} +else { + str = strOrBool; // string +} +if (typeof numOrBool === "boolean") { + bool = numOrBool; // boolean +} +else { + num = numOrBool; // number +} +if (typeof strOrNumOrBool === "boolean") { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +if (typeof boolOrC === "boolean") { + bool = boolOrC; // boolean +} +else { + c = boolOrC; // C +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum === "boolean") { + var z1 = strOrNum; // string | number +} +else { + var z2 = strOrNum; // string | number +} +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrBool !== "boolean") { + str = strOrBool; // string +} +else { + bool = strOrBool; // boolean +} +if (typeof numOrBool !== "boolean") { + num = numOrBool; // number +} +else { + bool = numOrBool; // boolean +} +if (typeof strOrNumOrBool !== "boolean") { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +if (typeof boolOrC !== "boolean") { + c = boolOrC; // C +} +else { + bool = boolOrC; // boolean +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum !== "boolean") { + var z1 = strOrNum; // string | number +} +else { + var z2 = strOrNum; // string | number +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types new file mode 100644 index 00000000000..6bbf5c87c40 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfBoolean.types @@ -0,0 +1,212 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfBoolean.ts === +class C { private p: string }; +>C : C +>p : string + +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrBool: string | boolean; +>strOrBool : string | boolean + +var numOrBool: number | boolean +>numOrBool : number | boolean + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var strOrC: string | C; +>strOrC : string | C +>C : C + +var numOrC: number | C; +>numOrC : number | C +>C : C + +var boolOrC: boolean | C; +>boolOrC : boolean | C +>C : C + +var c: C; +>c : C +>C : C + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrBool === "boolean") { +>typeof strOrBool === "boolean" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + bool = strOrBool; // boolean +>bool = strOrBool : boolean +>bool : boolean +>strOrBool : boolean +} +else { + str = strOrBool; // string +>str = strOrBool : string +>str : string +>strOrBool : string +} +if (typeof numOrBool === "boolean") { +>typeof numOrBool === "boolean" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + bool = numOrBool; // boolean +>bool = numOrBool : boolean +>bool : boolean +>numOrBool : boolean +} +else { + num = numOrBool; // number +>num = numOrBool : number +>num : number +>numOrBool : number +} +if (typeof strOrNumOrBool === "boolean") { +>typeof strOrNumOrBool === "boolean" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +if (typeof boolOrC === "boolean") { +>typeof boolOrC === "boolean" : boolean +>typeof boolOrC : string +>boolOrC : boolean | C + + bool = boolOrC; // boolean +>bool = boolOrC : boolean +>bool : boolean +>boolOrC : boolean +} +else { + c = boolOrC; // C +>c = boolOrC : C +>c : C +>boolOrC : C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum === "boolean") { +>typeof strOrNum === "boolean" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + var z1: string | number = strOrNum; // string | number +>z1 : string | number +>strOrNum : string | number +} +else { + var z2: string | number = strOrNum; // string | number +>z2 : string | number +>strOrNum : string | number +} + + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrBool !== "boolean") { +>typeof strOrBool !== "boolean" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + str = strOrBool; // string +>str = strOrBool : string +>str : string +>strOrBool : string +} +else { + bool = strOrBool; // boolean +>bool = strOrBool : boolean +>bool : boolean +>strOrBool : boolean +} +if (typeof numOrBool !== "boolean") { +>typeof numOrBool !== "boolean" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + num = numOrBool; // number +>num = numOrBool : number +>num : number +>numOrBool : number +} +else { + bool = numOrBool; // boolean +>bool = numOrBool : boolean +>bool : boolean +>numOrBool : boolean +} +if (typeof strOrNumOrBool !== "boolean") { +>typeof strOrNumOrBool !== "boolean" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + strOrNum = strOrNumOrBool; // string | number +>strOrNum = strOrNumOrBool : string | number +>strOrNum : string | number +>strOrNumOrBool : string | number +} +else { + bool = strOrNumOrBool; // boolean +>bool = strOrNumOrBool : boolean +>bool : boolean +>strOrNumOrBool : boolean +} +if (typeof boolOrC !== "boolean") { +>typeof boolOrC !== "boolean" : boolean +>typeof boolOrC : string +>boolOrC : boolean | C + + c = boolOrC; // C +>c = boolOrC : C +>c : C +>boolOrC : C +} +else { + bool = boolOrC; // boolean +>bool = boolOrC : boolean +>bool : boolean +>boolOrC : boolean +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum !== "boolean") { +>typeof strOrNum !== "boolean" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + var z1: string | number = strOrNum; // string | number +>z1 : string | number +>strOrNum : string | number +} +else { + var z2: string | number = strOrNum; // string | number +>z2 : string | number +>strOrNum : string | number +} + diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js new file mode 100644 index 00000000000..0e7ada149df --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.js @@ -0,0 +1,73 @@ +//// [typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts] +class C { private p: string }; + +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrC: string | C; + +// typeof x == s has not effect on typeguard +if (typeof strOrNum == "string") { + var r1 = strOrNum; // string | number +} +else { + var r1 = strOrNum; // string | number +} + +if (typeof strOrBool == "boolean") { + var r2 = strOrBool; // string | boolean +} +else { + var r2 = strOrBool; // string | boolean +} + +if (typeof numOrBool == "number") { + var r3 = numOrBool; // number | boolean +} +else { + var r3 = numOrBool; // number | boolean +} + +if (typeof strOrC == "Object") { + var r4 = strOrC; // string | C +} +else { + var r4 = strOrC; // string | C +} + +//// [typeGuardOfFormTypeOfEqualEqualHasNoEffect.js] +var C = (function () { + function C() { + } + return C; +})(); +; +var strOrNum; +var strOrBool; +var numOrBool; +var strOrC; +// typeof x == s has not effect on typeguard +if (typeof strOrNum == "string") { + var r1 = strOrNum; // string | number +} +else { + var r1 = strOrNum; // string | number +} +if (typeof strOrBool == "boolean") { + var r2 = strOrBool; // string | boolean +} +else { + var r2 = strOrBool; // string | boolean +} +if (typeof numOrBool == "number") { + var r3 = numOrBool; // number | boolean +} +else { + var r3 = numOrBool; // number | boolean +} +if (typeof strOrC == "Object") { + var r4 = strOrC; // string | C +} +else { + var r4 = strOrC; // string | C +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.types b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.types new file mode 100644 index 00000000000..14d4cd61c51 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.types @@ -0,0 +1,78 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts === +class C { private p: string }; +>C : C +>p : string + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrBool: string | boolean; +>strOrBool : string | boolean + +var numOrBool: number | boolean +>numOrBool : number | boolean + +var strOrC: string | C; +>strOrC : string | C +>C : C + +// typeof x == s has not effect on typeguard +if (typeof strOrNum == "string") { +>typeof strOrNum == "string" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + var r1 = strOrNum; // string | number +>r1 : string | number +>strOrNum : string | number +} +else { + var r1 = strOrNum; // string | number +>r1 : string | number +>strOrNum : string | number +} + +if (typeof strOrBool == "boolean") { +>typeof strOrBool == "boolean" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + var r2 = strOrBool; // string | boolean +>r2 : string | boolean +>strOrBool : string | boolean +} +else { + var r2 = strOrBool; // string | boolean +>r2 : string | boolean +>strOrBool : string | boolean +} + +if (typeof numOrBool == "number") { +>typeof numOrBool == "number" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + var r3 = numOrBool; // number | boolean +>r3 : number | boolean +>numOrBool : number | boolean +} +else { + var r3 = numOrBool; // number | boolean +>r3 : number | boolean +>numOrBool : number | boolean +} + +if (typeof strOrC == "Object") { +>typeof strOrC == "Object" : boolean +>typeof strOrC : string +>strOrC : string | C + + var r4 = strOrC; // string | C +>r4 : string | C +>strOrC : string | C +} +else { + var r4 = strOrC; // string | C +>r4 : string | C +>strOrC : string | C +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js new file mode 100644 index 00000000000..6a9851b51ab --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.js @@ -0,0 +1,73 @@ +//// [typeGuardOfFormTypeOfNotEqualHasNoEffect.ts] +class C { private p: string }; + +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrC: string | C; + +// typeof x != s has not effect on typeguard +if (typeof strOrNum != "string") { + var r1 = strOrNum; // string | number +} +else { + var r1 = strOrNum; // string | number +} + +if (typeof strOrBool != "boolean") { + var r2 = strOrBool; // string | boolean +} +else { + var r2 = strOrBool; // string | boolean +} + +if (typeof numOrBool != "number") { + var r3 = numOrBool; // number | boolean +} +else { + var r3 = numOrBool; // number | boolean +} + +if (typeof strOrC != "Object") { + var r4 = strOrC; // string | C +} +else { + var r4 = strOrC; // string | C +} + +//// [typeGuardOfFormTypeOfNotEqualHasNoEffect.js] +var C = (function () { + function C() { + } + return C; +})(); +; +var strOrNum; +var strOrBool; +var numOrBool; +var strOrC; +// typeof x != s has not effect on typeguard +if (typeof strOrNum != "string") { + var r1 = strOrNum; // string | number +} +else { + var r1 = strOrNum; // string | number +} +if (typeof strOrBool != "boolean") { + var r2 = strOrBool; // string | boolean +} +else { + var r2 = strOrBool; // string | boolean +} +if (typeof numOrBool != "number") { + var r3 = numOrBool; // number | boolean +} +else { + var r3 = numOrBool; // number | boolean +} +if (typeof strOrC != "Object") { + var r4 = strOrC; // string | C +} +else { + var r4 = strOrC; // string | C +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.types b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.types new file mode 100644 index 00000000000..322799f6f7a --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.types @@ -0,0 +1,78 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts === +class C { private p: string }; +>C : C +>p : string + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrBool: string | boolean; +>strOrBool : string | boolean + +var numOrBool: number | boolean +>numOrBool : number | boolean + +var strOrC: string | C; +>strOrC : string | C +>C : C + +// typeof x != s has not effect on typeguard +if (typeof strOrNum != "string") { +>typeof strOrNum != "string" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + var r1 = strOrNum; // string | number +>r1 : string | number +>strOrNum : string | number +} +else { + var r1 = strOrNum; // string | number +>r1 : string | number +>strOrNum : string | number +} + +if (typeof strOrBool != "boolean") { +>typeof strOrBool != "boolean" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + var r2 = strOrBool; // string | boolean +>r2 : string | boolean +>strOrBool : string | boolean +} +else { + var r2 = strOrBool; // string | boolean +>r2 : string | boolean +>strOrBool : string | boolean +} + +if (typeof numOrBool != "number") { +>typeof numOrBool != "number" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + var r3 = numOrBool; // number | boolean +>r3 : number | boolean +>numOrBool : number | boolean +} +else { + var r3 = numOrBool; // number | boolean +>r3 : number | boolean +>numOrBool : number | boolean +} + +if (typeof strOrC != "Object") { +>typeof strOrC != "Object" : boolean +>typeof strOrC : string +>strOrC : string | C + + var r4 = strOrC; // string | C +>r4 : string | C +>strOrC : string | C +} +else { + var r4 = strOrC; // string | C +>r4 : string | C +>strOrC : string | C +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js new file mode 100644 index 00000000000..b65ccbb882f --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.js @@ -0,0 +1,176 @@ +//// [typeGuardOfFormTypeOfNumber.ts] +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "number") { + num = strOrNum; // number +} +else { + str === strOrNum; // string +} +if (typeof numOrBool === "number") { + num = numOrBool; // number +} +else { + var x: number | boolean = numOrBool; // number | boolean +} +if (typeof strOrNumOrBool === "number") { + num = strOrNumOrBool; // number +} +else { + strOrBool = strOrNumOrBool; // string | boolean +} +if (typeof numOrC === "number") { + num = numOrC; // number +} +else { + c = numOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool === "number") { + var y1: string | boolean = strOrBool; // string | boolean +} +else { + var y2: string | boolean = strOrBool; // string | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "number") { + str === strOrNum; // string +} +else { + num = strOrNum; // number +} +if (typeof numOrBool !== "number") { + var x: number | boolean = numOrBool; // number | boolean +} +else { + num = numOrBool; // number +} +if (typeof strOrNumOrBool !== "number") { + strOrBool = strOrNumOrBool; // string | boolean +} +else { + num = strOrNumOrBool; // number +} +if (typeof numOrC !== "number") { + c = numOrC; // C +} +else { + num = numOrC; // number +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool !== "number") { + var y1: string | boolean = strOrBool; // string | boolean +} +else { + var y2: string | boolean = strOrBool; // string | boolean +} + + +//// [typeGuardOfFormTypeOfNumber.js] +var C = (function () { + function C() { + } + return C; +})(); +; +var str; +var bool; +var num; +var strOrNum; +var strOrBool; +var numOrBool; +var strOrNumOrBool; +var strOrC; +var numOrC; +var boolOrC; +var c; +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "number") { + num = strOrNum; // number +} +else { + str === strOrNum; // string +} +if (typeof numOrBool === "number") { + num = numOrBool; // number +} +else { + var x = numOrBool; // number | boolean +} +if (typeof strOrNumOrBool === "number") { + num = strOrNumOrBool; // number +} +else { + strOrBool = strOrNumOrBool; // string | boolean +} +if (typeof numOrC === "number") { + num = numOrC; // number +} +else { + c = numOrC; // C +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool === "number") { + var y1 = strOrBool; // string | boolean +} +else { + var y2 = strOrBool; // string | boolean +} +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "number") { + str === strOrNum; // string +} +else { + num = strOrNum; // number +} +if (typeof numOrBool !== "number") { + var x = numOrBool; // number | boolean +} +else { + num = numOrBool; // number +} +if (typeof strOrNumOrBool !== "number") { + strOrBool = strOrNumOrBool; // string | boolean +} +else { + num = strOrNumOrBool; // number +} +if (typeof numOrC !== "number") { + c = numOrC; // C +} +else { + num = numOrC; // number +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool !== "number") { + var y1 = strOrBool; // string | boolean +} +else { + var y2 = strOrBool; // string | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types new file mode 100644 index 00000000000..1949f5aa17d --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNumber.types @@ -0,0 +1,209 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNumber.ts === +class C { private p: string }; +>C : C +>p : string + +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrBool: string | boolean; +>strOrBool : string | boolean + +var numOrBool: number | boolean +>numOrBool : number | boolean + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var strOrC: string | C; +>strOrC : string | C +>C : C + +var numOrC: number | C; +>numOrC : number | C +>C : C + +var boolOrC: boolean | C; +>boolOrC : boolean | C +>C : C + +var c: C; +>c : C +>C : C + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "number") { +>typeof strOrNum === "number" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + num = strOrNum; // number +>num = strOrNum : number +>num : number +>strOrNum : number +} +else { + str === strOrNum; // string +>str === strOrNum : boolean +>str : string +>strOrNum : string +} +if (typeof numOrBool === "number") { +>typeof numOrBool === "number" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + num = numOrBool; // number +>num = numOrBool : number +>num : number +>numOrBool : number +} +else { + var x: number | boolean = numOrBool; // number | boolean +>x : number | boolean +>numOrBool : boolean +} +if (typeof strOrNumOrBool === "number") { +>typeof strOrNumOrBool === "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + num = strOrNumOrBool; // number +>num = strOrNumOrBool : number +>num : number +>strOrNumOrBool : number +} +else { + strOrBool = strOrNumOrBool; // string | boolean +>strOrBool = strOrNumOrBool : string | boolean +>strOrBool : string | boolean +>strOrNumOrBool : string | boolean +} +if (typeof numOrC === "number") { +>typeof numOrC === "number" : boolean +>typeof numOrC : string +>numOrC : number | C + + num = numOrC; // number +>num = numOrC : number +>num : number +>numOrC : number +} +else { + c = numOrC; // C +>c = numOrC : C +>c : C +>numOrC : C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool === "number") { +>typeof strOrBool === "number" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + var y1: string | boolean = strOrBool; // string | boolean +>y1 : string | boolean +>strOrBool : string | boolean +} +else { + var y2: string | boolean = strOrBool; // string | boolean +>y2 : string | boolean +>strOrBool : string | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "number") { +>typeof strOrNum !== "number" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + str === strOrNum; // string +>str === strOrNum : boolean +>str : string +>strOrNum : string +} +else { + num = strOrNum; // number +>num = strOrNum : number +>num : number +>strOrNum : number +} +if (typeof numOrBool !== "number") { +>typeof numOrBool !== "number" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + var x: number | boolean = numOrBool; // number | boolean +>x : number | boolean +>numOrBool : boolean +} +else { + num = numOrBool; // number +>num = numOrBool : number +>num : number +>numOrBool : number +} +if (typeof strOrNumOrBool !== "number") { +>typeof strOrNumOrBool !== "number" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + strOrBool = strOrNumOrBool; // string | boolean +>strOrBool = strOrNumOrBool : string | boolean +>strOrBool : string | boolean +>strOrNumOrBool : string | boolean +} +else { + num = strOrNumOrBool; // number +>num = strOrNumOrBool : number +>num : number +>strOrNumOrBool : number +} +if (typeof numOrC !== "number") { +>typeof numOrC !== "number" : boolean +>typeof numOrC : string +>numOrC : number | C + + c = numOrC; // C +>c = numOrC : C +>c : C +>numOrC : C +} +else { + num = numOrC; // number +>num = numOrC : number +>num : number +>numOrC : number +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool !== "number") { +>typeof strOrBool !== "number" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + var y1: string | boolean = strOrBool; // string | boolean +>y1 : string | boolean +>strOrBool : string | boolean +} +else { + var y2: string | boolean = strOrBool; // string | boolean +>y2 : string | boolean +>strOrBool : string | boolean +} + diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js new file mode 100644 index 00000000000..3bb1a2091f6 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js @@ -0,0 +1,155 @@ +//// [typeGuardOfFormTypeOfOther.ts] +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var emptyObj: {}; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with any value but 'string', 'number' or 'boolean', +// - when true, removes the primitive types string, number, and boolean from the type of x, or +// - when false, has no effect on the type of x. + +if (typeof strOrC === "Object") { + c = strOrC; // C +} +else { + var r2: string | C = strOrC; // string | C +} +if (typeof numOrC === "Object") { + c = numOrC; // C +} +else { + var r3: number | C = numOrC; // number | C +} +if (typeof boolOrC === "Object") { + c = boolOrC; // C +} +else { + var r4: boolean | C = boolOrC; // boolean | C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool === "Object") { + var q1: string | number | boolean = strOrNumOrBool; // string | number | boolean +} +else { + var q2: string | number | boolean = strOrNumOrBool; // string | number | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrC !== "Object") { + var r2: string | C = strOrC; // string | C +} +else { + c = strOrC; // C +} +if (typeof numOrC !== "Object") { + var r3: number | C = numOrC; // number | C +} +else { + c = numOrC; // C +} +if (typeof boolOrC !== "Object") { + var r4: boolean | C = boolOrC; // boolean | C +} +else { + c = boolOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool !== "Object") { + var q1: string | number | boolean = strOrNumOrBool; // string | number | boolean +} +else { + var q2: string | number | boolean = strOrNumOrBool; // string | number | boolean +} + + +//// [typeGuardOfFormTypeOfOther.js] +var C = (function () { + function C() { + } + return C; +})(); +; +var str; +var bool; +var num; +var strOrNum; +var strOrBool; +var numOrBool; +var strOrNumOrBool; +var strOrC; +var numOrC; +var boolOrC; +var emptyObj; +var c; +// A type guard of the form typeof x === s, +// where s is a string literal with any value but 'string', 'number' or 'boolean', +// - when true, removes the primitive types string, number, and boolean from the type of x, or +// - when false, has no effect on the type of x. +if (typeof strOrC === "Object") { + c = strOrC; // C +} +else { + var r2 = strOrC; // string | C +} +if (typeof numOrC === "Object") { + c = numOrC; // C +} +else { + var r3 = numOrC; // number | C +} +if (typeof boolOrC === "Object") { + c = boolOrC; // C +} +else { + var r4 = boolOrC; // boolean | C +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool === "Object") { + var q1 = strOrNumOrBool; // string | number | boolean +} +else { + var q2 = strOrNumOrBool; // string | number | boolean +} +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrC !== "Object") { + var r2 = strOrC; // string | C +} +else { + c = strOrC; // C +} +if (typeof numOrC !== "Object") { + var r3 = numOrC; // number | C +} +else { + c = numOrC; // C +} +if (typeof boolOrC !== "Object") { + var r4 = boolOrC; // boolean | C +} +else { + c = boolOrC; // C +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool !== "Object") { + var q1 = strOrNumOrBool; // string | number | boolean +} +else { + var q2 = strOrNumOrBool; // string | number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.types b/tests/baselines/reference/typeGuardOfFormTypeOfOther.types new file mode 100644 index 00000000000..04060571f83 --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.types @@ -0,0 +1,183 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts === +class C { private p: string }; +>C : C +>p : string + +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrBool: string | boolean; +>strOrBool : string | boolean + +var numOrBool: number | boolean +>numOrBool : number | boolean + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var strOrC: string | C; +>strOrC : string | C +>C : C + +var numOrC: number | C; +>numOrC : number | C +>C : C + +var boolOrC: boolean | C; +>boolOrC : boolean | C +>C : C + +var emptyObj: {}; +>emptyObj : {} + +var c: C; +>c : C +>C : C + +// A type guard of the form typeof x === s, +// where s is a string literal with any value but 'string', 'number' or 'boolean', +// - when true, removes the primitive types string, number, and boolean from the type of x, or +// - when false, has no effect on the type of x. + +if (typeof strOrC === "Object") { +>typeof strOrC === "Object" : boolean +>typeof strOrC : string +>strOrC : string | C + + c = strOrC; // C +>c = strOrC : C +>c : C +>strOrC : C +} +else { + var r2: string | C = strOrC; // string | C +>r2 : string | C +>C : C +>strOrC : string | C +} +if (typeof numOrC === "Object") { +>typeof numOrC === "Object" : boolean +>typeof numOrC : string +>numOrC : number | C + + c = numOrC; // C +>c = numOrC : C +>c : C +>numOrC : C +} +else { + var r3: number | C = numOrC; // number | C +>r3 : number | C +>C : C +>numOrC : number | C +} +if (typeof boolOrC === "Object") { +>typeof boolOrC === "Object" : boolean +>typeof boolOrC : string +>boolOrC : boolean | C + + c = boolOrC; // C +>c = boolOrC : C +>c : C +>boolOrC : C +} +else { + var r4: boolean | C = boolOrC; // boolean | C +>r4 : boolean | C +>C : C +>boolOrC : boolean | C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool === "Object") { +>typeof strOrNumOrBool === "Object" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + var q1: string | number | boolean = strOrNumOrBool; // string | number | boolean +>q1 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} +else { + var q2: string | number | boolean = strOrNumOrBool; // string | number | boolean +>q2 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrC !== "Object") { +>typeof strOrC !== "Object" : boolean +>typeof strOrC : string +>strOrC : string | C + + var r2: string | C = strOrC; // string | C +>r2 : string | C +>C : C +>strOrC : string | C +} +else { + c = strOrC; // C +>c = strOrC : C +>c : C +>strOrC : C +} +if (typeof numOrC !== "Object") { +>typeof numOrC !== "Object" : boolean +>typeof numOrC : string +>numOrC : number | C + + var r3: number | C = numOrC; // number | C +>r3 : number | C +>C : C +>numOrC : number | C +} +else { + c = numOrC; // C +>c = numOrC : C +>c : C +>numOrC : C +} +if (typeof boolOrC !== "Object") { +>typeof boolOrC !== "Object" : boolean +>typeof boolOrC : string +>boolOrC : boolean | C + + var r4: boolean | C = boolOrC; // boolean | C +>r4 : boolean | C +>C : C +>boolOrC : boolean | C +} +else { + c = boolOrC; // C +>c = boolOrC : C +>c : C +>boolOrC : C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool !== "Object") { +>typeof strOrNumOrBool !== "Object" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + var q1: string | number | boolean = strOrNumOrBool; // string | number | boolean +>q1 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} +else { + var q2: string | number | boolean = strOrNumOrBool; // string | number | boolean +>q2 : string | number | boolean +>strOrNumOrBool : string | number | boolean +} + diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfString.js b/tests/baselines/reference/typeGuardOfFormTypeOfString.js new file mode 100644 index 00000000000..4f6652c440a --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfString.js @@ -0,0 +1,176 @@ +//// [typeGuardOfFormTypeOfString.ts] +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "string") { + str = strOrNum; // string +} +else { + num === strOrNum; // number +} +if (typeof strOrBool === "string") { + str = strOrBool; // string +} +else { + bool = strOrBool; // boolean +} +if (typeof strOrNumOrBool === "string") { + str = strOrNumOrBool; // string +} +else { + numOrBool = strOrNumOrBool; // number | boolean +} +if (typeof strOrC === "string") { + str = strOrC; // string +} +else { + c = strOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool === "string") { + var x1: number | boolean = numOrBool; // number | boolean +} +else { + var x2: number | boolean = numOrBool; // number | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "string") { + num === strOrNum; // number +} +else { + str = strOrNum; // string +} +if (typeof strOrBool !== "string") { + bool = strOrBool; // boolean +} +else { + str = strOrBool; // string +} +if (typeof strOrNumOrBool !== "string") { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + str = strOrNumOrBool; // string +} +if (typeof strOrC !== "string") { + c = strOrC; // C +} +else { + str = strOrC; // string +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool !== "string") { + var x1: number | boolean = numOrBool; // number | boolean +} +else { + var x2: number | boolean = numOrBool; // number | boolean +} + + +//// [typeGuardOfFormTypeOfString.js] +var C = (function () { + function C() { + } + return C; +})(); +; +var str; +var bool; +var num; +var strOrNum; +var strOrBool; +var numOrBool; +var strOrNumOrBool; +var strOrC; +var numOrC; +var boolOrC; +var c; +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "string") { + str = strOrNum; // string +} +else { + num === strOrNum; // number +} +if (typeof strOrBool === "string") { + str = strOrBool; // string +} +else { + bool = strOrBool; // boolean +} +if (typeof strOrNumOrBool === "string") { + str = strOrNumOrBool; // string +} +else { + numOrBool = strOrNumOrBool; // number | boolean +} +if (typeof strOrC === "string") { + str = strOrC; // string +} +else { + c = strOrC; // C +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool === "string") { + var x1 = numOrBool; // number | boolean +} +else { + var x2 = numOrBool; // number | boolean +} +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "string") { + num === strOrNum; // number +} +else { + str = strOrNum; // string +} +if (typeof strOrBool !== "string") { + bool = strOrBool; // boolean +} +else { + str = strOrBool; // string +} +if (typeof strOrNumOrBool !== "string") { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + str = strOrNumOrBool; // string +} +if (typeof strOrC !== "string") { + c = strOrC; // C +} +else { + str = strOrC; // string +} +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool !== "string") { + var x1 = numOrBool; // number | boolean +} +else { + var x2 = numOrBool; // number | boolean +} diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfString.types b/tests/baselines/reference/typeGuardOfFormTypeOfString.types new file mode 100644 index 00000000000..90719fce92b --- /dev/null +++ b/tests/baselines/reference/typeGuardOfFormTypeOfString.types @@ -0,0 +1,211 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfString.ts === +class C { private p: string }; +>C : C +>p : string + +var str: string; +>str : string + +var bool: boolean; +>bool : boolean + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var strOrBool: string | boolean; +>strOrBool : string | boolean + +var numOrBool: number | boolean +>numOrBool : number | boolean + +var strOrNumOrBool: string | number | boolean; +>strOrNumOrBool : string | number | boolean + +var strOrC: string | C; +>strOrC : string | C +>C : C + +var numOrC: number | C; +>numOrC : number | C +>C : C + +var boolOrC: boolean | C; +>boolOrC : boolean | C +>C : C + +var c: C; +>c : C +>C : C + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "string") { +>typeof strOrNum === "string" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + str = strOrNum; // string +>str = strOrNum : string +>str : string +>strOrNum : string +} +else { + num === strOrNum; // number +>num === strOrNum : boolean +>num : number +>strOrNum : number +} +if (typeof strOrBool === "string") { +>typeof strOrBool === "string" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + str = strOrBool; // string +>str = strOrBool : string +>str : string +>strOrBool : string +} +else { + bool = strOrBool; // boolean +>bool = strOrBool : boolean +>bool : boolean +>strOrBool : boolean +} +if (typeof strOrNumOrBool === "string") { +>typeof strOrNumOrBool === "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + str = strOrNumOrBool; // string +>str = strOrNumOrBool : string +>str : string +>strOrNumOrBool : string +} +else { + numOrBool = strOrNumOrBool; // number | boolean +>numOrBool = strOrNumOrBool : number | boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean +} +if (typeof strOrC === "string") { +>typeof strOrC === "string" : boolean +>typeof strOrC : string +>strOrC : string | C + + str = strOrC; // string +>str = strOrC : string +>str : string +>strOrC : string +} +else { + c = strOrC; // C +>c = strOrC : C +>c : C +>strOrC : C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool === "string") { +>typeof numOrBool === "string" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + var x1: number | boolean = numOrBool; // number | boolean +>x1 : number | boolean +>numOrBool : number | boolean +} +else { + var x2: number | boolean = numOrBool; // number | boolean +>x2 : number | boolean +>numOrBool : number | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "string") { +>typeof strOrNum !== "string" : boolean +>typeof strOrNum : string +>strOrNum : string | number + + num === strOrNum; // number +>num === strOrNum : boolean +>num : number +>strOrNum : number +} +else { + str = strOrNum; // string +>str = strOrNum : string +>str : string +>strOrNum : string +} +if (typeof strOrBool !== "string") { +>typeof strOrBool !== "string" : boolean +>typeof strOrBool : string +>strOrBool : string | boolean + + bool = strOrBool; // boolean +>bool = strOrBool : boolean +>bool : boolean +>strOrBool : boolean +} +else { + str = strOrBool; // string +>str = strOrBool : string +>str : string +>strOrBool : string +} +if (typeof strOrNumOrBool !== "string") { +>typeof strOrNumOrBool !== "string" : boolean +>typeof strOrNumOrBool : string +>strOrNumOrBool : string | number | boolean + + numOrBool = strOrNumOrBool; // number | boolean +>numOrBool = strOrNumOrBool : number | boolean +>numOrBool : number | boolean +>strOrNumOrBool : number | boolean +} +else { + str = strOrNumOrBool; // string +>str = strOrNumOrBool : string +>str : string +>strOrNumOrBool : string +} +if (typeof strOrC !== "string") { +>typeof strOrC !== "string" : boolean +>typeof strOrC : string +>strOrC : string | C + + c = strOrC; // C +>c = strOrC : C +>c : C +>strOrC : C +} +else { + str = strOrC; // string +>str = strOrC : string +>str : string +>strOrC : string +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool !== "string") { +>typeof numOrBool !== "string" : boolean +>typeof numOrBool : string +>numOrBool : number | boolean + + var x1: number | boolean = numOrBool; // number | boolean +>x1 : number | boolean +>numOrBool : number | boolean +} +else { + var x2: number | boolean = numOrBool; // number | boolean +>x2 : number | boolean +>numOrBool : number | boolean +} + diff --git a/tests/baselines/reference/typeGuardsDefeat.js b/tests/baselines/reference/typeGuardsDefeat.js new file mode 100644 index 00000000000..9670c260b57 --- /dev/null +++ b/tests/baselines/reference/typeGuardsDefeat.js @@ -0,0 +1,76 @@ +//// [typeGuardsDefeat.ts] +// Also note that it is possible to defeat a type guard by calling a function that changes the +// type of the guarded variable. +function foo(x: number | string) { + function f() { + x = 10; + } + if (typeof x === "string") { + f(); + return x.length; // string + } + else { + return x++; // number + } +} +function foo2(x: number | string) { + if (typeof x === "string") { + return x.length; // string + } + else { + var f = function () { + return x * x; + }; + } + x = "hello"; + f(); +} +function foo3(x: number | string) { + if (typeof x === "string") { + return x.length; // string + } + else { + var f = () => x * x; + } + x = "hello"; + f(); +} + + +//// [typeGuardsDefeat.js] +// Also note that it is possible to defeat a type guard by calling a function that changes the +// type of the guarded variable. +function foo(x) { + function f() { + x = 10; + } + if (typeof x === "string") { + f(); + return x.length; // string + } + else { + return x++; // number + } +} +function foo2(x) { + if (typeof x === "string") { + return x.length; // string + } + else { + var f = function () { + return x * x; + }; + } + x = "hello"; + f(); +} +function foo3(x) { + if (typeof x === "string") { + return x.length; // string + } + else { + var f = function () { return x * x; }; + } + x = "hello"; + f(); +} diff --git a/tests/baselines/reference/typeGuardsDefeat.types b/tests/baselines/reference/typeGuardsDefeat.types new file mode 100644 index 00000000000..5daaa75d979 --- /dev/null +++ b/tests/baselines/reference/typeGuardsDefeat.types @@ -0,0 +1,99 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsDefeat.ts === +// Also note that it is possible to defeat a type guard by calling a function that changes the +// type of the guarded variable. +function foo(x: number | string) { +>foo : (x: string | number) => number +>x : string | number + + function f() { +>f : () => void + + x = 10; +>x = 10 : number +>x : string | number + } + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + f(); +>f() : void +>f : () => void + + return x.length; // string +>x.length : number +>x : string +>length : number + } + else { + return x++; // number +>x++ : number +>x : number + } +} +function foo2(x: number | string) { +>foo2 : (x: string | number) => number +>x : string | number + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + return x.length; // string +>x.length : number +>x : string +>length : number + } + else { + var f = function () { +>f : () => number +>function () { return x * x; } : () => number + + return x * x; +>x * x : number +>x : number +>x : number + + }; + } + x = "hello"; +>x = "hello" : string +>x : string | number + + f(); +>f() : number +>f : () => number +} +function foo3(x: number | string) { +>foo3 : (x: string | number) => number +>x : string | number + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + return x.length; // string +>x.length : number +>x : string +>length : number + } + else { + var f = () => x * x; +>f : () => number +>() => x * x : () => number +>x * x : number +>x : number +>x : number + } + x = "hello"; +>x = "hello" : string +>x : string | number + + f(); +>f() : number +>f : () => number +} + diff --git a/tests/baselines/reference/typeGuardsInClassAccessors.js b/tests/baselines/reference/typeGuardsInClassAccessors.js new file mode 100644 index 00000000000..8f487b72535 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInClassAccessors.js @@ -0,0 +1,209 @@ +//// [typeGuardsInClassAccessors.ts] + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var strOrNum: string | number; +var var1: string | number; +class ClassWithAccessors { + // Inside public accessor getter + get p1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside public accessor setter + set p1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } + // Inside private accessor getter + private get pp1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside private accessor setter + private set pp1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } + // Inside static accessor getter + static get s1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside static accessor setter + static set s1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } + // Inside private static accessor getter + private static get ss1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside private static accessor setter + private static set ss1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } +} + + +//// [typeGuardsInClassAccessors.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// variables in global +var num; +var strOrNum; +var var1; +var ClassWithAccessors = (function () { + function ClassWithAccessors() { + } + Object.defineProperty(ClassWithAccessors.prototype, "p1", { + // Inside public accessor getter + get: function () { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + return strOrNum; + }, + // Inside public accessor setter + set: function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // parameter of function declaration + num = typeof param === "string" && param.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClassWithAccessors.prototype, "pp1", { + // Inside private accessor getter + get: function () { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + return strOrNum; + }, + // Inside private accessor setter + set: function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // parameter of function declaration + num = typeof param === "string" && param.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClassWithAccessors, "s1", { + // Inside static accessor getter + get: function () { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + return strOrNum; + }, + // Inside static accessor setter + set: function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // parameter of function declaration + num = typeof param === "string" && param.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ClassWithAccessors, "ss1", { + // Inside private static accessor getter + get: function () { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + return strOrNum; + }, + // Inside private static accessor setter + set: function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // parameter of function declaration + num = typeof param === "string" && param.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + }, + enumerable: true, + configurable: true + }); + return ClassWithAccessors; +})(); diff --git a/tests/baselines/reference/typeGuardsInClassAccessors.types b/tests/baselines/reference/typeGuardsInClassAccessors.types new file mode 100644 index 00000000000..48ea732f3d7 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInClassAccessors.types @@ -0,0 +1,332 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInClassAccessors.ts === + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var var1: string | number; +>var1 : string | number + +class ClassWithAccessors { +>ClassWithAccessors : ClassWithAccessors + + // Inside public accessor getter + get p1() { +>p1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + return strOrNum; +>strOrNum : string | number + } + // Inside public accessor setter + set p1(param: string | number) { +>p1 : string | number +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // parameter of function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + } + // Inside private accessor getter + private get pp1() { +>pp1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + return strOrNum; +>strOrNum : string | number + } + // Inside private accessor setter + private set pp1(param: string | number) { +>pp1 : string | number +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // parameter of function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + } + // Inside static accessor getter + static get s1() { +>s1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + return strOrNum; +>strOrNum : string | number + } + // Inside static accessor setter + static set s1(param: string | number) { +>s1 : string | number +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // parameter of function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + } + // Inside private static accessor getter + private static get ss1() { +>ss1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + return strOrNum; +>strOrNum : string | number + } + // Inside private static accessor setter + private static set ss1(param: string | number) { +>ss1 : string | number +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // parameter of function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + } +} + diff --git a/tests/baselines/reference/typeGuardsInClassMethods.js b/tests/baselines/reference/typeGuardsInClassMethods.js new file mode 100644 index 00000000000..cbe6dfe161a --- /dev/null +++ b/tests/baselines/reference/typeGuardsInClassMethods.js @@ -0,0 +1,128 @@ +//// [typeGuardsInClassMethods.ts] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var var1: string | number; +class C1 { + constructor(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + private p1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + p2(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + private static s1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + static s2(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } +} + + +//// [typeGuardsInClassMethods.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// variables in global +var num; +var var1; +var C1 = (function () { + function C1(param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + C1.prototype.p1 = function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + }; + // Inside function declaration + C1.prototype.p2 = function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + }; + // Inside function declaration + C1.s1 = function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + }; + // Inside function declaration + C1.s2 = function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + }; + return C1; +})(); diff --git a/tests/baselines/reference/typeGuardsInClassMethods.types b/tests/baselines/reference/typeGuardsInClassMethods.types new file mode 100644 index 00000000000..fa44347cd5c --- /dev/null +++ b/tests/baselines/reference/typeGuardsInClassMethods.types @@ -0,0 +1,234 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInClassMethods.ts === +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +>num : number + +var var1: string | number; +>var1 : string | number + +class C1 { +>C1 : C1 + + constructor(param: string | number) { +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + } + // Inside function declaration + private p1(param: string | number) { +>p1 : (param: string | number) => void +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + } + // Inside function declaration + p2(param: string | number) { +>p2 : (param: string | number) => void +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + } + // Inside function declaration + private static s1(param: string | number) { +>s1 : (param: string | number) => void +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + } + // Inside function declaration + static s2(param: string | number) { +>s2 : (param: string | number) => void +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + } +} + diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.js b/tests/baselines/reference/typeGuardsInConditionalExpression.js new file mode 100644 index 00000000000..303a27dc938 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.js @@ -0,0 +1,160 @@ +//// [typeGuardsInConditionalExpression.ts] +// In the true expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when true, +// provided the true expression contains no assignments to the variable or parameter. +// In the false expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when false, +// provided the false expression contains no assignments to the variable or parameter. + +function foo(x: number | string) { + return typeof x === "string" + ? x.length // string + : x++; // number +} +function foo2(x: number | string) { + // x is assigned in the if true branch, the type is not narrowed + return typeof x === "string" + ? (x = 10 && x)// string | number + : x; // string | number +} +function foo3(x: number | string) { + // x is assigned in the if false branch, the type is not narrowed + // even though assigned using same type as narrowed expression + return typeof x === "string" + ? (x = "Hello" && x) // string | number + : x; // string | number +} +function foo4(x: number | string) { + // false branch updates the variable - so here it is not number + // even though assigned using same type as narrowed expression + return typeof x === "string" + ? x // string | number + : (x = 10 && x); // string | number +} +function foo5(x: number | string) { + // false branch updates the variable - so here it is not number + return typeof x === "string" + ? x // string | number + : (x = "hello" && x); // string | number +} +function foo6(x: number | string) { + // Modify in both branches + return typeof x === "string" + ? (x = 10 && x) // string | number + : (x = "hello" && x); // string | number +} +function foo7(x: number | string | boolean) { + return typeof x === "string" + ? x === "hello" // string + : typeof x === "boolean" + ? x // boolean + : x == 10; // number +} +function foo8(x: number | string | boolean) { + var b: number | boolean; + return typeof x === "string" + ? x === "hello" + : ((b = x) && // number | boolean + (typeof x === "boolean" + ? x // boolean + : x == 10)); // number +} +function foo9(x: number | string) { + var y = 10; + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + return typeof x === "string" + ? ((y = x.length) && x === "hello") // string + : x === 10; // number +} +function foo10(x: number | string | boolean) { + // Mixing typeguards + var b: boolean | number; + return typeof x === "string" + ? x // string + : ((b = x) // x is number | boolean + && typeof x === "number" + && x.toString()); // x is number +} +function foo11(x: number | string | boolean) { + // Mixing typeguards + // Assigning value to x deep inside another guard stops narrowing of type too + var b: number | boolean | string; + return typeof x === "string" + ? x // number | boolean | string - changed in the false branch + : ((b = x) // x is number | boolean | string - because the assignment changed it + && typeof x === "number" + && (x = 10) // assignment to x + && x); // x is number | boolean | string +} +function foo12(x: number | string | boolean) { + // Mixing typeguards + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + var b: number | boolean | string; + return typeof x === "string" + ? (x = 10 && x.toString().length) // number | boolean | string - changed here + : ((b = x) // x is number | boolean | string - changed in true branch + && typeof x === "number" + && x); // x is number +} + +//// [typeGuardsInConditionalExpression.js] +// In the true expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when true, +// provided the true expression contains no assignments to the variable or parameter. +// In the false expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when false, +// provided the false expression contains no assignments to the variable or parameter. +function foo(x) { + return typeof x === "string" ? x.length : x++; // number +} +function foo2(x) { + // x is assigned in the if true branch, the type is not narrowed + return typeof x === "string" ? (x = 10 && x) : x; // string | number +} +function foo3(x) { + // x is assigned in the if false branch, the type is not narrowed + // even though assigned using same type as narrowed expression + return typeof x === "string" ? (x = "Hello" && x) : x; // string | number +} +function foo4(x) { + // false branch updates the variable - so here it is not number + // even though assigned using same type as narrowed expression + return typeof x === "string" ? x : (x = 10 && x); // string | number +} +function foo5(x) { + // false branch updates the variable - so here it is not number + return typeof x === "string" ? x : (x = "hello" && x); // string | number +} +function foo6(x) { + // Modify in both branches + return typeof x === "string" ? (x = 10 && x) : (x = "hello" && x); // string | number +} +function foo7(x) { + return typeof x === "string" ? x === "hello" : typeof x === "boolean" ? x : x == 10; // number +} +function foo8(x) { + var b; + return typeof x === "string" ? x === "hello" : ((b = x) && (typeof x === "boolean" ? x : x == 10)); // number +} +function foo9(x) { + var y = 10; + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + return typeof x === "string" ? ((y = x.length) && x === "hello") : x === 10; // number +} +function foo10(x) { + // Mixing typeguards + var b; + return typeof x === "string" ? x : ((b = x) && typeof x === "number" && x.toString()); // x is number +} +function foo11(x) { + // Mixing typeguards + // Assigning value to x deep inside another guard stops narrowing of type too + var b; + return typeof x === "string" ? x : ((b = x) && typeof x === "number" && (x = 10) && x); // x is number | boolean | string +} +function foo12(x) { + // Mixing typeguards + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + var b; + return typeof x === "string" ? (x = 10 && x.toString().length) : ((b = x) && typeof x === "number" && x); // x is number +} diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.types b/tests/baselines/reference/typeGuardsInConditionalExpression.types new file mode 100644 index 00000000000..14b35480cd8 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.types @@ -0,0 +1,356 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInConditionalExpression.ts === +// In the true expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when true, +// provided the true expression contains no assignments to the variable or parameter. +// In the false expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when false, +// provided the false expression contains no assignments to the variable or parameter. + +function foo(x: number | string) { +>foo : (x: string | number) => number +>x : string | number + + return typeof x === "string" +>typeof x === "string" ? x.length // string : x++ : number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? x.length // string +>x.length : number +>x : string +>length : number + + : x++; // number +>x++ : number +>x : number +} +function foo2(x: number | string) { +>foo2 : (x: string | number) => string | number +>x : string | number + + // x is assigned in the if true branch, the type is not narrowed + return typeof x === "string" +>typeof x === "string" ? (x = 10 && x)// string | number : x : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? (x = 10 && x)// string | number +>(x = 10 && x) : string | number +>x = 10 && x : string | number +>x : string | number +>10 && x : string | number +>x : string | number + + : x; // string | number +>x : string | number +} +function foo3(x: number | string) { +>foo3 : (x: string | number) => string | number +>x : string | number + + // x is assigned in the if false branch, the type is not narrowed + // even though assigned using same type as narrowed expression + return typeof x === "string" +>typeof x === "string" ? (x = "Hello" && x) // string | number : x : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? (x = "Hello" && x) // string | number +>(x = "Hello" && x) : string | number +>x = "Hello" && x : string | number +>x : string | number +>"Hello" && x : string | number +>x : string | number + + : x; // string | number +>x : string | number +} +function foo4(x: number | string) { +>foo4 : (x: string | number) => string | number +>x : string | number + + // false branch updates the variable - so here it is not number + // even though assigned using same type as narrowed expression + return typeof x === "string" +>typeof x === "string" ? x // string | number : (x = 10 && x) : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? x // string | number +>x : string | number + + : (x = 10 && x); // string | number +>(x = 10 && x) : string | number +>x = 10 && x : string | number +>x : string | number +>10 && x : string | number +>x : string | number +} +function foo5(x: number | string) { +>foo5 : (x: string | number) => string | number +>x : string | number + + // false branch updates the variable - so here it is not number + return typeof x === "string" +>typeof x === "string" ? x // string | number : (x = "hello" && x) : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? x // string | number +>x : string | number + + : (x = "hello" && x); // string | number +>(x = "hello" && x) : string | number +>x = "hello" && x : string | number +>x : string | number +>"hello" && x : string | number +>x : string | number +} +function foo6(x: number | string) { +>foo6 : (x: string | number) => string | number +>x : string | number + + // Modify in both branches + return typeof x === "string" +>typeof x === "string" ? (x = 10 && x) // string | number : (x = "hello" && x) : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? (x = 10 && x) // string | number +>(x = 10 && x) : string | number +>x = 10 && x : string | number +>x : string | number +>10 && x : string | number +>x : string | number + + : (x = "hello" && x); // string | number +>(x = "hello" && x) : string | number +>x = "hello" && x : string | number +>x : string | number +>"hello" && x : string | number +>x : string | number +} +function foo7(x: number | string | boolean) { +>foo7 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? x === "hello" // string : typeof x === "boolean" ? x // boolean : x == 10 : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x === "hello" // string +>x === "hello" : boolean +>x : string + + : typeof x === "boolean" +>typeof x === "boolean" ? x // boolean : x == 10 : boolean +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x // boolean +>x : boolean + + : x == 10; // number +>x == 10 : boolean +>x : number +} +function foo8(x: number | string | boolean) { +>foo8 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + var b: number | boolean; +>b : number | boolean + + return typeof x === "string" +>typeof x === "string" ? x === "hello" : ((b = x) && // number | boolean (typeof x === "boolean" ? x // boolean : x == 10)) : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x === "hello" +>x === "hello" : boolean +>x : string + + : ((b = x) && // number | boolean +>((b = x) && // number | boolean (typeof x === "boolean" ? x // boolean : x == 10)) : boolean +>(b = x) && // number | boolean (typeof x === "boolean" ? x // boolean : x == 10) : boolean +>(b = x) : number | boolean +>b = x : number | boolean +>b : number | boolean +>x : number | boolean + + (typeof x === "boolean" +>(typeof x === "boolean" ? x // boolean : x == 10) : boolean +>typeof x === "boolean" ? x // boolean : x == 10 : boolean +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x // boolean +>x : boolean + + : x == 10)); // number +>x == 10 : boolean +>x : number +} +function foo9(x: number | string) { +>foo9 : (x: string | number) => boolean +>x : string | number + + var y = 10; +>y : number + + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + return typeof x === "string" +>typeof x === "string" ? ((y = x.length) && x === "hello") // string : x === 10 : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + ? ((y = x.length) && x === "hello") // string +>((y = x.length) && x === "hello") : boolean +>(y = x.length) && x === "hello" : boolean +>(y = x.length) : number +>y = x.length : number +>y : number +>x.length : number +>x : string +>length : number +>x === "hello" : boolean +>x : string + + : x === 10; // number +>x === 10 : boolean +>x : number +} +function foo10(x: number | string | boolean) { +>foo10 : (x: string | number | boolean) => string +>x : string | number | boolean + + // Mixing typeguards + var b: boolean | number; +>b : number | boolean + + return typeof x === "string" +>typeof x === "string" ? x // string : ((b = x) // x is number | boolean && typeof x === "number" && x.toString()) : string +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x // string +>x : string + + : ((b = x) // x is number | boolean +>((b = x) // x is number | boolean && typeof x === "number" && x.toString()) : string +>(b = x) // x is number | boolean && typeof x === "number" && x.toString() : string +>(b = x) // x is number | boolean && typeof x === "number" : boolean +>(b = x) : number | boolean +>b = x : number | boolean +>b : number | boolean +>x : number | boolean + + && typeof x === "number" +>typeof x === "number" : boolean +>typeof x : string +>x : number | boolean + + && x.toString()); // x is number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string +} +function foo11(x: number | string | boolean) { +>foo11 : (x: string | number | boolean) => string | number | boolean +>x : string | number | boolean + + // Mixing typeguards + // Assigning value to x deep inside another guard stops narrowing of type too + var b: number | boolean | string; +>b : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? x // number | boolean | string - changed in the false branch : ((b = x) // x is number | boolean | string - because the assignment changed it && typeof x === "number" && (x = 10) // assignment to x && x) : string | number | boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x // number | boolean | string - changed in the false branch +>x : string | number | boolean + + : ((b = x) // x is number | boolean | string - because the assignment changed it +>((b = x) // x is number | boolean | string - because the assignment changed it && typeof x === "number" && (x = 10) // assignment to x && x) : string | number | boolean +>(b = x) // x is number | boolean | string - because the assignment changed it && typeof x === "number" && (x = 10) // assignment to x && x : string | number | boolean +>(b = x) // x is number | boolean | string - because the assignment changed it && typeof x === "number" && (x = 10) : number +>(b = x) // x is number | boolean | string - because the assignment changed it && typeof x === "number" : boolean +>(b = x) : string | number | boolean +>b = x : string | number | boolean +>b : string | number | boolean +>x : string | number | boolean + + && typeof x === "number" +>typeof x === "number" : boolean +>typeof x : string +>x : string | number | boolean + + && (x = 10) // assignment to x +>(x = 10) : number +>x = 10 : number +>x : string | number | boolean + + && x); // x is number | boolean | string +>x : string | number | boolean +} +function foo12(x: number | string | boolean) { +>foo12 : (x: string | number | boolean) => number +>x : string | number | boolean + + // Mixing typeguards + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + var b: number | boolean | string; +>b : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? (x = 10 && x.toString().length) // number | boolean | string - changed here : ((b = x) // x is number | boolean | string - changed in true branch && typeof x === "number" && x) : number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? (x = 10 && x.toString().length) // number | boolean | string - changed here +>(x = 10 && x.toString().length) : number +>x = 10 && x.toString().length : number +>x : string | number | boolean +>10 && x.toString().length : number +>x.toString().length : number +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string +>length : number + + : ((b = x) // x is number | boolean | string - changed in true branch +>((b = x) // x is number | boolean | string - changed in true branch && typeof x === "number" && x) : number +>(b = x) // x is number | boolean | string - changed in true branch && typeof x === "number" && x : number +>(b = x) // x is number | boolean | string - changed in true branch && typeof x === "number" : boolean +>(b = x) : string | number | boolean +>b = x : string | number | boolean +>b : string | number | boolean +>x : string | number | boolean + + && typeof x === "number" +>typeof x === "number" : boolean +>typeof x : string +>x : string | number | boolean + + && x); // x is number +>x : number +} diff --git a/tests/baselines/reference/typeGuardsInExternalModule.js b/tests/baselines/reference/typeGuardsInExternalModule.js new file mode 100644 index 00000000000..29950ece95a --- /dev/null +++ b/tests/baselines/reference/typeGuardsInExternalModule.js @@ -0,0 +1,47 @@ +//// [typeGuardsInExternalModule.ts] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// local variable in external module +var num: number; +var var1: string | number; +if (typeof var1 === "string") { + num = var1.length; // string +} +else { + num = var1; // number +} + +// exported variable in external module +var strOrNum: string | number; +export var var2: string | number; +if (typeof var2 === "string") { + // export makes the var property and not variable + strOrNum = var2; // string | number +} +else { + strOrNum = var2; // number | string +} + +//// [typeGuardsInExternalModule.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// local variable in external module +var num; +var var1; +if (typeof var1 === "string") { + num = var1.length; // string +} +else { + num = var1; // number +} +// exported variable in external module +var strOrNum; +exports.var2; +if (typeof exports.var2 === "string") { + // export makes the var property and not variable + strOrNum = exports.var2; // string | number +} +else { + strOrNum = exports.var2; // number | string +} diff --git a/tests/baselines/reference/typeGuardsInExternalModule.types b/tests/baselines/reference/typeGuardsInExternalModule.types new file mode 100644 index 00000000000..09038ef1c1a --- /dev/null +++ b/tests/baselines/reference/typeGuardsInExternalModule.types @@ -0,0 +1,54 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInExternalModule.ts === +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// local variable in external module +var num: number; +>num : number + +var var1: string | number; +>var1 : string | number + +if (typeof var1 === "string") { +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number + + num = var1.length; // string +>num = var1.length : number +>num : number +>var1.length : number +>var1 : string +>length : number +} +else { + num = var1; // number +>num = var1 : number +>num : number +>var1 : number +} + +// exported variable in external module +var strOrNum: string | number; +>strOrNum : string | number + +export var var2: string | number; +>var2 : string | number + +if (typeof var2 === "string") { +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number + + // export makes the var property and not variable + strOrNum = var2; // string | number +>strOrNum = var2 : string | number +>strOrNum : string | number +>var2 : string | number +} +else { + strOrNum = var2; // number | string +>strOrNum = var2 : string | number +>strOrNum : string | number +>var2 : string | number +} diff --git a/tests/baselines/reference/typeGuardsInFunction.js b/tests/baselines/reference/typeGuardsInFunction.js new file mode 100644 index 00000000000..53bfb5fa6bb --- /dev/null +++ b/tests/baselines/reference/typeGuardsInFunction.js @@ -0,0 +1,165 @@ +//// [typeGuardsInFunction.ts] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var var1: string | number; +// Inside function declaration +function f(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +} +// local function declaration +function f1(param: string | number) { + var var2: string | number; + function f2(param1: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + + // local + var var3: string | number; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + } +} +// Function expression +function f2(param: string | number) { + // variables in function declaration + var var2: string | number; + // variables in function expressions + var r = function (param1: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + + // local + var var3: string | number; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + } (param); +} +// Arrow expression +function f3(param: string | number) { + // variables in function declaration + var var2: string | number; + // variables in function expressions + var r = ((param1: string | number) => { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + + // local + var var3: string | number; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + })(param); +} +// Return type of function +// Inside function declaration +var strOrNum: string | number; +function f4() { + var var2: string | number = strOrNum; + return var2; +} +strOrNum = typeof f4() === "string" && f4(); // string | number + +//// [typeGuardsInFunction.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// variables in global +var num; +var var1; +// Inside function declaration +function f(param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string +} +// local function declaration +function f1(param) { + var var2; + function f2(param1) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + // local + var var3; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + } +} +// Function expression +function f2(param) { + // variables in function declaration + var var2; + // variables in function expressions + var r = function (param1) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + // local + var var3; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + }(param); +} +// Arrow expression +function f3(param) { + // variables in function declaration + var var2; + // variables in function expressions + var r = (function (param1) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + // local + var var3; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + })(param); +} +// Return type of function +// Inside function declaration +var strOrNum; +function f4() { + var var2 = strOrNum; + return var2; +} +strOrNum = typeof f4() === "string" && f4(); // string | number diff --git a/tests/baselines/reference/typeGuardsInFunction.types b/tests/baselines/reference/typeGuardsInFunction.types new file mode 100644 index 00000000000..a7b25f486aa --- /dev/null +++ b/tests/baselines/reference/typeGuardsInFunction.types @@ -0,0 +1,319 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInFunction.ts === +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +>num : number + +var var1: string | number; +>var1 : string | number + +// Inside function declaration +function f(param: string | number) { +>f : (param: string | number) => void +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number +} +// local function declaration +function f1(param: string | number) { +>f1 : (param: string | number) => void +>param : string | number + + var var2: string | number; +>var2 : string | number + + function f2(param1: string | number) { +>f2 : (param1: string | number) => void +>param1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // local + var var3: string | number; +>var3 : string | number + + num = typeof var3 === "string" && var3.length; // string +>num = typeof var3 === "string" && var3.length : number +>num : number +>typeof var3 === "string" && var3.length : number +>typeof var3 === "string" : boolean +>typeof var3 : string +>var3 : string | number +>var3.length : number +>var3 : string +>length : number + + num = typeof param1 === "string" && param1.length; // string +>num = typeof param1 === "string" && param1.length : number +>num : number +>typeof param1 === "string" && param1.length : number +>typeof param1 === "string" : boolean +>typeof param1 : string +>param1 : string | number +>param1.length : number +>param1 : string +>length : number + } +} +// Function expression +function f2(param: string | number) { +>f2 : (param: string | number) => void +>param : string | number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + // variables in function expressions + var r = function (param1: string | number) { +>r : void +>function (param1: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables from outer function declaration num = typeof var2 === "string" && var2.length; // string // parameters in outer declaration num = typeof param === "string" && param.length; // string // local var var3: string | number; num = typeof var3 === "string" && var3.length; // string num = typeof param1 === "string" && param1.length; // string } (param) : void +>function (param1: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables from outer function declaration num = typeof var2 === "string" && var2.length; // string // parameters in outer declaration num = typeof param === "string" && param.length; // string // local var var3: string | number; num = typeof var3 === "string" && var3.length; // string num = typeof param1 === "string" && param1.length; // string } : (param1: string | number) => void +>param1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // local + var var3: string | number; +>var3 : string | number + + num = typeof var3 === "string" && var3.length; // string +>num = typeof var3 === "string" && var3.length : number +>num : number +>typeof var3 === "string" && var3.length : number +>typeof var3 === "string" : boolean +>typeof var3 : string +>var3 : string | number +>var3.length : number +>var3 : string +>length : number + + num = typeof param1 === "string" && param1.length; // string +>num = typeof param1 === "string" && param1.length : number +>num : number +>typeof param1 === "string" && param1.length : number +>typeof param1 === "string" : boolean +>typeof param1 : string +>param1 : string | number +>param1.length : number +>param1 : string +>length : number + + } (param); +>param : string | number +} +// Arrow expression +function f3(param: string | number) { +>f3 : (param: string | number) => void +>param : string | number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + // variables in function expressions + var r = ((param1: string | number) => { +>r : void +>((param1: string | number) => { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables from outer function declaration num = typeof var2 === "string" && var2.length; // string // parameters in outer declaration num = typeof param === "string" && param.length; // string // local var var3: string | number; num = typeof var3 === "string" && var3.length; // string num = typeof param1 === "string" && param1.length; // string })(param) : void +>((param1: string | number) => { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables from outer function declaration num = typeof var2 === "string" && var2.length; // string // parameters in outer declaration num = typeof param === "string" && param.length; // string // local var var3: string | number; num = typeof var3 === "string" && var3.length; // string num = typeof param1 === "string" && param1.length; // string }) : (param1: string | number) => void +>(param1: string | number) => { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables from outer function declaration num = typeof var2 === "string" && var2.length; // string // parameters in outer declaration num = typeof param === "string" && param.length; // string // local var var3: string | number; num = typeof var3 === "string" && var3.length; // string num = typeof param1 === "string" && param1.length; // string } : (param1: string | number) => void +>param1 : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + // local + var var3: string | number; +>var3 : string | number + + num = typeof var3 === "string" && var3.length; // string +>num = typeof var3 === "string" && var3.length : number +>num : number +>typeof var3 === "string" && var3.length : number +>typeof var3 === "string" : boolean +>typeof var3 : string +>var3 : string | number +>var3.length : number +>var3 : string +>length : number + + num = typeof param1 === "string" && param1.length; // string +>num = typeof param1 === "string" && param1.length : number +>num : number +>typeof param1 === "string" && param1.length : number +>typeof param1 === "string" : boolean +>typeof param1 : string +>param1 : string | number +>param1.length : number +>param1 : string +>length : number + + })(param); +>param : string | number +} +// Return type of function +// Inside function declaration +var strOrNum: string | number; +>strOrNum : string | number + +function f4() { +>f4 : () => string | number + + var var2: string | number = strOrNum; +>var2 : string | number +>strOrNum : string | number + + return var2; +>var2 : string | number +} +strOrNum = typeof f4() === "string" && f4(); // string | number +>strOrNum = typeof f4() === "string" && f4() : string | number +>strOrNum : string | number +>typeof f4() === "string" && f4() : string | number +>typeof f4() === "string" : boolean +>typeof f4() : string +>f4() : string | number +>f4 : () => string | number +>f4() : string | number +>f4 : () => string | number + diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js new file mode 100644 index 00000000000..317017c9acc --- /dev/null +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.js @@ -0,0 +1,149 @@ +//// [typeGuardsInFunctionAndModuleBlock.ts] +// typeguards are scoped in function/module block + +function foo(x: number | string | boolean) { + return typeof x === "string" + ? x + : function f() { + var b = x; // number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } (); +} +function foo2(x: number | string | boolean) { + return typeof x === "string" + ? x + : function f(a: number | boolean) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } (x); // x here is narrowed to number | boolean +} +function foo3(x: number | string | boolean) { + return typeof x === "string" + ? x + : (() => { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(); +} +function foo4(x: number | string | boolean) { + return typeof x === "string" + ? x + : ((a: number | boolean) => { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(x); // x here is narrowed to number | boolean +} +// Type guards affect nested function expressions, but not nested function declarations +function foo5(x: number | string | boolean) { + if (typeof x === "string") { + var y = x; // string; + function foo() { + var z = x; // number | string | boolean, type guard has no effect + } + } +} +module m { + var x: number | string | boolean; + module m2 { + var b = x; // new scope - number | boolean | string + var y: string; + if (typeof x === "string") { + y = x // string; + } else { + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } + } +} +module m1 { + var x: number | string | boolean; + module m2.m3 { + var b = x; // new scope - number | boolean | string + var y: string; + if (typeof x === "string") { + y = x // string; + } else { + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } + } +} + +//// [typeGuardsInFunctionAndModuleBlock.js] +// typeguards are scoped in function/module block +function foo(x) { + return typeof x === "string" ? x : function f() { + var b = x; // number | boolean + return typeof x === "boolean" ? x.toString() : x.toString(); // number + }(); +} +function foo2(x) { + return typeof x === "string" ? x : function f(a) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" ? x.toString() : x.toString(); // number + }(x); // x here is narrowed to number | boolean +} +function foo3(x) { + return typeof x === "string" ? x : (function () { + var b = x; // new scope - number | boolean + return typeof x === "boolean" ? x.toString() : x.toString(); // number + })(); +} +function foo4(x) { + return typeof x === "string" ? x : (function (a) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" ? x.toString() : x.toString(); // number + })(x); // x here is narrowed to number | boolean +} +// Type guards affect nested function expressions, but not nested function declarations +function foo5(x) { + if (typeof x === "string") { + var y = x; // string; + function foo() { + var z = x; // number | string | boolean, type guard has no effect + } + } +} +var m; +(function (m) { + var x; + var m2; + (function (m2) { + var b = x; // new scope - number | boolean | string + var y; + if (typeof x === "string") { + y = x; // string; + } + else { + y = typeof x === "boolean" ? x.toString() : x.toString(); // number + } + })(m2 || (m2 = {})); +})(m || (m = {})); +var m1; +(function (m1) { + var x; + var m2; + (function (m2) { + var m3; + (function (m3) { + var b = x; // new scope - number | boolean | string + var y; + if (typeof x === "string") { + y = x; // string; + } + else { + y = typeof x === "boolean" ? x.toString() : x.toString(); // number + } + })(m3 = m2.m3 || (m2.m3 = {})); + })(m2 || (m2 = {})); +})(m1 || (m1 = {})); diff --git a/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types new file mode 100644 index 00000000000..3d914b5c80b --- /dev/null +++ b/tests/baselines/reference/typeGuardsInFunctionAndModuleBlock.types @@ -0,0 +1,297 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts === +// typeguards are scoped in function/module block + +function foo(x: number | string | boolean) { +>foo : (x: string | number | boolean) => string +>x : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? x : function f() { var b = x; // number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } () : string +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x +>x : string + + : function f() { +>function f() { var b = x; // number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } () : string +>function f() { var b = x; // number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } : () => string +>f : () => string + + var b = x; // number | boolean +>b : number | boolean +>x : number | boolean + + return typeof x === "boolean" +>typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x.toString() // boolean +>x.toString() : string +>x.toString : () => string +>x : boolean +>toString : () => string + + : x.toString(); // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + + } (); +} +function foo2(x: number | string | boolean) { +>foo2 : (x: string | number | boolean) => string +>x : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? x : function f(a: number | boolean) { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } (x) : string +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x +>x : string + + : function f(a: number | boolean) { +>function f(a: number | boolean) { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } (x) : string +>function f(a: number | boolean) { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } : (a: number | boolean) => string +>f : (a: number | boolean) => string +>a : number | boolean + + var b = x; // new scope - number | boolean +>b : number | boolean +>x : number | boolean + + return typeof x === "boolean" +>typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x.toString() // boolean +>x.toString() : string +>x.toString : () => string +>x : boolean +>toString : () => string + + : x.toString(); // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + + } (x); // x here is narrowed to number | boolean +>x : number | boolean +} +function foo3(x: number | string | boolean) { +>foo3 : (x: string | number | boolean) => string +>x : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? x : (() => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number })() : string +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x +>x : string + + : (() => { +>(() => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number })() : string +>(() => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number }) : () => string +>() => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } : () => string + + var b = x; // new scope - number | boolean +>b : number | boolean +>x : number | boolean + + return typeof x === "boolean" +>typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x.toString() // boolean +>x.toString() : string +>x.toString : () => string +>x : boolean +>toString : () => string + + : x.toString(); // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + + })(); +} +function foo4(x: number | string | boolean) { +>foo4 : (x: string | number | boolean) => string +>x : string | number | boolean + + return typeof x === "string" +>typeof x === "string" ? x : ((a: number | boolean) => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number })(x) : string +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + ? x +>x : string + + : ((a: number | boolean) => { +>((a: number | boolean) => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number })(x) : string +>((a: number | boolean) => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number }) : (a: number | boolean) => string +>(a: number | boolean) => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } : (a: number | boolean) => string +>a : number | boolean + + var b = x; // new scope - number | boolean +>b : number | boolean +>x : number | boolean + + return typeof x === "boolean" +>typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x.toString() // boolean +>x.toString() : string +>x.toString : () => string +>x : boolean +>toString : () => string + + : x.toString(); // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + + })(x); // x here is narrowed to number | boolean +>x : number | boolean +} +// Type guards affect nested function expressions, but not nested function declarations +function foo5(x: number | string | boolean) { +>foo5 : (x: string | number | boolean) => void +>x : string | number | boolean + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + var y = x; // string; +>y : string +>x : string + + function foo() { +>foo : () => void + + var z = x; // number | string | boolean, type guard has no effect +>z : string | number | boolean +>x : string | number | boolean + } + } +} +module m { +>m : typeof m + + var x: number | string | boolean; +>x : string | number | boolean + + module m2 { +>m2 : typeof m2 + + var b = x; // new scope - number | boolean | string +>b : string | number | boolean +>x : string | number | boolean + + var y: string; +>y : string + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + y = x // string; +>y = x : string +>y : string +>x : string + + } else { + y = typeof x === "boolean" +>y = typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>y : string +>typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x.toString() // boolean +>x.toString() : string +>x.toString : () => string +>x : boolean +>toString : () => string + + : x.toString(); // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + } + } +} +module m1 { +>m1 : typeof m1 + + var x: number | string | boolean; +>x : string | number | boolean + + module m2.m3 { +>m2 : typeof m2 +>m3 : typeof m3 + + var b = x; // new scope - number | boolean | string +>b : string | number | boolean +>x : string | number | boolean + + var y: string; +>y : string + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + y = x // string; +>y = x : string +>y : string +>x : string + + } else { + y = typeof x === "boolean" +>y = typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>y : string +>typeof x === "boolean" ? x.toString() // boolean : x.toString() : string +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + ? x.toString() // boolean +>x.toString() : string +>x.toString : () => string +>x : boolean +>toString : () => string + + : x.toString(); // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + } + } +} diff --git a/tests/baselines/reference/typeGuardsInGlobal.js b/tests/baselines/reference/typeGuardsInGlobal.js new file mode 100644 index 00000000000..6e1b1c3dd82 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInGlobal.js @@ -0,0 +1,27 @@ +//// [typeGuardsInGlobal.ts] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var var1: string | number; +if (typeof var1 === "string") { + num = var1.length; // string +} +else { + num = var1; // number +} + + +//// [typeGuardsInGlobal.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// variables in global +var num; +var var1; +if (typeof var1 === "string") { + num = var1.length; // string +} +else { + num = var1; // number +} diff --git a/tests/baselines/reference/typeGuardsInGlobal.types b/tests/baselines/reference/typeGuardsInGlobal.types new file mode 100644 index 00000000000..08b681dbb05 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInGlobal.types @@ -0,0 +1,30 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInGlobal.ts === +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +>num : number + +var var1: string | number; +>var1 : string | number + +if (typeof var1 === "string") { +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number + + num = var1.length; // string +>num = var1.length : number +>num : number +>var1.length : number +>var1 : string +>length : number +} +else { + num = var1; // number +>num = var1 : number +>num : number +>var1 : number +} + diff --git a/tests/baselines/reference/typeGuardsInIfStatement.js b/tests/baselines/reference/typeGuardsInIfStatement.js new file mode 100644 index 00000000000..6b1fb4b062c --- /dev/null +++ b/tests/baselines/reference/typeGuardsInIfStatement.js @@ -0,0 +1,287 @@ +//// [typeGuardsInIfStatement.ts] +// In the true branch statement of an �if� statement, +// the type of a variable or parameter is narrowed by any type guard in the �if� condition when true, +// provided the true branch statement contains no assignments to the variable or parameter. +// In the false branch statement of an �if� statement, +// the type of a variable or parameter is narrowed by any type guard in the �if� condition when false, +// provided the false branch statement contains no assignments to the variable or parameter +function foo(x: number | string) { + if (typeof x === "string") { + return x.length; // string + } + else { + return x++; // number + } +} +function foo2(x: number | string) { + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { + x = 10; + return x; // string | number + } + else { + return x; // string | number + } +} +function foo3(x: number | string) { + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { + x = "Hello"; // even though assigned using same type as narrowed expression + return x; // string | number + } + else { + return x; // string | number + } +} +function foo4(x: number | string) { + // false branch updates the variable - so here it is not number + if (typeof x === "string") { + return x; // string | number + } + else { + x = 10; // even though assigned number - this should result in x to be string | number + return x; // string | number + } +} +function foo5(x: number | string) { + // false branch updates the variable - so here it is not number + if (typeof x === "string") { + return x; // string | number + } + else { + x = "hello"; + return x; // string | number + } +} +function foo6(x: number | string) { + // Modify in both branches + if (typeof x === "string") { + x = 10; + return x; // string | number + } + else { + x = "hello"; + return x; // string | number + } +} +function foo7(x: number | string | boolean) { + if (typeof x === "string") { + return x === "hello"; // string + } + else if (typeof x === "boolean") { + return x; // boolean + } + else { + return x == 10; // number + } +} +function foo8(x: number | string | boolean) { + if (typeof x === "string") { + return x === "hello"; // string + } + else { + var b: number | boolean = x; // number | boolean + if (typeof x === "boolean") { + return x; // boolean + } + else { + return x == 10; // number + } + } +} +function foo9(x: number | string) { + var y = 10; + if (typeof x === "string") { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + y = x.length; + return x === "hello"; // string + } + else { + return x == 10; // number + } +} +function foo10(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + if (typeof x === "string") { + return x === "hello"; // string + } + else { + var y: boolean | string; + var b = x; // number | boolean + return typeof x === "number" + ? x === 10 // number + : x; // x should be boolean + } +} +function foo11(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x deep inside another guard stops narrowing of type too + if (typeof x === "string") { + return x; // string | number | boolean - x changed in else branch + } + else { + var y: number| boolean | string; + var b = x; // number | boolean | string - because below we are changing value of x in if statement + return typeof x === "number" + ? ( + // change value of x + x = 10 && x.toString() // number | boolean | string + ) + : ( + // do not change value + y = x && x.toString() // number | boolean | string + ); + } +} +function foo12(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + if (typeof x === "string") { + return x.toString(); // string | number | boolean - x changed in else branch + } + else { + x = 10; + var b = x; // number | boolean | string + return typeof x === "number" + ? x.toString() // number + : x.toString(); // boolean | string + } +} + +//// [typeGuardsInIfStatement.js] +// In the true branch statement of an �if� statement, +// the type of a variable or parameter is narrowed by any type guard in the �if� condition when true, +// provided the true branch statement contains no assignments to the variable or parameter. +// In the false branch statement of an �if� statement, +// the type of a variable or parameter is narrowed by any type guard in the �if� condition when false, +// provided the false branch statement contains no assignments to the variable or parameter +function foo(x) { + if (typeof x === "string") { + return x.length; // string + } + else { + return x++; // number + } +} +function foo2(x) { + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { + x = 10; + return x; // string | number + } + else { + return x; // string | number + } +} +function foo3(x) { + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { + x = "Hello"; // even though assigned using same type as narrowed expression + return x; // string | number + } + else { + return x; // string | number + } +} +function foo4(x) { + // false branch updates the variable - so here it is not number + if (typeof x === "string") { + return x; // string | number + } + else { + x = 10; // even though assigned number - this should result in x to be string | number + return x; // string | number + } +} +function foo5(x) { + // false branch updates the variable - so here it is not number + if (typeof x === "string") { + return x; // string | number + } + else { + x = "hello"; + return x; // string | number + } +} +function foo6(x) { + // Modify in both branches + if (typeof x === "string") { + x = 10; + return x; // string | number + } + else { + x = "hello"; + return x; // string | number + } +} +function foo7(x) { + if (typeof x === "string") { + return x === "hello"; // string + } + else if (typeof x === "boolean") { + return x; // boolean + } + else { + return x == 10; // number + } +} +function foo8(x) { + if (typeof x === "string") { + return x === "hello"; // string + } + else { + var b = x; // number | boolean + if (typeof x === "boolean") { + return x; // boolean + } + else { + return x == 10; // number + } + } +} +function foo9(x) { + var y = 10; + if (typeof x === "string") { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + y = x.length; + return x === "hello"; // string + } + else { + return x == 10; // number + } +} +function foo10(x) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + if (typeof x === "string") { + return x === "hello"; // string + } + else { + var y; + var b = x; // number | boolean + return typeof x === "number" ? x === 10 : x; // x should be boolean + } +} +function foo11(x) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x deep inside another guard stops narrowing of type too + if (typeof x === "string") { + return x; // string | number | boolean - x changed in else branch + } + else { + var y; + var b = x; // number | boolean | string - because below we are changing value of x in if statement + return typeof x === "number" ? (x = 10 && x.toString()) : (y = x && x.toString()); + } +} +function foo12(x) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + if (typeof x === "string") { + return x.toString(); // string | number | boolean - x changed in else branch + } + else { + x = 10; + var b = x; // number | boolean | string + return typeof x === "number" ? x.toString() : x.toString(); // boolean | string + } +} diff --git a/tests/baselines/reference/typeGuardsInIfStatement.types b/tests/baselines/reference/typeGuardsInIfStatement.types new file mode 100644 index 00000000000..f443c0d7e0d --- /dev/null +++ b/tests/baselines/reference/typeGuardsInIfStatement.types @@ -0,0 +1,371 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts === +// In the true branch statement of an �if� statement, +// the type of a variable or parameter is narrowed by any type guard in the �if� condition when true, +// provided the true branch statement contains no assignments to the variable or parameter. +// In the false branch statement of an �if� statement, +// the type of a variable or parameter is narrowed by any type guard in the �if� condition when false, +// provided the false branch statement contains no assignments to the variable or parameter +function foo(x: number | string) { +>foo : (x: string | number) => number +>x : string | number + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + return x.length; // string +>x.length : number +>x : string +>length : number + } + else { + return x++; // number +>x++ : number +>x : number + } +} +function foo2(x: number | string) { +>foo2 : (x: string | number) => string | number +>x : string | number + + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + x = 10; +>x = 10 : number +>x : string | number + + return x; // string | number +>x : string | number + } + else { + return x; // string | number +>x : string | number + } +} +function foo3(x: number | string) { +>foo3 : (x: string | number) => string | number +>x : string | number + + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + x = "Hello"; // even though assigned using same type as narrowed expression +>x = "Hello" : string +>x : string | number + + return x; // string | number +>x : string | number + } + else { + return x; // string | number +>x : string | number + } +} +function foo4(x: number | string) { +>foo4 : (x: string | number) => string | number +>x : string | number + + // false branch updates the variable - so here it is not number + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + return x; // string | number +>x : string | number + } + else { + x = 10; // even though assigned number - this should result in x to be string | number +>x = 10 : number +>x : string | number + + return x; // string | number +>x : string | number + } +} +function foo5(x: number | string) { +>foo5 : (x: string | number) => string | number +>x : string | number + + // false branch updates the variable - so here it is not number + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + return x; // string | number +>x : string | number + } + else { + x = "hello"; +>x = "hello" : string +>x : string | number + + return x; // string | number +>x : string | number + } +} +function foo6(x: number | string) { +>foo6 : (x: string | number) => string | number +>x : string | number + + // Modify in both branches + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + x = 10; +>x = 10 : number +>x : string | number + + return x; // string | number +>x : string | number + } + else { + x = "hello"; +>x = "hello" : string +>x : string | number + + return x; // string | number +>x : string | number + } +} +function foo7(x: number | string | boolean) { +>foo7 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + return x === "hello"; // string +>x === "hello" : boolean +>x : string + } + else if (typeof x === "boolean") { +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + return x; // boolean +>x : boolean + } + else { + return x == 10; // number +>x == 10 : boolean +>x : number + } +} +function foo8(x: number | string | boolean) { +>foo8 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + return x === "hello"; // string +>x === "hello" : boolean +>x : string + } + else { + var b: number | boolean = x; // number | boolean +>b : number | boolean +>x : number | boolean + + if (typeof x === "boolean") { +>typeof x === "boolean" : boolean +>typeof x : string +>x : number | boolean + + return x; // boolean +>x : boolean + } + else { + return x == 10; // number +>x == 10 : boolean +>x : number + } + } +} +function foo9(x: number | string) { +>foo9 : (x: string | number) => boolean +>x : string | number + + var y = 10; +>y : number + + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + y = x.length; +>y = x.length : number +>y : number +>x.length : number +>x : string +>length : number + + return x === "hello"; // string +>x === "hello" : boolean +>x : string + } + else { + return x == 10; // number +>x == 10 : boolean +>x : number + } +} +function foo10(x: number | string | boolean) { +>foo10 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + // Mixing typeguard narrowing in if statement with conditional expression typeguard + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + return x === "hello"; // string +>x === "hello" : boolean +>x : string + } + else { + var y: boolean | string; +>y : string | boolean + + var b = x; // number | boolean +>b : number | boolean +>x : number | boolean + + return typeof x === "number" +>typeof x === "number" ? x === 10 // number : x : boolean +>typeof x === "number" : boolean +>typeof x : string +>x : number | boolean + + ? x === 10 // number +>x === 10 : boolean +>x : number + + : x; // x should be boolean +>x : boolean + } +} +function foo11(x: number | string | boolean) { +>foo11 : (x: string | number | boolean) => string | number | boolean +>x : string | number | boolean + + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x deep inside another guard stops narrowing of type too + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + return x; // string | number | boolean - x changed in else branch +>x : string | number | boolean + } + else { + var y: number| boolean | string; +>y : string | number | boolean + + var b = x; // number | boolean | string - because below we are changing value of x in if statement +>b : string | number | boolean +>x : string | number | boolean + + return typeof x === "number" +>typeof x === "number" ? ( // change value of x x = 10 && x.toString() // number | boolean | string ) : ( // do not change value y = x && x.toString() // number | boolean | string ) : string +>typeof x === "number" : boolean +>typeof x : string +>x : string | number | boolean + + ? ( +>( // change value of x x = 10 && x.toString() // number | boolean | string ) : string + + // change value of x + x = 10 && x.toString() // number | boolean | string +>x = 10 && x.toString() : string +>x : string | number | boolean +>10 && x.toString() : string +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string + + ) + : ( +>( // do not change value y = x && x.toString() // number | boolean | string ) : string + + // do not change value + y = x && x.toString() // number | boolean | string +>y = x && x.toString() : string +>y : string | number | boolean +>x && x.toString() : string +>x : string | number | boolean +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string + + ); + } +} +function foo12(x: number | string | boolean) { +>foo12 : (x: string | number | boolean) => string +>x : string | number | boolean + + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + if (typeof x === "string") { +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + return x.toString(); // string | number | boolean - x changed in else branch +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string + } + else { + x = 10; +>x = 10 : number +>x : string | number | boolean + + var b = x; // number | boolean | string +>b : string | number | boolean +>x : string | number | boolean + + return typeof x === "number" +>typeof x === "number" ? x.toString() // number : x.toString() : string +>typeof x === "number" : boolean +>typeof x : string +>x : string | number | boolean + + ? x.toString() // number +>x.toString() : string +>x.toString : (radix?: number) => string +>x : number +>toString : (radix?: number) => string + + : x.toString(); // boolean | string +>x.toString() : string +>x.toString : () => string +>x : string | boolean +>toString : () => string + } +} diff --git a/tests/baselines/reference/typeGuardsInModule.js b/tests/baselines/reference/typeGuardsInModule.js new file mode 100644 index 00000000000..c72b9e58aa2 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInModule.js @@ -0,0 +1,174 @@ +//// [typeGuardsInModule.ts] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var strOrNum: string | number; +var var1: string | number; +// Inside module +module m1 { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in module declaration + var var2: string | number; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + + // exported variable in the module + export var var3: string | number; + if (typeof var3 === "string") { + strOrNum = var3; // string | number + } + else { + strOrNum = var3; // string | number + } +} +// local module +module m2 { + var var2: string | number; + export var var3: string | number; + module m3 { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // local variables from outer module declaration + num = typeof var2 === "string" && var2.length; // string + + // exported variable from outer the module + strOrNum = typeof var3 === "string" && var3; // string | number + + // variables in module declaration + var var4: string | number; + if (typeof var4 === "string") { + num = var4.length; // string + } + else { + num = var4; // number + } + + // exported variable in the module + export var var5: string | number; + if (typeof var5 === "string") { + strOrNum = var5; // string | number + } + else { + strOrNum = var5; // string | number + } + } +} +// Dotted module +module m3.m4 { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in module declaration + var var2: string | number; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + + // exported variable in the module + export var var3: string | number; + if (typeof var3 === "string") { + strOrNum = var3; // string | number + } + else { + strOrNum = var3; // string | number + } +} + + +//// [typeGuardsInModule.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// variables in global +var num; +var strOrNum; +var var1; +// Inside module +var m1; +(function (m1) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in module declaration + var var2; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + // exported variable in the module + m1.var3; + if (typeof m1.var3 === "string") { + strOrNum = m1.var3; // string | number + } + else { + strOrNum = m1.var3; // string | number + } +})(m1 || (m1 = {})); +// local module +var m2; +(function (m2) { + var var2; + m2.var3; + var m3; + (function (m3) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // local variables from outer module declaration + num = typeof var2 === "string" && var2.length; // string + // exported variable from outer the module + strOrNum = typeof m2.var3 === "string" && m2.var3; // string | number + // variables in module declaration + var var4; + if (typeof var4 === "string") { + num = var4.length; // string + } + else { + num = var4; // number + } + // exported variable in the module + m3.var5; + if (typeof m3.var5 === "string") { + strOrNum = m3.var5; // string | number + } + else { + strOrNum = m3.var5; // string | number + } + })(m3 || (m3 = {})); +})(m2 || (m2 = {})); +// Dotted module +var m3; +(function (m3) { + var m4; + (function (m4) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in module declaration + var var2; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + // exported variable in the module + m4.var3; + if (typeof m4.var3 === "string") { + strOrNum = m4.var3; // string | number + } + else { + strOrNum = m4.var3; // string | number + } + })(m4 = m3.m4 || (m3.m4 = {})); +})(m3 || (m3 = {})); diff --git a/tests/baselines/reference/typeGuardsInModule.types b/tests/baselines/reference/typeGuardsInModule.types new file mode 100644 index 00000000000..82a0345b170 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInModule.types @@ -0,0 +1,228 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInModule.ts === +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var var1: string | number; +>var1 : string | number + +// Inside module +module m1 { +>m1 : typeof m1 + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in module declaration + var var2: string | number; +>var2 : string | number + + if (typeof var2 === "string") { +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number + + num = var2.length; // string +>num = var2.length : number +>num : number +>var2.length : number +>var2 : string +>length : number + } + else { + num = var2; // number +>num = var2 : number +>num : number +>var2 : number + } + + // exported variable in the module + export var var3: string | number; +>var3 : string | number + + if (typeof var3 === "string") { +>typeof var3 === "string" : boolean +>typeof var3 : string +>var3 : string | number + + strOrNum = var3; // string | number +>strOrNum = var3 : string | number +>strOrNum : string | number +>var3 : string | number + } + else { + strOrNum = var3; // string | number +>strOrNum = var3 : string | number +>strOrNum : string | number +>var3 : string | number + } +} +// local module +module m2 { +>m2 : typeof m2 + + var var2: string | number; +>var2 : string | number + + export var var3: string | number; +>var3 : string | number + + module m3 { +>m3 : typeof m3 + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // local variables from outer module declaration + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // exported variable from outer the module + strOrNum = typeof var3 === "string" && var3; // string | number +>strOrNum = typeof var3 === "string" && var3 : string | number +>strOrNum : string | number +>typeof var3 === "string" && var3 : string | number +>typeof var3 === "string" : boolean +>typeof var3 : string +>var3 : string | number +>var3 : string | number + + // variables in module declaration + var var4: string | number; +>var4 : string | number + + if (typeof var4 === "string") { +>typeof var4 === "string" : boolean +>typeof var4 : string +>var4 : string | number + + num = var4.length; // string +>num = var4.length : number +>num : number +>var4.length : number +>var4 : string +>length : number + } + else { + num = var4; // number +>num = var4 : number +>num : number +>var4 : number + } + + // exported variable in the module + export var var5: string | number; +>var5 : string | number + + if (typeof var5 === "string") { +>typeof var5 === "string" : boolean +>typeof var5 : string +>var5 : string | number + + strOrNum = var5; // string | number +>strOrNum = var5 : string | number +>strOrNum : string | number +>var5 : string | number + } + else { + strOrNum = var5; // string | number +>strOrNum = var5 : string | number +>strOrNum : string | number +>var5 : string | number + } + } +} +// Dotted module +module m3.m4 { +>m3 : typeof m3 +>m4 : typeof m4 + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in module declaration + var var2: string | number; +>var2 : string | number + + if (typeof var2 === "string") { +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number + + num = var2.length; // string +>num = var2.length : number +>num : number +>var2.length : number +>var2 : string +>length : number + } + else { + num = var2; // number +>num = var2 : number +>num : number +>var2 : number + } + + // exported variable in the module + export var var3: string | number; +>var3 : string | number + + if (typeof var3 === "string") { +>typeof var3 === "string" : boolean +>typeof var3 : string +>var3 : string | number + + strOrNum = var3; // string | number +>strOrNum = var3 : string | number +>strOrNum : string | number +>var3 : string | number + } + else { + strOrNum = var3; // string | number +>strOrNum = var3 : string | number +>strOrNum : string | number +>var3 : string | number + } +} + diff --git a/tests/baselines/reference/typeGuardsInProperties.js b/tests/baselines/reference/typeGuardsInProperties.js new file mode 100644 index 00000000000..78ad29a28b0 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInProperties.js @@ -0,0 +1,56 @@ +//// [typeGuardsInProperties.ts] + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +var num: number; +var strOrNum: string | number; +class C1 { + private pp1: string | number; + pp2: string | number; + // Inside public accessor getter + get pp3() { + return strOrNum; + } + method() { + strOrNum = typeof this.pp1 === "string" && this.pp1; // string | number + strOrNum = typeof this.pp2 === "string" && this.pp2; // string | number + strOrNum = typeof this.pp3 === "string" && this.pp3; // string | number + } +} +var c1: C1; +strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number +strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number +var obj1: { + x: string | number; +}; +strOrNum = typeof obj1.x === "string" && obj1.x; // string | number + +//// [typeGuardsInProperties.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +var num; +var strOrNum; +var C1 = (function () { + function C1() { + } + Object.defineProperty(C1.prototype, "pp3", { + // Inside public accessor getter + get: function () { + return strOrNum; + }, + enumerable: true, + configurable: true + }); + C1.prototype.method = function () { + strOrNum = typeof this.pp1 === "string" && this.pp1; // string | number + strOrNum = typeof this.pp2 === "string" && this.pp2; // string | number + strOrNum = typeof this.pp3 === "string" && this.pp3; // string | number + }; + return C1; +})(); +var c1; +strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number +strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number +var obj1; +strOrNum = typeof obj1.x === "string" && obj1.x; // string | number diff --git a/tests/baselines/reference/typeGuardsInProperties.types b/tests/baselines/reference/typeGuardsInProperties.types new file mode 100644 index 00000000000..46e9ec0d42c --- /dev/null +++ b/tests/baselines/reference/typeGuardsInProperties.types @@ -0,0 +1,120 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInProperties.ts === + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +class C1 { +>C1 : C1 + + private pp1: string | number; +>pp1 : string | number + + pp2: string | number; +>pp2 : string | number + + // Inside public accessor getter + get pp3() { +>pp3 : string | number + + return strOrNum; +>strOrNum : string | number + } + method() { +>method : () => void + + strOrNum = typeof this.pp1 === "string" && this.pp1; // string | number +>strOrNum = typeof this.pp1 === "string" && this.pp1 : string | number +>strOrNum : string | number +>typeof this.pp1 === "string" && this.pp1 : string | number +>typeof this.pp1 === "string" : boolean +>typeof this.pp1 : string +>this.pp1 : string | number +>this : C1 +>pp1 : string | number +>this.pp1 : string | number +>this : C1 +>pp1 : string | number + + strOrNum = typeof this.pp2 === "string" && this.pp2; // string | number +>strOrNum = typeof this.pp2 === "string" && this.pp2 : string | number +>strOrNum : string | number +>typeof this.pp2 === "string" && this.pp2 : string | number +>typeof this.pp2 === "string" : boolean +>typeof this.pp2 : string +>this.pp2 : string | number +>this : C1 +>pp2 : string | number +>this.pp2 : string | number +>this : C1 +>pp2 : string | number + + strOrNum = typeof this.pp3 === "string" && this.pp3; // string | number +>strOrNum = typeof this.pp3 === "string" && this.pp3 : string | number +>strOrNum : string | number +>typeof this.pp3 === "string" && this.pp3 : string | number +>typeof this.pp3 === "string" : boolean +>typeof this.pp3 : string +>this.pp3 : string | number +>this : C1 +>pp3 : string | number +>this.pp3 : string | number +>this : C1 +>pp3 : string | number + } +} +var c1: C1; +>c1 : C1 +>C1 : C1 + +strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number +>strOrNum = typeof c1.pp2 === "string" && c1.pp2 : string | number +>strOrNum : string | number +>typeof c1.pp2 === "string" && c1.pp2 : string | number +>typeof c1.pp2 === "string" : boolean +>typeof c1.pp2 : string +>c1.pp2 : string | number +>c1 : C1 +>pp2 : string | number +>c1.pp2 : string | number +>c1 : C1 +>pp2 : string | number + +strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number +>strOrNum = typeof c1.pp3 === "string" && c1.pp3 : string | number +>strOrNum : string | number +>typeof c1.pp3 === "string" && c1.pp3 : string | number +>typeof c1.pp3 === "string" : boolean +>typeof c1.pp3 : string +>c1.pp3 : string | number +>c1 : C1 +>pp3 : string | number +>c1.pp3 : string | number +>c1 : C1 +>pp3 : string | number + +var obj1: { +>obj1 : { x: string | number; } + + x: string | number; +>x : string | number + +}; +strOrNum = typeof obj1.x === "string" && obj1.x; // string | number +>strOrNum = typeof obj1.x === "string" && obj1.x : string | number +>strOrNum : string | number +>typeof obj1.x === "string" && obj1.x : string | number +>typeof obj1.x === "string" : boolean +>typeof obj1.x : string +>obj1.x : string | number +>obj1 : { x: string | number; } +>x : string | number +>obj1.x : string | number +>obj1 : { x: string | number; } +>x : string | number + diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js new file mode 100644 index 00000000000..501c5d8a9f9 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.js @@ -0,0 +1,96 @@ +//// [typeGuardsInRightOperandOfAndAndOperator.ts] +// In the right operand of a && operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when true, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x: number | string) { + return typeof x === "string" && x.length === 10; // string +} +function foo2(x: number | string) { + // modify x in right hand operand + return typeof x === "string" && ((x = 10) && x); // string | number +} +function foo3(x: number | string) { + // modify x in right hand operand with string type itself + return typeof x === "string" && ((x = "hello") && x); // string | number +} +function foo4(x: number | string | boolean) { + return typeof x !== "string" // string | number | boolean + && typeof x !== "number" // number | boolean + && x; // boolean +} +function foo5(x: number | string | boolean) { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b: number | boolean; + return typeof x !== "string" // string | number | boolean + && ((b = x) && (typeof x !== "number" // number | boolean + && x)); // boolean +} +function foo6(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + return typeof x !== "string" // string | number | boolean + && (typeof x !== "number" // number | boolean + ? x // boolean + : x === 10) // number +} +function foo7(x: number | string | boolean) { + var y: number| boolean | string; + var z: number| boolean | string; + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x !== "string" + && ((z = x) // string | number | boolean - x changed deeper in conditional expression + && (typeof x === "number" + // change value of x + ? (x = 10 && x.toString()) // number | boolean | string + // do not change value + : (y = x && x.toString()))); // number | boolean | string +} +function foo8(x: number | string) { + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x !== "string" + && (x = 10) // change x - number| string + && (typeof x === "number" + ? x // number + : x.length); // string +} + +//// [typeGuardsInRightOperandOfAndAndOperator.js] +// In the right operand of a && operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when true, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x) { + return typeof x === "string" && x.length === 10; // string +} +function foo2(x) { + // modify x in right hand operand + return typeof x === "string" && ((x = 10) && x); // string | number +} +function foo3(x) { + // modify x in right hand operand with string type itself + return typeof x === "string" && ((x = "hello") && x); // string | number +} +function foo4(x) { + return typeof x !== "string" && typeof x !== "number" && x; // boolean +} +function foo5(x) { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b; + return typeof x !== "string" && ((b = x) && (typeof x !== "number" && x)); // boolean +} +function foo6(x) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + return typeof x !== "string" && (typeof x !== "number" ? x : x === 10); // number +} +function foo7(x) { + var y; + var z; + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x !== "string" && ((z = x) && (typeof x === "number" ? (x = 10 && x.toString()) : (y = x && x.toString()))); // number | boolean | string +} +function foo8(x) { + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x !== "string" && (x = 10) && (typeof x === "number" ? x : x.length); // string +} diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types new file mode 100644 index 00000000000..884c1cc1f5e --- /dev/null +++ b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types @@ -0,0 +1,215 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfAndAndOperator.ts === +// In the right operand of a && operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when true, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x: number | string) { +>foo : (x: string | number) => boolean +>x : string | number + + return typeof x === "string" && x.length === 10; // string +>typeof x === "string" && x.length === 10 : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>x.length === 10 : boolean +>x.length : number +>x : string +>length : number +} +function foo2(x: number | string) { +>foo2 : (x: string | number) => string | number +>x : string | number + + // modify x in right hand operand + return typeof x === "string" && ((x = 10) && x); // string | number +>typeof x === "string" && ((x = 10) && x) : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>((x = 10) && x) : string | number +>(x = 10) && x : string | number +>(x = 10) : number +>x = 10 : number +>x : string | number +>x : string | number +} +function foo3(x: number | string) { +>foo3 : (x: string | number) => string | number +>x : string | number + + // modify x in right hand operand with string type itself + return typeof x === "string" && ((x = "hello") && x); // string | number +>typeof x === "string" && ((x = "hello") && x) : string | number +>typeof x === "string" : boolean +>typeof x : string +>x : string | number +>((x = "hello") && x) : string | number +>(x = "hello") && x : string | number +>(x = "hello") : string +>x = "hello" : string +>x : string | number +>x : string | number +} +function foo4(x: number | string | boolean) { +>foo4 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + return typeof x !== "string" // string | number | boolean +>typeof x !== "string" // string | number | boolean && typeof x !== "number" // number | boolean && x : boolean +>typeof x !== "string" // string | number | boolean && typeof x !== "number" : boolean +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number | boolean + + && typeof x !== "number" // number | boolean +>typeof x !== "number" : boolean +>typeof x : string +>x : number | boolean + + && x; // boolean +>x : boolean +} +function foo5(x: number | string | boolean) { +>foo5 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b: number | boolean; +>b : number | boolean + + return typeof x !== "string" // string | number | boolean +>typeof x !== "string" // string | number | boolean && ((b = x) && (typeof x !== "number" // number | boolean && x)) : boolean +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number | boolean + + && ((b = x) && (typeof x !== "number" // number | boolean +>((b = x) && (typeof x !== "number" // number | boolean && x)) : boolean +>(b = x) && (typeof x !== "number" // number | boolean && x) : boolean +>(b = x) : number | boolean +>b = x : number | boolean +>b : number | boolean +>x : number | boolean +>(typeof x !== "number" // number | boolean && x) : boolean +>typeof x !== "number" // number | boolean && x : boolean +>typeof x !== "number" : boolean +>typeof x : string +>x : number | boolean + + && x)); // boolean +>x : boolean +} +function foo6(x: number | string | boolean) { +>foo6 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + // Mixing typeguard narrowing in if statement with conditional expression typeguard + return typeof x !== "string" // string | number | boolean +>typeof x !== "string" // string | number | boolean && (typeof x !== "number" // number | boolean ? x // boolean : x === 10) : boolean +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number | boolean + + && (typeof x !== "number" // number | boolean +>(typeof x !== "number" // number | boolean ? x // boolean : x === 10) : boolean +>typeof x !== "number" // number | boolean ? x // boolean : x === 10 : boolean +>typeof x !== "number" : boolean +>typeof x : string +>x : number | boolean + + ? x // boolean +>x : boolean + + : x === 10) // number +>x === 10 : boolean +>x : number +} +function foo7(x: number | string | boolean) { +>foo7 : (x: string | number | boolean) => string +>x : string | number | boolean + + var y: number| boolean | string; +>y : string | number | boolean + + var z: number| boolean | string; +>z : string | number | boolean + + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x !== "string" +>typeof x !== "string" && ((z = x) // string | number | boolean - x changed deeper in conditional expression && (typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString()))) : string +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number | boolean + + && ((z = x) // string | number | boolean - x changed deeper in conditional expression +>((z = x) // string | number | boolean - x changed deeper in conditional expression && (typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString()))) : string +>(z = x) // string | number | boolean - x changed deeper in conditional expression && (typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString())) : string +>(z = x) : string | number | boolean +>z = x : string | number | boolean +>z : string | number | boolean +>x : string | number | boolean + + && (typeof x === "number" +>(typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString())) : string +>typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString()) : string +>typeof x === "number" : boolean +>typeof x : string +>x : string | number | boolean + + // change value of x + ? (x = 10 && x.toString()) // number | boolean | string +>(x = 10 && x.toString()) : string +>x = 10 && x.toString() : string +>x : string | number | boolean +>10 && x.toString() : string +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string + + // do not change value + : (y = x && x.toString()))); // number | boolean | string +>(y = x && x.toString()) : string +>y = x && x.toString() : string +>y : string | number | boolean +>x && x.toString() : string +>x : string | number | boolean +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string +} +function foo8(x: number | string) { +>foo8 : (x: string | number) => number +>x : string | number + + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x !== "string" +>typeof x !== "string" && (x = 10) // change x - number| string && (typeof x === "number" ? x // number : x.length) : number +>typeof x !== "string" && (x = 10) : number +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number + + && (x = 10) // change x - number| string +>(x = 10) : number +>x = 10 : number +>x : string | number + + && (typeof x === "number" +>(typeof x === "number" ? x // number : x.length) : number +>typeof x === "number" ? x // number : x.length : number +>typeof x === "number" : boolean +>typeof x : string +>x : string | number + + ? x // number +>x : number + + : x.length); // string +>x.length : number +>x : string +>length : number +} diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js new file mode 100644 index 00000000000..d2b7938a9ca --- /dev/null +++ b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.js @@ -0,0 +1,96 @@ +//// [typeGuardsInRightOperandOfOrOrOperator.ts] +// In the right operand of a || operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when false, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x: number | string) { + return typeof x !== "string" || x.length === 10; // string +} +function foo2(x: number | string) { + // modify x in right hand operand + return typeof x !== "string" || ((x = 10) || x); // string | number +} +function foo3(x: number | string) { + // modify x in right hand operand with string type itself + return typeof x !== "string" || ((x = "hello") || x); // string | number +} +function foo4(x: number | string | boolean) { + return typeof x === "string" // string | number | boolean + || typeof x === "number" // number | boolean + || x; // boolean +} +function foo5(x: number | string | boolean) { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b: number | boolean; + return typeof x === "string" // string | number | boolean + || ((b = x) || (typeof x === "number" // number | boolean + || x)); // boolean +} +function foo6(x: number | string | boolean) { + // Mixing typeguard + return typeof x === "string" // string | number | boolean + || (typeof x !== "number" // number | boolean + ? x // boolean + : x === 10) // number +} +function foo7(x: number | string | boolean) { + var y: number| boolean | string; + var z: number| boolean | string; + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x === "string" + || ((z = x) // string | number | boolean - x changed deeper in conditional expression + || (typeof x === "number" + // change value of x + ? (x = 10 && x.toString()) // number | boolean | string + // do not change value + : (y = x && x.toString()))); // number | boolean | string +} +function foo8(x: number | string) { + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x === "string" + || (x = 10) // change x - number| string + || (typeof x === "number" + ? x // number + : x.length); // string +} + +//// [typeGuardsInRightOperandOfOrOrOperator.js] +// In the right operand of a || operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when false, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x) { + return typeof x !== "string" || x.length === 10; // string +} +function foo2(x) { + // modify x in right hand operand + return typeof x !== "string" || ((x = 10) || x); // string | number +} +function foo3(x) { + // modify x in right hand operand with string type itself + return typeof x !== "string" || ((x = "hello") || x); // string | number +} +function foo4(x) { + return typeof x === "string" || typeof x === "number" || x; // boolean +} +function foo5(x) { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b; + return typeof x === "string" || ((b = x) || (typeof x === "number" || x)); // boolean +} +function foo6(x) { + // Mixing typeguard + return typeof x === "string" || (typeof x !== "number" ? x : x === 10); // number +} +function foo7(x) { + var y; + var z; + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x === "string" || ((z = x) || (typeof x === "number" ? (x = 10 && x.toString()) : (y = x && x.toString()))); // number | boolean | string +} +function foo8(x) { + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x === "string" || (x = 10) || (typeof x === "number" ? x : x.length); // string +} diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types new file mode 100644 index 00000000000..8940d50c2d4 --- /dev/null +++ b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types @@ -0,0 +1,215 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfOrOrOperator.ts === +// In the right operand of a || operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when false, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x: number | string) { +>foo : (x: string | number) => boolean +>x : string | number + + return typeof x !== "string" || x.length === 10; // string +>typeof x !== "string" || x.length === 10 : boolean +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number +>x.length === 10 : boolean +>x.length : number +>x : string +>length : number +} +function foo2(x: number | string) { +>foo2 : (x: string | number) => string | number | boolean +>x : string | number + + // modify x in right hand operand + return typeof x !== "string" || ((x = 10) || x); // string | number +>typeof x !== "string" || ((x = 10) || x) : string | number | boolean +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number +>((x = 10) || x) : string | number +>(x = 10) || x : string | number +>(x = 10) : number +>x = 10 : number +>x : string | number +>x : string | number +} +function foo3(x: number | string) { +>foo3 : (x: string | number) => string | number | boolean +>x : string | number + + // modify x in right hand operand with string type itself + return typeof x !== "string" || ((x = "hello") || x); // string | number +>typeof x !== "string" || ((x = "hello") || x) : string | number | boolean +>typeof x !== "string" : boolean +>typeof x : string +>x : string | number +>((x = "hello") || x) : string | number +>(x = "hello") || x : string | number +>(x = "hello") : string +>x = "hello" : string +>x : string | number +>x : string | number +} +function foo4(x: number | string | boolean) { +>foo4 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + return typeof x === "string" // string | number | boolean +>typeof x === "string" // string | number | boolean || typeof x === "number" // number | boolean || x : boolean +>typeof x === "string" // string | number | boolean || typeof x === "number" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + || typeof x === "number" // number | boolean +>typeof x === "number" : boolean +>typeof x : string +>x : number | boolean + + || x; // boolean +>x : boolean +} +function foo5(x: number | string | boolean) { +>foo5 : (x: string | number | boolean) => number | boolean +>x : string | number | boolean + + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b: number | boolean; +>b : number | boolean + + return typeof x === "string" // string | number | boolean +>typeof x === "string" // string | number | boolean || ((b = x) || (typeof x === "number" // number | boolean || x)) : number | boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + || ((b = x) || (typeof x === "number" // number | boolean +>((b = x) || (typeof x === "number" // number | boolean || x)) : number | boolean +>(b = x) || (typeof x === "number" // number | boolean || x) : number | boolean +>(b = x) : number | boolean +>b = x : number | boolean +>b : number | boolean +>x : number | boolean +>(typeof x === "number" // number | boolean || x) : boolean +>typeof x === "number" // number | boolean || x : boolean +>typeof x === "number" : boolean +>typeof x : string +>x : number | boolean + + || x)); // boolean +>x : boolean +} +function foo6(x: number | string | boolean) { +>foo6 : (x: string | number | boolean) => boolean +>x : string | number | boolean + + // Mixing typeguard + return typeof x === "string" // string | number | boolean +>typeof x === "string" // string | number | boolean || (typeof x !== "number" // number | boolean ? x // boolean : x === 10) : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + || (typeof x !== "number" // number | boolean +>(typeof x !== "number" // number | boolean ? x // boolean : x === 10) : boolean +>typeof x !== "number" // number | boolean ? x // boolean : x === 10 : boolean +>typeof x !== "number" : boolean +>typeof x : string +>x : number | boolean + + ? x // boolean +>x : boolean + + : x === 10) // number +>x === 10 : boolean +>x : number +} +function foo7(x: number | string | boolean) { +>foo7 : (x: string | number | boolean) => string | number | boolean +>x : string | number | boolean + + var y: number| boolean | string; +>y : string | number | boolean + + var z: number| boolean | string; +>z : string | number | boolean + + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x === "string" +>typeof x === "string" || ((z = x) // string | number | boolean - x changed deeper in conditional expression || (typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString()))) : string | number | boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number | boolean + + || ((z = x) // string | number | boolean - x changed deeper in conditional expression +>((z = x) // string | number | boolean - x changed deeper in conditional expression || (typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString()))) : string | number | boolean +>(z = x) // string | number | boolean - x changed deeper in conditional expression || (typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString())) : string | number | boolean +>(z = x) : string | number | boolean +>z = x : string | number | boolean +>z : string | number | boolean +>x : string | number | boolean + + || (typeof x === "number" +>(typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString())) : string +>typeof x === "number" // change value of x ? (x = 10 && x.toString()) // number | boolean | string // do not change value : (y = x && x.toString()) : string +>typeof x === "number" : boolean +>typeof x : string +>x : string | number | boolean + + // change value of x + ? (x = 10 && x.toString()) // number | boolean | string +>(x = 10 && x.toString()) : string +>x = 10 && x.toString() : string +>x : string | number | boolean +>10 && x.toString() : string +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string + + // do not change value + : (y = x && x.toString()))); // number | boolean | string +>(y = x && x.toString()) : string +>y = x && x.toString() : string +>y : string | number | boolean +>x && x.toString() : string +>x : string | number | boolean +>x.toString() : string +>x.toString : () => string +>x : string | number | boolean +>toString : () => string +} +function foo8(x: number | string) { +>foo8 : (x: string | number) => number | boolean +>x : string | number + + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x === "string" +>typeof x === "string" || (x = 10) // change x - number| string || (typeof x === "number" ? x // number : x.length) : number | boolean +>typeof x === "string" || (x = 10) : number | boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | number + + || (x = 10) // change x - number| string +>(x = 10) : number +>x = 10 : number +>x : string | number + + || (typeof x === "number" +>(typeof x === "number" ? x // number : x.length) : number +>typeof x === "number" ? x // number : x.length : number +>typeof x === "number" : boolean +>typeof x : string +>x : string | number + + ? x // number +>x : number + + : x.length); // string +>x.length : number +>x : string +>length : number +} diff --git a/tests/baselines/reference/typeGuardsObjectMethods.js b/tests/baselines/reference/typeGuardsObjectMethods.js new file mode 100644 index 00000000000..3bdea2348ab --- /dev/null +++ b/tests/baselines/reference/typeGuardsObjectMethods.js @@ -0,0 +1,93 @@ +//// [typeGuardsObjectMethods.ts] + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var strOrNum: string | number; +var var1: string | number; +var obj1 = { + // Inside method + method(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + + return strOrNum; + }, + get prop() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + }, + set prop(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } +}; +// return expression of the method +strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum); + +// accessing getter property +strOrNum = typeof obj1.prop === "string" && obj1.prop; + +//// [typeGuardsObjectMethods.js] +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. +// variables in global +var num; +var strOrNum; +var var1; +var obj1 = { + // Inside method + method: function (param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + return strOrNum; + }, + get prop() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + return strOrNum; + }, + set prop(param) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + // variables in function declaration + var var2; + num = typeof var2 === "string" && var2.length; // string + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } +}; +// return expression of the method +strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum); +// accessing getter property +strOrNum = typeof obj1.prop === "string" && obj1.prop; diff --git a/tests/baselines/reference/typeGuardsObjectMethods.types b/tests/baselines/reference/typeGuardsObjectMethods.types new file mode 100644 index 00000000000..a063145ce24 --- /dev/null +++ b/tests/baselines/reference/typeGuardsObjectMethods.types @@ -0,0 +1,178 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsObjectMethods.ts === + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +>num : number + +var strOrNum: string | number; +>strOrNum : string | number + +var var1: string | number; +>var1 : string | number + +var obj1 = { +>obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>{ // Inside method method(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string return strOrNum; }, get prop() { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string return strOrNum; }, set prop(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string }} : { method: (param: string | number) => string | number; prop: string | number; } + + // Inside method + method(param: string | number) { +>method : (param: string | number) => string | number +>method(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string return strOrNum; } : (param: string | number) => string | number +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + + return strOrNum; +>strOrNum : string | number + + }, + get prop() { +>prop : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + return strOrNum; +>strOrNum : string | number + + }, + set prop(param: string | number) { +>prop : string | number +>param : string | number + + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string +>num = typeof var1 === "string" && var1.length : number +>num : number +>typeof var1 === "string" && var1.length : number +>typeof var1 === "string" : boolean +>typeof var1 : string +>var1 : string | number +>var1.length : number +>var1 : string +>length : number + + // variables in function declaration + var var2: string | number; +>var2 : string | number + + num = typeof var2 === "string" && var2.length; // string +>num = typeof var2 === "string" && var2.length : number +>num : number +>typeof var2 === "string" && var2.length : number +>typeof var2 === "string" : boolean +>typeof var2 : string +>var2 : string | number +>var2.length : number +>var2 : string +>length : number + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +>num = typeof param === "string" && param.length : number +>num : number +>typeof param === "string" && param.length : number +>typeof param === "string" : boolean +>typeof param : string +>param : string | number +>param.length : number +>param : string +>length : number + } +}; +// return expression of the method +strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum); +>strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum) : string | number +>strOrNum : string | number +>typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum) : string | number +>typeof obj1.method(strOrNum) === "string" : boolean +>typeof obj1.method(strOrNum) : string +>obj1.method(strOrNum) : string | number +>obj1.method : (param: string | number) => string | number +>obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>method : (param: string | number) => string | number +>strOrNum : string | number +>obj1.method(strOrNum) : string | number +>obj1.method : (param: string | number) => string | number +>obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>method : (param: string | number) => string | number +>strOrNum : string | number + +// accessing getter property +strOrNum = typeof obj1.prop === "string" && obj1.prop; +>strOrNum = typeof obj1.prop === "string" && obj1.prop : string | number +>strOrNum : string | number +>typeof obj1.prop === "string" && obj1.prop : string | number +>typeof obj1.prop === "string" : boolean +>typeof obj1.prop : string +>obj1.prop : string | number +>obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>prop : string | number +>obj1.prop : string | number +>obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>prop : string | number + diff --git a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt index 7d25976cb2f..99264a00351 100644 --- a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt +++ b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeIdentityConsidersBrands.ts(30,1): error TS2322: Type 'X_1' is not assignable to type 'Y_1': +tests/cases/compiler/typeIdentityConsidersBrands.ts(30,1): error TS2322: Type 'X_1' is not assignable to type 'Y_1'. Types have separate declarations of a private property 'name'. tests/cases/compiler/typeIdentityConsidersBrands.ts(31,6): error TS2345: Argument of type 'Y_1' is not assignable to parameter of type 'X_1'. @@ -35,7 +35,7 @@ tests/cases/compiler/typeIdentityConsidersBrands.ts(31,6): error TS2345: Argumen a2 = b2; // should error ~~ -!!! error TS2322: Type 'X_1' is not assignable to type 'Y_1': +!!! error TS2322: Type 'X_1' is not assignable to type 'Y_1'. !!! error TS2322: Types have separate declarations of a private property 'name'. foo2(a2); // should error ~~ diff --git a/tests/baselines/reference/typeInfer1.errors.txt b/tests/baselines/reference/typeInfer1.errors.txt index d7e54ebce27..cce736e2531 100644 --- a/tests/baselines/reference/typeInfer1.errors.txt +++ b/tests/baselines/reference/typeInfer1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeInfer1.ts(11,5): error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2': +tests/cases/compiler/typeInfer1.ts(11,5): error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. Property 'Write' is missing in type '{ Moo: () => string; }'. @@ -15,7 +15,7 @@ tests/cases/compiler/typeInfer1.ts(11,5): error TS2322: Type '{ Moo: () => strin var yyyyyyyy: ITextWriter2 = { ~~~~~~~~ -!!! error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2': +!!! error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. !!! error TS2322: Property 'Write' is missing in type '{ Moo: () => string; }'. Moo: function() { return "cow"; } } \ No newline at end of file diff --git a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt index 5f9f980e735..f275e44503a 100644 --- a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt +++ b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt @@ -1,9 +1,11 @@ -tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. ==== tests/cases/compiler/typeInferenceConflictingCandidates.ts (1 errors) ==== declare function g(a: T, b: T, c: (t: T) => T): T; g("", 3, a => a); - ~~~~~~~~~~~~~~~~ -!!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file + ~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeMatch1.errors.txt b/tests/baselines/reference/typeMatch1.errors.txt index 5921ba0a8d3..d0bcd71065e 100644 --- a/tests/baselines/reference/typeMatch1.errors.txt +++ b/tests/baselines/reference/typeMatch1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeMatch1.ts(18,1): error TS2322: Type 'D' is not assignable to type 'C': +tests/cases/compiler/typeMatch1.ts(18,1): error TS2322: Type 'D' is not assignable to type 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/typeMatch1.ts(19,1): error TS2322: Type 'typeof C' is not assignable to type 'C': +tests/cases/compiler/typeMatch1.ts(19,1): error TS2322: Type 'typeof C' is not assignable to type 'C'. Property 'x' is missing in type 'typeof C'. tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'. @@ -25,11 +25,11 @@ tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be x6 = x7; ~~ -!!! error TS2322: Type 'D' is not assignable to type 'C': +!!! error TS2322: Type 'D' is not assignable to type 'C'. !!! error TS2322: Types have separate declarations of a private property 'x'. x6=C; ~~ -!!! error TS2322: Type 'typeof C' is not assignable to type 'C': +!!! error TS2322: Type 'typeof C' is not assignable to type 'C'. !!! error TS2322: Property 'x' is missing in type 'typeof C'. C==D; ~~~~ diff --git a/tests/baselines/reference/typeMatch2.errors.txt b/tests/baselines/reference/typeMatch2.errors.txt index 0bd20bda65f..4db4828064e 100644 --- a/tests/baselines/reference/typeMatch2.errors.txt +++ b/tests/baselines/reference/typeMatch2.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/typeMatch2.ts(3,2): error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(3,2): error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }'. Property 'x' is missing in type '{}'. -tests/cases/compiler/typeMatch2.ts(4,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(4,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; }'. -tests/cases/compiler/typeMatch2.ts(6,5): error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(6,5): error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; z: number; }'. -tests/cases/compiler/typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]': - Type 'Animal' is not assignable to type 'Giraffe': +tests/cases/compiler/typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. + Type 'Animal' is not assignable to type 'Giraffe'. Property 'g' is missing in type 'Animal'. -tests/cases/compiler/typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }': - Types of property 'f2' are incompatible: - Type 'Animal[]' is not assignable to type 'Giraffe[]': +tests/cases/compiler/typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. + Types of property 'f2' are incompatible. + Type 'Animal[]' is not assignable to type 'Giraffe[]'. Type 'Animal' is not assignable to type 'Giraffe'. -tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': +tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; }'. @@ -20,16 +20,16 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is var a = { x: 1, y: 2 }; a = {}; // error ~ -!!! error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }': +!!! error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Property 'x' is missing in type '{}'. a = { x: 1 }; // error ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': +!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Property 'y' is missing in type '{ x: number; }'. a = { x: 1, y: 2, z: 3 }; a = { x: 1, z: 3 }; // error ~ -!!! error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }': +!!! error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Property 'y' is missing in type '{ x: number; z: number; }'. } @@ -44,17 +44,17 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is aa = gg; gg = aa; // error ~~ -!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]': -!!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe': +!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. +!!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe'. !!! error TS2322: Property 'g' is missing in type 'Animal'. var xa = { f1: 5, f2: aa }; var xb = { f1: 5, f2: gg }; xa = xb; // Should be ok xb = xa; // Not ok ~~ -!!! error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }': -!!! error TS2322: Types of property 'f2' are incompatible: -!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]': +!!! error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. +!!! error TS2322: Types of property 'f2' are incompatible. +!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. !!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe'. } @@ -70,7 +70,7 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is a = { x: 1, y: _any, z:1 }; a = { x: 1 }; // error ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }': +!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Property 'y' is missing in type '{ x: number; }'. var mf = function m(n) { return false; }; var zf = function z(n: number) { return true; }; diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index e941b34aaf6..64a32663875 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,32 +1,32 @@ -tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }': +tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }': +tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(11,5): error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. -tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': +tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': +tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }': +tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. Property 'z' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(15,5): error TS2323: Type 'number' is not assignable to type '(s: string) => boolean'. -tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }': +tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. +tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I': +tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'. Property 'k' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]': +tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'. Property 'length' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]': +tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. Property 'length' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]': +tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }': +tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }': +tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(23,5): error TS2323: Type 'typeof C' is not assignable to type 'number'. +tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'. ==== tests/cases/compiler/typeName1.ts (17 errors) ==== @@ -40,65 +40,65 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2323: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }': +!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. !!! error TS2322: Property 'f' is missing in type 'Number'. var x2:{ f(s:string):number; } =3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. !!! error TS2322: Property 'f' is missing in type 'Number'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. !!! error TS2322: Property 'x' is missing in type 'Number'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. !!! error TS2322: Property 'x' is missing in type 'Number'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }': +!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. !!! error TS2322: Property 'z' is missing in type 'Number'. var x7:(s:string)=>boolean=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '(s: string) => boolean'. +!!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. !!! error TS2322: Property 'z' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type 'I': +!!! error TS2322: Type 'number' is not assignable to type 'I'. !!! error TS2322: Property 'k' is missing in type 'Number'. var x10:I[][][][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]': +!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'. !!! error TS2322: Property 'length' is missing in type 'Number'. var x11:{z:I;x:boolean;}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]': +!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. !!! error TS2322: Property 'length' is missing in type 'Number'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]': +!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. !!! error TS2322: Property 'length' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. !!! error TS2322: Property 'x' is missing in type 'Number'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. !!! error TS2322: Property 'f' is missing in type 'Number'. var x15:number=C; ~~~ -!!! error TS2323: Type 'typeof C' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeOfOperator1.errors.txt b/tests/baselines/reference/typeOfOperator1.errors.txt index c703d3721db..764463a3087 100644 --- a/tests/baselines/reference/typeOfOperator1.errors.txt +++ b/tests/baselines/reference/typeOfOperator1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeOfOperator1.ts(3,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/typeOfOperator1.ts(3,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/typeOfOperator1.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/compiler/typeOfOperator1.ts(3,5): error TS2323: Type 'string' is not var y: string = typeof x; var z: number = typeof x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt index 30ff740ba44..f47266f2850 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'number' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Typ var y: (item: T) => boolean; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: +!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. !!! error TS2322: Type 'T' is not assignable to type 'number'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: +!!! error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt index 76e7960ff61..2aa8d77ba6d 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean': - Types of parameters 'item' and 'item' are incompatible: +tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. + Types of parameters 'item' and 'item' are incompatible. Type 'U' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Ty var y: (item: T) => boolean; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: +!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. !!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean': -!!! error TS2322: Types of parameters 'item' and 'item' are incompatible: +!!! error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. !!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt index 80c9a2af69c..1f126d7c00d 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T': +tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. Type 'boolean' is not assignable to type 'T'. -tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean': +tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. Type 'T' is not assignable to type 'boolean'. @@ -10,11 +10,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Ty var y: (item) => boolean; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T': +!!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. !!! error TS2322: Type 'boolean' is not assignable to type 'T'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean': +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. !!! error TS2322: Type 'T' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt index a49aad4067a..c7b19e8725c 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U': +tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T': +tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. Type 'U' is not assignable to type 'T'. @@ -10,11 +10,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Ty var y: (item) => T; x = y; // Should be an error ~ -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U': +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. !!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T': +!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. !!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt index 78edb104786..82290733a9e 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U': - Type '(item: any) => T' is not assignable to type '(item: any) => U': +tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. + Type '(item: any) => T' is not assignable to type '(item: any) => U'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T': - Type '(item: any) => U' is not assignable to type '(item: any) => T': +tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. + Type '(item: any) => U' is not assignable to type '(item: any) => T'. Type 'U' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Ty var y: () => (item) => T; x = y; // Should be an error ~ -!!! error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U': -!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U': +!!! error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. !!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T': -!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T': +!!! error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. +!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. !!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability.errors.txt b/tests/baselines/reference/typeParameterAssignability.errors.txt index 34032da1d06..0e8546097d0 100644 --- a/tests/baselines/reference/typeParameterAssignability.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(5,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts (2 errors) ==== @@ -8,8 +8,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara function foo(t: T, u: U) { t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability2.errors.txt b/tests/baselines/reference/typeParameterAssignability2.errors.txt index 8fe620cae88..b3cc924d419 100644 --- a/tests/baselines/reference/typeParameterAssignability2.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability2.errors.txt @@ -1,50 +1,50 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(5,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(9,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(10,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(10,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(13,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(14,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(15,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(17,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(18,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(20,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(21,5): error TS2323: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(15,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(17,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(18,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(20,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(21,5): error TS2322: Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(24,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(24,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(25,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(26,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(27,5): error TS2323: Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(29,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(30,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(31,5): error TS2323: Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(33,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(34,5): error TS2323: Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(35,5): error TS2323: Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(38,5): error TS2323: Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(39,5): error TS2323: Type 'U' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(25,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(26,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(27,5): error TS2322: Type 'Date' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(29,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(30,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(31,5): error TS2322: Type 'Date' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(33,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(34,5): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(35,5): error TS2322: Type 'Date' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(38,5): error TS2322: Type 'T' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(39,5): error TS2322: Type 'U' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(44,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(44,44): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(45,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(46,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(47,5): error TS2323: Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(49,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(50,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(51,5): error TS2323: Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(53,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(54,5): error TS2323: Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(55,5): error TS2323: Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(58,5): error TS2323: Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(59,5): error TS2323: Type 'U' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(45,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(46,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(47,5): error TS2322: Type 'Date' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(49,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(50,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(51,5): error TS2322: Type 'Date' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(53,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(54,5): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(55,5): error TS2322: Type 'Date' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(58,5): error TS2322: Type 'T' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(59,5): error TS2322: Type 'U' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(63,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(64,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(65,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(67,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(68,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(70,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(71,5): error TS2323: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(64,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(65,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(67,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(68,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(70,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(71,5): error TS2322: Type 'U' is not assignable to type 'V'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts (47 errors) ==== @@ -55,10 +55,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } function foo2(t: T, u: U) { @@ -66,10 +66,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } function foo3(t: T, u: U, v: V) { @@ -79,24 +79,24 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. v = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. v = u; // ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. } function foo4(t: T, u: U, v: V) { @@ -106,41 +106,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. t = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. u = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. u = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'U'. +!!! error TS2322: Type 'Date' is not assignable to type 'U'. v = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. v = new Date(); // ok ~ -!!! error TS2323: Type 'Date' is not assignable to type 'V'. +!!! error TS2322: Type 'Date' is not assignable to type 'V'. var d: Date; d = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'Date'. +!!! error TS2322: Type 'T' is not assignable to type 'Date'. d = u; // ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'Date'. +!!! error TS2322: Type 'U' is not assignable to type 'Date'. d = v; // ok } @@ -152,41 +152,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. t = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. u = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. u = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'U'. +!!! error TS2322: Type 'Date' is not assignable to type 'U'. v = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. v = new Date(); // ok ~ -!!! error TS2323: Type 'Date' is not assignable to type 'V'. +!!! error TS2322: Type 'Date' is not assignable to type 'V'. var d: Date; d = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'Date'. +!!! error TS2322: Type 'T' is not assignable to type 'Date'. d = u; // ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'Date'. +!!! error TS2322: Type 'U' is not assignable to type 'Date'. d = v; // ok } @@ -195,22 +195,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. u = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. v = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability3.errors.txt b/tests/baselines/reference/typeParameterAssignability3.errors.txt index c5152a1e3fd..7dbb24ef643 100644 --- a/tests/baselines/reference/typeParameterAssignability3.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(14,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(15,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(22,9): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(23,9): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(15,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(22,9): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts (4 errors) ==== @@ -20,10 +20,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } class C { @@ -32,9 +32,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara r = () => { this.t = this.u; // error ~~~~~~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. this.u = this.t; // error ~~~~~~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt index bb778353007..d3bc25c00b1 100644 --- a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,12): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,12): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Type 'Foo' is not assignable to type 'Foo': +tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'T' is not assignable to type 'U'. @@ -18,11 +18,11 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Typ var y: Foo; x = y; // should be an error ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. !!! error TS2322: Type 'U' is not assignable to type 'T'. return x; ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. !!! error TS2322: Type 'T' is not assignable to type 'U'. } @@ -32,11 +32,11 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Typ var y: Foo; x = y; // should be an error ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. !!! error TS2322: Type 'U' is not assignable to type 'T'. return x; ~ -!!! error TS2322: Type 'Foo' is not assignable to type 'Foo': +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. !!! error TS2322: Type 'T' is not assignable to type 'U'. } } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt b/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt index c3b552b2057..3ada2e3c375 100644 --- a/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt +++ b/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS2323: Type 'B' is not assignable to type 'A'. +tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS2322: Type 'B' is not assignable to type 'A'. ==== tests/cases/compiler/typeParameterAssignmentWithConstraints.ts (2 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS232 var b: B; a = b; // Error: Can't convert B to A ~ -!!! error TS2323: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt b/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt index c109e612913..409aa5ebfb6 100644 --- a/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt +++ b/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(1,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2323: Type 'T' is not assignable to type 'number'. +tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2322: Type 'T' is not assignable to type 'number'. ==== tests/cases/compiler/typeParameterHasSelfAsConstraint.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2323: Ty !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return x; ~ -!!! error TS2323: Type 'T' is not assignable to type 'number'. +!!! error TS2322: Type 'T' is not assignable to type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt index a1b2886911d..9860b9ac59f 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt @@ -1,21 +1,21 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(5,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(5,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(9,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(10,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(10,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(13,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(14,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(15,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(15,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(18,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(19,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(20,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(19,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(20,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(23,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(24,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(25,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(24,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(25,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(28,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(29,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(30,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(29,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(30,12): error TS2322: Type 'U' is not assignable to type 'T'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts (18 errors) ==== @@ -26,10 +26,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } function foo2(x: T, y: U): T { @@ -37,10 +37,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f = function (x: T, y: U): T { @@ -48,10 +48,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f2 = function (x: T, y: U): T { @@ -59,10 +59,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f3 = (x: T, y: U): T => { @@ -70,10 +70,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f4 = (x: T, y: U): T => { @@ -81,8 +81,8 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt index e349962121f..12b90ac8525 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt @@ -1,21 +1,21 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(4,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(7,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(8,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(7,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(8,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(16,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(17,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(16,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(17,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(22,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(25,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(26,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(25,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(26,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(31,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(34,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(35,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(34,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(35,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(40,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(43,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(44,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(43,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(44,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(49,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(52,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(53,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(52,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(53,20): error TS2322: Type 'U' is not assignable to type 'T'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts (18 errors) ==== @@ -29,10 +29,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -44,10 +44,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -59,10 +59,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = function (a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -74,10 +74,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -89,10 +89,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = (a: X, b: Y): T => { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -104,10 +104,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = (a: X, b: Y): T => { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt index 97b4754a874..983f2798554 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(4,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(4,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(5,8): error TS2304: Cannot find name 'W'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(8,16): error TS2323: Type 'W' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(8,16): error TS2322: Type 'W' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(12,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(12,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(15,8): error TS2304: Cannot find name 'W'. @@ -10,20 +10,20 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,43): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2304: Cannot find name 'X'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(22,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(23,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(22,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(23,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2304: Cannot find name 'W'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2304: Cannot find name 'Y'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(31,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(32,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(31,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(32,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(37,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,47): error TS2304: Cannot find name 'X'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,53): error TS2304: Cannot find name 'Y'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(40,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(41,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(40,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(41,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,30): error TS2304: Cannot find name 'V'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,36): error TS2304: Cannot find name 'X'. @@ -45,7 +45,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var r: T; return x; ~ -!!! error TS2323: Type 'W' is not assignable to type 'T'. +!!! error TS2322: Type 'W' is not assignable to type 'T'. } } @@ -77,10 +77,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -100,10 +100,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -119,10 +119,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = (a: X, b: Y): T => { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt b/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt index 77579ef752b..6f5e2766c8c 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2323: Type 'Object' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'. ==== tests/cases/compiler/typeParametersShouldNotBeEqual.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2323: Type x = x; // Ok x = y; // Error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. x = z; // Error ~ -!!! error TS2323: Type 'Object' is not assignable to type 'T'. +!!! error TS2322: Type 'Object' is not assignable to type 'T'. z = x; // Ok } \ No newline at end of file diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt b/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt index 7330fdb35f6..0d9375140ab 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(5,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(6,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2323: Type 'U' is not assignable to type 'V'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2323: Type 'Object' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(5,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(6,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type 'Object' is not assignable to type 'T'. ==== tests/cases/compiler/typeParametersShouldNotBeEqual2.ts (6 errors) ==== @@ -12,22 +12,22 @@ tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2323: Type x = x; // Ok x = y; // Ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. x = z; // Error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. z = x; // Error ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. y = z; // Error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. z = y; // Error ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. x = zz; // Error ~ -!!! error TS2323: Type 'Object' is not assignable to type 'T'. +!!! error TS2322: Type 'Object' is not assignable to type 'T'. zz = x; // Ok } \ No newline at end of file diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt b/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt index 04509cd14a8..5b1a8e9ae7e 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2323: Type 'Object' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'. ==== tests/cases/compiler/typeParametersShouldNotBeEqual3.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2323: Type x = x; // Ok x = y; // Ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. x = z; // Ok ~ -!!! error TS2323: Type 'Object' is not assignable to type 'T'. +!!! error TS2322: Type 'Object' is not assignable to type 'T'. z = x; // Ok } \ No newline at end of file diff --git a/tests/baselines/reference/typeofAmbientExternalModules.errors.txt b/tests/baselines/reference/typeofAmbientExternalModules.errors.txt index 8057b4f8a11..cde3247b7cd 100644 --- a/tests/baselines/reference/typeofAmbientExternalModules.errors.txt +++ b/tests/baselines/reference/typeofAmbientExternalModules.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeofAmbientExternalModules_2.ts(7,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"': +tests/cases/compiler/typeofAmbientExternalModules_2.ts(7,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. Property 'C' is missing in type 'typeof D'. -tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D': +tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. @@ -13,12 +13,12 @@ tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2322: Type var y1: typeof ext = ext; y1 = exp; ~~ -!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"': +!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. !!! error TS2322: Property 'C' is missing in type 'typeof D'. var y2: typeof exp = exp; y2 = ext; ~~ -!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D': +!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. !!! error TS2322: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. ==== tests/cases/compiler/typeofAmbientExternalModules_0.ts (0 errors) ==== export class C { foo: string; } diff --git a/tests/baselines/reference/typeofExternalModules.errors.txt b/tests/baselines/reference/typeofExternalModules.errors.txt index 3290d769226..05b56c9fe1b 100644 --- a/tests/baselines/reference/typeofExternalModules.errors.txt +++ b/tests/baselines/reference/typeofExternalModules.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeofExternalModules_core.ts(5,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"': +tests/cases/compiler/typeofExternalModules_core.ts(5,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. Property 'C' is missing in type 'typeof D'. -tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D': +tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. @@ -11,12 +11,12 @@ tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2322: Type 'typ var y1: typeof ext = ext; y1 = exp; ~~ -!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"': +!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. !!! error TS2322: Property 'C' is missing in type 'typeof D'. var y2: typeof exp = exp; y2 = ext; ~~ -!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D': +!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. !!! error TS2322: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. ==== tests/cases/compiler/typeofExternalModules_external.ts (0 errors) ==== export class C { } diff --git a/tests/baselines/reference/typeofInternalModules.errors.txt b/tests/baselines/reference/typeofInternalModules.errors.txt index e4ce2b39c58..c98456c3404 100644 --- a/tests/baselines/reference/typeofInternalModules.errors.txt +++ b/tests/baselines/reference/typeofInternalModules.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/typeofInternalModules.ts(15,16): error TS2304: Cannot find name 'importUninst'. tests/cases/compiler/typeofInternalModules.ts(17,9): error TS2304: Cannot find name 'Outer'. -tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated': +tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. Property 'C' is missing in type 'typeof Outer'. tests/cases/compiler/typeofInternalModules.ts(21,16): error TS2304: Cannot find name 'importUninst'. -tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer': +tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. Property 'instantiated' is missing in type 'typeof instantiated'. @@ -32,7 +32,7 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof var x5: typeof importInst; x5 = Outer; ~~ -!!! error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated': +!!! error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. !!! error TS2322: Property 'C' is missing in type 'typeof Outer'. x5 = Outer.instantiated; var x6: typeof importUninst; @@ -41,6 +41,6 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof var x7: typeof Outer = Outer; x7 = importInst; ~~ -!!! error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer': +!!! error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. !!! error TS2322: Property 'instantiated' is missing in type 'typeof instantiated'. \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.js b/tests/baselines/reference/typeofOperatorWithEnumType.js index 272feacf63d..900b610cef4 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.js +++ b/tests/baselines/reference/typeofOperatorWithEnumType.js @@ -44,15 +44,15 @@ var ENUM1; var ResultIsString1 = typeof ENUM; var ResultIsString2 = typeof ENUM1; // enum type expressions -var ResultIsString3 = typeof ENUM1["A"]; -var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); +var ResultIsString3 = typeof 0 /* "A" */; +var ResultIsString4 = typeof (ENUM[0] + 1 /* "B" */); // multiple typeof operators var ResultIsString5 = typeof typeof ENUM; var ResultIsString6 = typeof typeof typeof (ENUM[0] + 1 /* B */); // miss assignment operators typeof ENUM; typeof ENUM1; -typeof ENUM1["B"]; +typeof 1 /* "B" */; typeof ENUM, ENUM1; // use typeof in type query var z; diff --git a/tests/baselines/reference/typeofSimple.errors.txt b/tests/baselines/reference/typeofSimple.errors.txt index a978782d399..845a9fbbce3 100644 --- a/tests/baselines/reference/typeofSimple.errors.txt +++ b/tests/baselines/reference/typeofSimple.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeofSimple.ts(3,5): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeofSimple.ts(3,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/typeofSimple.ts(8,21): error TS2304: Cannot find name 'J'. @@ -7,7 +7,7 @@ tests/cases/compiler/typeofSimple.ts(8,21): error TS2304: Cannot find name 'J'. var v2: typeof v; var v3: string = v2; // Not assignment compatible ~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. interface I { x: T; } interface J { } diff --git a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt index ca5f6e36cea..4af38220c07 100644 --- a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt +++ b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }': +tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. @@ -9,7 +9,7 @@ tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2322: Type 'typeo var x: typeof foo0 = {}; var y: {M2: Object} = foo0; ~ -!!! error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }': +!!! error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. !!! error TS2322: Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt index 6e259a66925..010831effe8 100644 --- a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(4,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(11,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(12,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. -tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2323: Type 'Function' is not assignable to type '() => void'. +tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. @@ -17,7 +17,7 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): err var c = new C(); var r: () => void = c.constructor; ~ -!!! error TS2323: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Type 'Function' is not assignable to type '() => void'. class C2 { private constructor(x: number); diff --git a/tests/baselines/reference/typesWithPublicConstructor.errors.txt b/tests/baselines/reference/typesWithPublicConstructor.errors.txt index 562d0b255eb..a3d66c3520a 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPublicConstructor.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2323: Type 'Function' is not assignable to type '() => void'. +tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. @@ -12,7 +12,7 @@ tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): erro var c = new C(); var r: () => void = c.constructor; ~ -!!! error TS2323: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Type 'Function' is not assignable to type '() => void'. class C2 { public constructor(x: number); diff --git a/tests/baselines/reference/unionTypeInference.js b/tests/baselines/reference/unionTypeInference.js new file mode 100644 index 00000000000..bdaa340f6ea --- /dev/null +++ b/tests/baselines/reference/unionTypeInference.js @@ -0,0 +1,60 @@ +//// [unionTypeInference.ts] +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter + +function f(x: T, y: string|T): T { + return x; +} + +var a1: number; +var a1 = f(1, 2); +var a2: number; +var a2 = f(1, "hello"); +var a3: number; +var a3 = f(1, a1 || "hello"); +var a4: any; +var a4 = f(undefined, "abc"); + +function g(value: [string, T]): T { + return value[1]; +} + +var b1: boolean; +var b1 = g(["string", true]); + +function h(x: string|boolean|T): T { + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +} + +var c1: number; +var c1 = h(5); +var c2: string; +var c2 = h("abc"); + + +//// [unionTypeInference.js] +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter +function f(x, y) { + return x; +} +var a1; +var a1 = f(1, 2); +var a2; +var a2 = f(1, "hello"); +var a3; +var a3 = f(1, a1 || "hello"); +var a4; +var a4 = f(undefined, "abc"); +function g(value) { + return value[1]; +} +var b1; +var b1 = g(["string", true]); +function h(x) { + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +} +var c1; +var c1 = h(5); +var c2; +var c2 = h("abc"); diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types new file mode 100644 index 00000000000..d685fc4ec6b --- /dev/null +++ b/tests/baselines/reference/unionTypeInference.types @@ -0,0 +1,109 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts === +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter + +function f(x: T, y: string|T): T { +>f : (x: T, y: string | T) => T +>T : T +>x : T +>T : T +>y : string | T +>T : T +>T : T + + return x; +>x : T +} + +var a1: number; +>a1 : number + +var a1 = f(1, 2); +>a1 : number +>f(1, 2) : number +>f : (x: T, y: string | T) => T + +var a2: number; +>a2 : number + +var a2 = f(1, "hello"); +>a2 : number +>f(1, "hello") : number +>f : (x: T, y: string | T) => T + +var a3: number; +>a3 : number + +var a3 = f(1, a1 || "hello"); +>a3 : number +>f(1, a1 || "hello") : number +>f : (x: T, y: string | T) => T +>a1 || "hello" : string | number +>a1 : number + +var a4: any; +>a4 : any + +var a4 = f(undefined, "abc"); +>a4 : any +>f(undefined, "abc") : any +>f : (x: T, y: string | T) => T +>undefined : undefined + +function g(value: [string, T]): T { +>g : (value: [string, T]) => T +>T : T +>value : [string, T] +>T : T +>T : T + + return value[1]; +>value[1] : T +>value : [string, T] +} + +var b1: boolean; +>b1 : boolean + +var b1 = g(["string", true]); +>b1 : boolean +>g(["string", true]) : boolean +>g : (value: [string, T]) => T +>["string", true] : [string, boolean] + +function h(x: string|boolean|T): T { +>h : (x: string | boolean | T) => T +>T : T +>x : string | boolean | T +>T : T +>T : T + + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +>typeof x === "string" || typeof x === "boolean" ? undefined : x : T +>typeof x === "string" || typeof x === "boolean" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | boolean | T +>typeof x === "boolean" : boolean +>typeof x : string +>x : boolean | T +>undefined : undefined +>x : T +} + +var c1: number; +>c1 : number + +var c1 = h(5); +>c1 : number +>h(5) : number +>h : (x: string | boolean | T) => T + +var c2: string; +>c2 : string + +var c2 = h("abc"); +>c2 : string +>h("abc") : string +>h : (x: string | boolean | T) => T + diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt index 5b455a84b59..624d53f95d3 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(3,10): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(5,10): error TS2347: Untyped function calls may not accept type arguments. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(8,10): error TS2347: Untyped function calls may not accept type arguments. -tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2421: Class 'C' incorrectly implements interface 'Function': +tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2420: Class 'C' incorrectly implements interface 'Function'. Property 'apply' is missing in type 'C'. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(18,10): error TS2349: Cannot invoke an expression whose type lacks a call signature. tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(20,18): error TS2311: A class may only extend another class. @@ -29,8 +29,8 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,1): error TS2 class C implements Function { ~ -!!! error TS2421: Class 'C' incorrectly implements interface 'Function': -!!! error TS2421: Property 'apply' is missing in type 'C'. +!!! error TS2420: Class 'C' incorrectly implements interface 'Function'. +!!! error TS2420: Property 'apply' is missing in type 'C'. prototype = null; length = 1; arguments = null; diff --git a/tests/baselines/reference/voidOperatorWithEnumType.js b/tests/baselines/reference/voidOperatorWithEnumType.js index 8d20842ea7b..478ac85651b 100644 --- a/tests/baselines/reference/voidOperatorWithEnumType.js +++ b/tests/baselines/reference/voidOperatorWithEnumType.js @@ -39,13 +39,13 @@ var ENUM1; var ResultIsAny1 = void ENUM; var ResultIsAny2 = void ENUM1; // enum type expressions -var ResultIsAny3 = void ENUM1["A"]; -var ResultIsAny4 = void (ENUM[0] + ENUM1["B"]); +var ResultIsAny3 = void 0 /* "A" */; +var ResultIsAny4 = void (ENUM[0] + 1 /* "B" */); // multiple void operators var ResultIsAny5 = void void ENUM; var ResultIsAny6 = void void void (ENUM[0] + 1 /* B */); // miss assignment operators void ENUM; void ENUM1; -void ENUM1["B"]; +void 1 /* "B" */; void ENUM, ENUM1; diff --git a/tests/baselines/reference/widenToAny1.errors.txt b/tests/baselines/reference/widenToAny1.errors.txt index 940637008f4..082f93e00be 100644 --- a/tests/baselines/reference/widenToAny1.errors.txt +++ b/tests/baselines/reference/widenToAny1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/widenToAny1.ts(5,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenToAny1.ts(5,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/widenToAny1.ts (1 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/widenToAny1.ts(5,5): error TS2323: Type 'string' is not ass } var z1: number = foo1({ x: undefined, y: "def" }); // Best common type is any ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/widenToAny2.errors.txt b/tests/baselines/reference/widenToAny2.errors.txt index cdd5e53ec1a..a931c592762 100644 --- a/tests/baselines/reference/widenToAny2.errors.txt +++ b/tests/baselines/reference/widenToAny2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/widenToAny2.ts(4,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenToAny2.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/widenToAny2.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/widenToAny2.ts(4,5): error TS2323: Type 'string' is not ass } var z3:number = foo3([undefined, "def"]); // Type is any, but should be string ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index fb0c38a514e..7374bd23b77 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -2,12 +2,12 @@ tests/cases/compiler/widenedTypes.ts(2,1): error TS2358: The left-hand side of a tests/cases/compiler/widenedTypes.ts(5,1): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -tests/cases/compiler/widenedTypes.ts(11,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/widenedTypes.ts(18,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]': +tests/cases/compiler/widenedTypes.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenedTypes.ts(18,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }': - Index signatures are incompatible: +tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. + Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -32,7 +32,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: n var t = [3, (3, null)]; t[3] = ""; ~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var x: typeof undefined = 3; x = 3; @@ -41,17 +41,17 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: n var u = [3, (y = null)]; u[3] = ""; ~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var ob: { x: typeof undefined } = { x: "" }; // Highlights the difference between array literals and object literals var arr: string[] = [3, null]; // not assignable because null is not widened. BCT is {} ~~~ -!!! error TS2322: Type 'number[]' is not assignable to type 'string[]': +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. !!! error TS2322: Type 'number' is not assignable to type 'string'. var obj: { [x: string]: string; } = { x: 3, y: null }; // assignable because null is widened, and therefore BCT is any ~~~ -!!! error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }': -!!! error TS2322: Index signatures are incompatible: +!!! error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt index a0decc891df..5afc7361a23 100644 --- a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt +++ b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2322: Type 'number' is not assignable to type 'X': +tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2322: Type 'number' is not assignable to type 'X'. Property 'e' is missing in type 'Number'. -tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2323: Type 'number' is not assignable to type 'X'. +tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2322: Type 'number' is not assignable to type 'X'. ==== tests/cases/compiler/wrappedRecursiveGenericType.ts (2 errors) ==== @@ -18,8 +18,8 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2323: Type 'n x.a.val = 5; // val -> number x.a.b.val = 5; // val -> X (This should be an error) ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'X': +!!! error TS2322: Type 'number' is not assignable to type 'X'. !!! error TS2322: Property 'e' is missing in type 'Number'. x.a.b.a.val = 5; // val -> X (This should be an error) ~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'X'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'X'. \ No newline at end of file diff --git a/tests/cases/compiler/checkInfiniteExpansionTermination.ts b/tests/cases/compiler/checkInfiniteExpansionTermination.ts new file mode 100644 index 00000000000..8514ebce966 --- /dev/null +++ b/tests/cases/compiler/checkInfiniteExpansionTermination.ts @@ -0,0 +1,16 @@ +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { + n: IObservable; // Needed, must be T[] +} + +// Needed +interface ISubject extends IObservable { } + +interface Foo { x } +interface Bar { y } + +var values: IObservable; +var values2: ISubject; +values = values2; diff --git a/tests/cases/compiler/checkInfiniteExpansionTermination2.ts b/tests/cases/compiler/checkInfiniteExpansionTermination2.ts new file mode 100644 index 00000000000..f30499ba540 --- /dev/null +++ b/tests/cases/compiler/checkInfiniteExpansionTermination2.ts @@ -0,0 +1,16 @@ +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { + n: IObservable; +} +interface ISubject extends IObservable { } + +declare function combineLatest(x: IObservable[]): void; +declare function combineLatest(): void; + +function fn() { + var values: ISubject[] = []; + // Hang when using , but not + combineLatest(values); +} diff --git a/tests/cases/compiler/constEnumDeclarations.ts b/tests/cases/compiler/constEnumDeclarations.ts new file mode 100644 index 00000000000..c3c11f55aa3 --- /dev/null +++ b/tests/cases/compiler/constEnumDeclarations.ts @@ -0,0 +1,13 @@ +// @declaration: true + +const enum E { + A = 1, + B = 2, + C = A | B +} + +const enum E2 { + A = 1, + B, + C +} \ No newline at end of file diff --git a/tests/cases/compiler/constEnumErrors.ts b/tests/cases/compiler/constEnumErrors.ts new file mode 100644 index 00000000000..87e6b7ccb98 --- /dev/null +++ b/tests/cases/compiler/constEnumErrors.ts @@ -0,0 +1,43 @@ +const enum E { + A +} + +module E { + var x = 1; +} + +const enum E1 { + // illegal case + // forward reference to the element of the same enum + X = Y, + // forward reference to the element of the same enum + Y = E1.Z, + Y1 = E1["Z"] +} + +const enum E2 { + A +} + +var y0 = E2[1] +var name = "A"; +var y1 = E2[name]; + +var x = E2; +var y = [E2]; + +function foo(t: any): void { +} + +foo(E2); + +const enum NaNOrInfinity { + A = 9007199254740992, + B = A * A, + C = B * B, + D = C * C, + E = D * D, + F = E * E, // overflow + G = 1 / 0, // overflow + H = 0 / 0 // NaN +} \ No newline at end of file diff --git a/tests/cases/compiler/constEnumExternalModule.ts b/tests/cases/compiler/constEnumExternalModule.ts new file mode 100644 index 00000000000..d15240fe64d --- /dev/null +++ b/tests/cases/compiler/constEnumExternalModule.ts @@ -0,0 +1,10 @@ +//@module: amd +//@Filename: m1.ts +const enum E { + V = 100 +} + +export = E +//@Filename: m2.ts +import A = require('m1') +var v = A.V; \ No newline at end of file diff --git a/tests/cases/compiler/constEnums.ts b/tests/cases/compiler/constEnums.ts new file mode 100644 index 00000000000..72b75a3f31e --- /dev/null +++ b/tests/cases/compiler/constEnums.ts @@ -0,0 +1,151 @@ +const enum Enum1 { + A0 = 100, +} + +const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], +} + + +module A { + export module B { + export module C { + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } +} + +module A { + export module B { + export module C { + export const enum E { + V3 = A.B.C.E["V2"] & 200, + } + } + } +} + +module A1 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + } +} + +module A2 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export module C { + var x = 1 + } + } +} + +import I = A.B.C.E; +import I1 = A1.B; +import I2 = A2.B; + +function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } +} + +function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } +} + +function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } +} + + +function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1.U: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } +} + +function bar(e: A.B.C.E): number { + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/declFilePrivateMethodOverloads.ts b/tests/cases/compiler/declFilePrivateMethodOverloads.ts new file mode 100644 index 00000000000..55bebeb9c83 --- /dev/null +++ b/tests/cases/compiler/declFilePrivateMethodOverloads.ts @@ -0,0 +1,24 @@ +// @declaration: true + +interface IContext { + someMethod(); +} +class c1 { + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); + private overloadWithArityDifference(context): void { + // Function here + } +} +declare class c2 { + private overload1(context, fn); + + private overload2(context); + private overload2(context, fn); +} \ No newline at end of file diff --git a/tests/cases/compiler/elidingImportNames.ts b/tests/cases/compiler/elidingImportNames.ts new file mode 100644 index 00000000000..b5893461664 --- /dev/null +++ b/tests/cases/compiler/elidingImportNames.ts @@ -0,0 +1,15 @@ +// @module: commonjs + +// @Filename: elidingImportNames_test.ts +import a = require('elidingImportNames_main'); // alias used in typeof +var b = a; +var x: typeof a; +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +var b2 = a2; + + +// @Filename: elidingImportNames_main.ts +export var main = 10; + +// @Filename: elidingImportNames_main1.ts +export var main = 10; \ No newline at end of file diff --git a/tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts b/tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts new file mode 100644 index 00000000000..da874acf73a --- /dev/null +++ b/tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts @@ -0,0 +1,31 @@ +//@declaration: true +// double underscores +var __proto__ = 10; +var o = { + "__proto__": 0 +}; +var b = o["__proto__"]; +var o1 = { + __proto__: 0 +}; +var b1 = o1["__proto__"]; +// Triple underscores +var ___proto__ = 10; +var o2 = { + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +var o3 = { + ___proto__: 0 +}; +var b3 = o3["___proto__"]; +// One underscore +var _proto__ = 10; +var o4 = { + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +var o5 = { + _proto__: 0 +}; +var b5 = o5["_proto__"]; \ No newline at end of file diff --git a/tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts b/tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts index 5dd6383dcfc..6ff5a088df0 100644 --- a/tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts +++ b/tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts @@ -1,6 +1,6 @@ function foo(n: { x: T; y: T }, m: T) { return m; } -var x = foo({ x: 3, y: "" }, 4); // no error, x is Object, the best common type // these are all errors +var x = foo({ x: 3, y: "" }, 4); var x2 = foo({ x: 3, y: "" }, 4); var x3 = foo({ x: 3, y: "" }, 4); var x4 = foo({ x: "", y: 4 }, ""); diff --git a/tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts b/tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts index bf6007560e8..a139eb85572 100644 --- a/tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts +++ b/tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts @@ -11,11 +11,11 @@ declare function foo(arg: (x: D) => number): string; declare function foo(arg: (x: C) => any): string; declare function foo(arg: (x: B) => any): number; -var result: number = foo(x => new G(x)); // No error, returns number +var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -var result2: number = foo(x => new G(x)); // No error, returns number +var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -var result3: string = foo(x => { // returns string because the C overload is picked - var y: G; // error that C does not satisfy constraint +var result3: string = foo(x => { // x has type D + var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error return y; }); diff --git a/tests/cases/compiler/overloadsWithConstraints.ts b/tests/cases/compiler/overloadsWithConstraints.ts new file mode 100644 index 00000000000..7cf5b2b70a3 --- /dev/null +++ b/tests/cases/compiler/overloadsWithConstraints.ts @@ -0,0 +1,4 @@ +declare function f(x: T): T; +declare function f(x: T): T + +var v = f(""); \ No newline at end of file diff --git a/tests/cases/compiler/preserveConstEnums.ts b/tests/cases/compiler/preserveConstEnums.ts new file mode 100644 index 00000000000..d83c84b403d --- /dev/null +++ b/tests/cases/compiler/preserveConstEnums.ts @@ -0,0 +1,4 @@ +// @preserveConstEnums: true +const enum E { + Value = 1, Value2 = Value +} \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts new file mode 100644 index 00000000000..bc28c710eed --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, not enough parameters. +f `123qdawdrqw \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts new file mode 100644 index 00000000000..45e2581ce9c --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, not enough parameters, at EOF. +f ` \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions1.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions1.ts new file mode 100644 index 00000000000..3fa8bd95d56 --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions1.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, not enough parameters. +f `123qdawdrqw${ \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions2.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions2.ts new file mode 100644 index 00000000000..7af49303c87 --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions2.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, enough parameters. +f `123qdawdrqw${ }${ \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts new file mode 100644 index 00000000000..5333686cc2d --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, not enough parameters. +f `123qdawdrqw${ 1 }${ \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts new file mode 100644 index 00000000000..742c4695303 --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, but too many parameters. +f `123qdawdrqw${ 1 }${ }${ \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts new file mode 100644 index 00000000000..ce806d202ed --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, but too many parameters. +f `123qdawdrqw${ 1 }${ 2 }${ \ No newline at end of file diff --git a/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts new file mode 100644 index 00000000000..e73b0d70466 --- /dev/null +++ b/tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts @@ -0,0 +1,7 @@ +// @target: es6 + +function f(x: TemplateStringsArray, y: string, z: string) { +} + +// Incomplete call, not enough parameters, at EOF. +f `123qdawdrqw${ 1 }${ \ No newline at end of file diff --git a/tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts b/tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts new file mode 100644 index 00000000000..1a73b7eb430 --- /dev/null +++ b/tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts @@ -0,0 +1,11 @@ +// @target: es5 + +class TemplateStringsArray { +} + +function f(x: TemplateStringsArray, y: number, z: number) { +} + +f({}, 10, 10); + +f `abcdef${ 1234 }${ 5678 }ghijkl`; \ No newline at end of file diff --git a/tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts b/tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts new file mode 100644 index 00000000000..3b166baa5c1 --- /dev/null +++ b/tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts @@ -0,0 +1,8 @@ +// @target: es5 + +function f(x: TemplateStringsArray, y: number, z: number) { +} + +f({}, 10, 10); + +f `abcdef${ 1234 }${ 5678 }ghijkl`; \ No newline at end of file diff --git a/tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts b/tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts new file mode 100644 index 00000000000..c28026ef27d --- /dev/null +++ b/tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts @@ -0,0 +1,11 @@ +// @target: es6 + +class TemplateStringsArray { +} + +function f(x: TemplateStringsArray, y: number, z: number) { +} + +f({}, 10, 10); + +f `abcdef${ 1234 }${ 5678 }ghijkl`; \ No newline at end of file diff --git a/tests/cases/compiler/typeComparisonCaching.ts b/tests/cases/compiler/typeComparisonCaching.ts new file mode 100644 index 00000000000..b47d35c60b6 --- /dev/null +++ b/tests/cases/compiler/typeComparisonCaching.ts @@ -0,0 +1,27 @@ +// Check that we only cache results of type comparisons that are free of assumptions + +interface A { + p: C; + s: string; +} + +interface B { + p: D; + s: number; +} + +interface C { + q: A; +} + +interface D { + q: B; +} + +var a: A; +var b: B; +var c: C; +var d: D; + +a = b; +c = d; // Should not be allowed diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts new file mode 100644 index 00000000000..961544f309a --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts @@ -0,0 +1,92 @@ + + +// Generic tag with one parameter +function noParams(n: T) { } +noParams ``; + +// Generic tag with parameter which does not use type parameter +function noGenericParams(n: string[]) { } +noGenericParams ``; + +// Generic tag with multiple type parameters and only one used in parameter type annotation +function someGenerics1a(n: T, m: number) { } +someGenerics1a `${3}`; + +function someGenerics1b(n: string[], m: U) { } +someGenerics1b `${3}`; + +// Generic tag with argument of function type whose parameter is of type parameter type +function someGenerics2a(strs: string[], n: (x: T) => void) { } +someGenerics2a `${(n: string) => n}`; + +function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } +someGenerics2b `${ (n: string, x: number) => n }`; + +// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter +function someGenerics3(strs: string[], producer: () => T) { } +someGenerics3 `${() => ''}`; +someGenerics3 `${() => undefined}`; +someGenerics3 `${() => 3}`; + +// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type +function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } +someGenerics4 `${4}${ () => null }`; +someGenerics4 `${''}${ () => 3 }`; +someGenerics4 `${ null }${ null }`; + +// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type +function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } +someGenerics5 `${ 4 } ${ () => null }`; +someGenerics5 `${ '' }${ () => 3 }`; +someGenerics5 `${null}${null}`; + +// Generic tag with multiple arguments of function types that each have parameters of the same generic type +function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } +someGenerics6 `${ n => n }${ n => n}${ n => n}`; +someGenerics6 `${ n => n }${ n => n}${ n => n}`; +someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; + +// Generic tag with multiple arguments of function types that each have parameters of different generic type +function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } +someGenerics7 `${ n => n }${ n => n }${ n => n }`; +someGenerics7 `${ n => n }${ n => n }${ n => n }`; +someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; + +// Generic tag with argument of generic function type +function someGenerics8(strs: string[], n: T): T { return n; } +var x = someGenerics8 `${ someGenerics7 }`; +x `${null}${null}${null}`; + +// Generic tag with multiple parameters of generic type passed arguments with no best common type +function someGenerics9(strs: string[], a: T, b: T, c: T): T { + return null; +} +var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; +var a9a: {}; + +// Generic tag with multiple parameters of generic type passed arguments with multiple best common types +interface A91 { + x: number; + y?: string; +} +interface A92 { + x: number; + z?: Date; +} + +var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; +var a9e: {}; + +// Generic tag with multiple parameters of generic type passed arguments with a single best common type +var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; +var a9d: { x: number; }; + +// Generic tag with multiple parameters of generic type where one argument is of type 'any' +var anyVar: any; +var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; +var a: any; + +// Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' +var arr = someGenerics9 `${ [] }${ null }${ undefined }`; +var arr: any[]; + diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts new file mode 100644 index 00000000000..bc9fd75cac9 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts @@ -0,0 +1,92 @@ +//@target: es6 + +// Generic tag with one parameter +function noParams(n: T) { } +noParams ``; + +// Generic tag with parameter which does not use type parameter +function noGenericParams(n: string[]) { } +noGenericParams ``; + +// Generic tag with multiple type parameters and only one used in parameter type annotation +function someGenerics1a(n: T, m: number) { } +someGenerics1a `${3}`; + +function someGenerics1b(n: string[], m: U) { } +someGenerics1b `${3}`; + +// Generic tag with argument of function type whose parameter is of type parameter type +function someGenerics2a(strs: string[], n: (x: T) => void) { } +someGenerics2a `${(n: string) => n}`; + +function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } +someGenerics2b `${ (n: string, x: number) => n }`; + +// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter +function someGenerics3(strs: string[], producer: () => T) { } +someGenerics3 `${() => ''}`; +someGenerics3 `${() => undefined}`; +someGenerics3 `${() => 3}`; + +// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type +function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } +someGenerics4 `${4}${ () => null }`; +someGenerics4 `${''}${ () => 3 }`; +someGenerics4 `${ null }${ null }`; + +// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type +function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } +someGenerics5 `${ 4 } ${ () => null }`; +someGenerics5 `${ '' }${ () => 3 }`; +someGenerics5 `${null}${null}`; + +// Generic tag with multiple arguments of function types that each have parameters of the same generic type +function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } +someGenerics6 `${ n => n }${ n => n}${ n => n}`; +someGenerics6 `${ n => n }${ n => n}${ n => n}`; +someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; + +// Generic tag with multiple arguments of function types that each have parameters of different generic type +function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } +someGenerics7 `${ n => n }${ n => n }${ n => n }`; +someGenerics7 `${ n => n }${ n => n }${ n => n }`; +someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; + +// Generic tag with argument of generic function type +function someGenerics8(strs: string[], n: T): T { return n; } +var x = someGenerics8 `${ someGenerics7 }`; +x `${null}${null}${null}`; + +// Generic tag with multiple parameters of generic type passed arguments with no best common type +function someGenerics9(strs: string[], a: T, b: T, c: T): T { + return null; +} +var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; +var a9a: {}; + +// Generic tag with multiple parameters of generic type passed arguments with multiple best common types +interface A91 { + x: number; + y?: string; +} +interface A92 { + x: number; + z?: Date; +} + +var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; +var a9e: {}; + +// Generic tag with multiple parameters of generic type passed arguments with a single best common type +var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; +var a9d: { x: number; }; + +// Generic tag with multiple parameters of generic type where one argument is of type 'any' +var anyVar: any; +var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; +var a: any; + +// Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' +var arr = someGenerics9 `${ [] }${ null }${ undefined }`; +var arr: any[]; + diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts new file mode 100644 index 00000000000..0f5d203d60b --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts @@ -0,0 +1,32 @@ +interface I { + (stringParts: string[], ...rest: boolean[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; +} + +var f: I; + +f `abc` + +f `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`[0].member `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + +f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts new file mode 100644 index 00000000000..36dc249f672 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts @@ -0,0 +1,33 @@ +// @target: ES6 +interface I { + (stringParts: string[], ...rest: boolean[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; +} + +var f: I; + +f `abc` + +f `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`[0].member `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + +f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts new file mode 100644 index 00000000000..d96196ee26e --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts @@ -0,0 +1,14 @@ +interface I { + (strs: string[], ...subs: number[]): I; + member: { + new (s: string): { + new (n: number): { + new (): boolean; + } + } + }; +} +var f: I; + +var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; + diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts new file mode 100644 index 00000000000..d0d6604cfde --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts @@ -0,0 +1,15 @@ +// @target: ES6 +interface I { + (strs: string[], ...subs: number[]): I; + member: { + new (s: string): { + new (n: number): { + new (): boolean; + } + } + }; +} +var f: I; + +var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; + diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts new file mode 100644 index 00000000000..5b29beddd48 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts @@ -0,0 +1,21 @@ +function foo(strs: string[]): number; +function foo(strs: string[], x: number): string; +function foo(strs: string[], x: number, y: number): boolean; +function foo(strs: string[], x: number, y: string): {}; +function foo(...stuff: any[]): any { + return undefined; +} + +var a = foo([]); // number +var b = foo([], 1); // string +var c = foo([], 1, 2); // boolean +var d = foo([], 1, true); // boolean (with error) +var e = foo([], 1, "2"); // {} +var f = foo([], 1, 2, 3); // any (with error) + +var u = foo ``; // number +var v = foo `${1}`; // string +var w = foo `${1}${2}`; // boolean +var x = foo `${1}${true}`; // boolean (with error) +var y = foo `${1}${"2"}`; // {} +var z = foo `${1}${2}${3}`; // any (with error) diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts new file mode 100644 index 00000000000..f821d84fbdd --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts @@ -0,0 +1,22 @@ +//@target: es6 +function foo(strs: string[]): number; +function foo(strs: string[], x: number): string; +function foo(strs: string[], x: number, y: number): boolean; +function foo(strs: string[], x: number, y: string): {}; +function foo(...stuff: any[]): any { + return undefined; +} + +var a = foo([]); // number +var b = foo([], 1); // string +var c = foo([], 1, 2); // boolean +var d = foo([], 1, true); // boolean (with error) +var e = foo([], 1, "2"); // {} +var f = foo([], 1, 2, 3); // any (with error) + +var u = foo ``; // number +var v = foo `${1}`; // string +var w = foo `${1}${2}`; // boolean +var x = foo `${1}${true}`; // boolean (with error) +var y = foo `${1}${"2"}`; // {} +var z = foo `${1}${2}${3}`; // any (with error) diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts new file mode 100644 index 00000000000..0ed9b86128b --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts @@ -0,0 +1,18 @@ + +function foo1(strs: TemplateStringsArray, x: number): string; +function foo1(strs: string[], x: number): number; +function foo1(...stuff: any[]): any { + return undefined; +} + +var a = foo1 `${1}`; // string +var b = foo1([], 1); // number + +function foo2(strs: string[], x: number): number; +function foo2(strs: TemplateStringsArray, x: number): string; +function foo2(...stuff: any[]): any { + return undefined; +} + +var c = foo2 `${1}`; // number +var d = foo2([], 1); // number \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts new file mode 100644 index 00000000000..6c67de325e2 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts @@ -0,0 +1,18 @@ +//@target: es6 +function foo1(strs: TemplateStringsArray, x: number): string; +function foo1(strs: string[], x: number): number; +function foo1(...stuff: any[]): any { + return undefined; +} + +var a = foo1 `${1}`; // string +var b = foo1([], 1); // number + +function foo2(strs: string[], x: number): number; +function foo2(strs: TemplateStringsArray, x: number): string; +function foo2(...stuff: any[]): any { + return undefined; +} + +var c = foo2 `${1}`; // number +var d = foo2([], 1); // number \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts new file mode 100644 index 00000000000..c390e92de56 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts @@ -0,0 +1,72 @@ + +// Ambiguous call picks the first overload in declaration order +function fn1(strs: TemplateStringsArray, s: string): string; +function fn1(strs: TemplateStringsArray, n: number): number; +function fn1() { return null; } + +var s: string = fn1 `${ undefined }`; + +// No candidate overloads found +fn1 `${ {} }`; // Error + +function fn2(strs: TemplateStringsArray, s: string, n: number): number; +function fn2(strs: TemplateStringsArray, n: number, t: T): T; +function fn2() { return undefined; } + +var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed +var d2 = fn2 `${ 0 }${ undefined }`; // any + +d1.foo(); // error +d2(); // no error (typed as any) + +// Generic and non-generic overload where generic overload is the only candidate +fn2 `${ 0 }${ '' }`; // OK + +// Generic and non-generic overload where non-generic overload is the only candidate +fn2 `${ '' }${ 0 }`; // OK + +// Generic overloads with differing arity +function fn3(strs: TemplateStringsArray, n: T): string; +function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; +function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; +function fn3() { return null; } + +var s = fn3 `${ 3 }`; +var s = fn3 `${'' }${ 3 }${ '' }`; +var n = fn3 `${ 5 }${ 5 }${ 5 }`; +var n: number; + +// Generic overloads with differing arity tagging with arguments matching each overload type parameter count +var s = fn3 `${ 4 }` +var s = fn3 `${ '' }${ '' }${ '' }`; +var n = fn3 `${ '' }${ '' }${ 3 }`; + +// Generic overloads with differing arity tagging with argument count that doesn't match any overload +fn3 ``; // Error + +// Generic overloads with constraints +function fn4(strs: TemplateStringsArray, n: T, m: U); +function fn4(strs: TemplateStringsArray, n: T, m: U); +function fn4(strs: TemplateStringsArray) +function fn4() { } + +// Generic overloads with constraints tagged with types that satisfy the constraints +fn4 `${ '' }${ 3 }`; +fn4 `${ 3 }${ '' }`; +fn4 `${ 3 }${ undefined }`; +fn4 `${ '' }${ null }`; + +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +fn4 `${ null }${ null }`; // Error + +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +fn4 `${ true }${ null }`; +fn4 `${ null }${ true }`; + +// Non - generic overloads where contextual typing of function arguments has errors +function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; +function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; +function fn5() { return undefined; } +fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. +fn5 `${ (n) => n.substr(0) }`; + diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts new file mode 100644 index 00000000000..a3267e7f0ae --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts @@ -0,0 +1,72 @@ +//@target: es6 +// Ambiguous call picks the first overload in declaration order +function fn1(strs: TemplateStringsArray, s: string): string; +function fn1(strs: TemplateStringsArray, n: number): number; +function fn1() { return null; } + +var s: string = fn1 `${ undefined }`; + +// No candidate overloads found +fn1 `${ {} }`; // Error + +function fn2(strs: TemplateStringsArray, s: string, n: number): number; +function fn2(strs: TemplateStringsArray, n: number, t: T): T; +function fn2() { return undefined; } + +var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed +var d2 = fn2 `${ 0 }${ undefined }`; // any + +d1.foo(); // error +d2(); // no error (typed as any) + +// Generic and non-generic overload where generic overload is the only candidate +fn2 `${ 0 }${ '' }`; // OK + +// Generic and non-generic overload where non-generic overload is the only candidate +fn2 `${ '' }${ 0 }`; // OK + +// Generic overloads with differing arity +function fn3(strs: TemplateStringsArray, n: T): string; +function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; +function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; +function fn3() { return null; } + +var s = fn3 `${ 3 }`; +var s = fn3 `${'' }${ 3 }${ '' }`; +var n = fn3 `${ 5 }${ 5 }${ 5 }`; +var n: number; + +// Generic overloads with differing arity tagging with arguments matching each overload type parameter count +var s = fn3 `${ 4 }` +var s = fn3 `${ '' }${ '' }${ '' }`; +var n = fn3 `${ '' }${ '' }${ 3 }`; + +// Generic overloads with differing arity tagging with argument count that doesn't match any overload +fn3 ``; // Error + +// Generic overloads with constraints +function fn4(strs: TemplateStringsArray, n: T, m: U); +function fn4(strs: TemplateStringsArray, n: T, m: U); +function fn4(strs: TemplateStringsArray) +function fn4() { } + +// Generic overloads with constraints tagged with types that satisfy the constraints +fn4 `${ '' }${ 3 }`; +fn4 `${ 3 }${ '' }`; +fn4 `${ 3 }${ undefined }`; +fn4 `${ '' }${ null }`; + +// Generic overloads with constraints called with type arguments that do not satisfy the constraints +fn4 `${ null }${ null }`; // Error + +// Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints +fn4 `${ true }${ null }`; +fn4 `${ null }${ true }`; + +// Non - generic overloads where contextual typing of function arguments has errors +function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; +function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; +function fn5() { return undefined; } +fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. +fn5 `${ (n) => n.substr(0) }`; + diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts new file mode 100644 index 00000000000..08d696cb288 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts @@ -0,0 +1,25 @@ +var f: any; + +f `abc` + +f `abc${1}def${2}ghi`; + +f.g.h `abc` + +f.g.h `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAnyES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAnyES6.ts new file mode 100644 index 00000000000..de75e1679ac --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAnyES6.ts @@ -0,0 +1,25 @@ +// @target: ES6 +var f: any; +f `abc` + +f `abc${1}def${2}ghi`; + +f.g.h `abc` + +f.g.h `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts new file mode 100644 index 00000000000..9b3852c2ddb --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts @@ -0,0 +1,30 @@ +interface I { + (stringParts: string[], ...rest: number[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; +} + +var f: I; + +f `abc` + +f `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`[0].member `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts new file mode 100644 index 00000000000..0dc10820a98 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts @@ -0,0 +1,31 @@ +// @target: ES6 +interface I { + (stringParts: string[], ...rest: number[]): I; + g: I; + h: I; + member: I; + thisIsNotATag(x: string): void + [x: number]: I; +} + +var f: I; + +f `abc` + +f `abc${1}def${2}ghi`; + +f `abc`.member + +f `abc${1}def${2}ghi`.member; + +f `abc`["member"]; + +f `abc${1}def${2}ghi`["member"]; + +f `abc`[0].member `abc${1}def${2}ghi`; + +f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; + +f.thisIsNotATag(`abc`); + +f.thisIsNotATag(`abc${1}def${2}ghi`); diff --git a/tests/cases/conformance/es6/templates/templateStringInArray.ts b/tests/cases/conformance/es6/templates/templateStringInArray.ts new file mode 100644 index 00000000000..2d2e5e323b5 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInArray.ts @@ -0,0 +1 @@ +var x = [1, 2, `abc${ 123 }def`]; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInArrowFunction.ts b/tests/cases/conformance/es6/templates/templateStringInArrowFunction.ts new file mode 100644 index 00000000000..9820edb2ac3 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInArrowFunction.ts @@ -0,0 +1 @@ +var x = x => `abc${ x }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInArrowFunctionES6.ts b/tests/cases/conformance/es6/templates/templateStringInArrowFunctionES6.ts new file mode 100644 index 00000000000..066fc1c74b1 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInArrowFunctionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = x => `abc${ x }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInBinaryAddition.ts b/tests/cases/conformance/es6/templates/templateStringInBinaryAddition.ts new file mode 100644 index 00000000000..7f00313ca86 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInBinaryAddition.ts @@ -0,0 +1 @@ +var x = 10 + `abc${ 10 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInBinaryAdditionES6.ts b/tests/cases/conformance/es6/templates/templateStringInBinaryAdditionES6.ts new file mode 100644 index 00000000000..5f44e3cb9d4 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInBinaryAdditionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = 10 + `abc${ 10 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInConditional.ts b/tests/cases/conformance/es6/templates/templateStringInConditional.ts new file mode 100644 index 00000000000..aff80b60efc --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInConditional.ts @@ -0,0 +1 @@ +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInConditionalES6.ts b/tests/cases/conformance/es6/templates/templateStringInConditionalES6.ts new file mode 100644 index 00000000000..c0b800259f3 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInConditionalES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInDeleteExpression.ts b/tests/cases/conformance/es6/templates/templateStringInDeleteExpression.ts new file mode 100644 index 00000000000..f3af01582a5 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInDeleteExpression.ts @@ -0,0 +1 @@ +delete `abc${0}abc`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInDeleteExpressionES6.ts b/tests/cases/conformance/es6/templates/templateStringInDeleteExpressionES6.ts new file mode 100644 index 00000000000..cd81c11453a --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInDeleteExpressionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +delete `abc${0}abc`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInDivision.ts b/tests/cases/conformance/es6/templates/templateStringInDivision.ts new file mode 100644 index 00000000000..9650f5e2455 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInDivision.ts @@ -0,0 +1 @@ +var x = `abc${ 1 }def` / 1; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts b/tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts new file mode 100644 index 00000000000..37b8511368e --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts @@ -0,0 +1,4 @@ +var x = `abc${0}abc` === `abc` || + `abc` !== `abc${0}abc` && + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts b/tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts new file mode 100644 index 00000000000..5254474b82b --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts @@ -0,0 +1,5 @@ +// @target: ES6 +var x = `abc${0}abc` === `abc` || + `abc` !== `abc${0}abc` && + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInFunctionExpression.ts b/tests/cases/conformance/es6/templates/templateStringInFunctionExpression.ts new file mode 100644 index 00000000000..5f0c5a4c96f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInFunctionExpression.ts @@ -0,0 +1,4 @@ +var x = function y() { + `abc${ 0 }def` + return `abc${ 0 }def`; +}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInFunctionExpressionES6.ts b/tests/cases/conformance/es6/templates/templateStringInFunctionExpressionES6.ts new file mode 100644 index 00000000000..729ecbd0744 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInFunctionExpressionES6.ts @@ -0,0 +1,5 @@ +// @target: ES6 +var x = function y() { + `abc${ 0 }def` + return `abc${ 0 }def`; +}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts b/tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts new file mode 100644 index 00000000000..628ba29081b --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts @@ -0,0 +1,5 @@ +function f(`hello`); +function f(x: string); +function f(x: string) { + return x; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts b/tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts new file mode 100644 index 00000000000..03fb0a7de88 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts @@ -0,0 +1,6 @@ +// @target: ES6 +function f(`hello`); +function f(x: string); +function f(x: string) { + return x; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInInOperator.ts b/tests/cases/conformance/es6/templates/templateStringInInOperator.ts new file mode 100644 index 00000000000..cc50b275144 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInInOperator.ts @@ -0,0 +1 @@ +var x = `${ "hi" }` in { hi: 10, hello: 20}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInInOperatorES6.ts b/tests/cases/conformance/es6/templates/templateStringInInOperatorES6.ts new file mode 100644 index 00000000000..5a23a0b4e3f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInInOperatorES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `${ "hi" }` in { hi: 10, hello: 20}; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInIndexExpression.ts b/tests/cases/conformance/es6/templates/templateStringInIndexExpression.ts new file mode 100644 index 00000000000..792e92a4dc7 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInIndexExpression.ts @@ -0,0 +1 @@ +`abc${0}abc`[`0`]; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInIndexExpressionES6.ts b/tests/cases/conformance/es6/templates/templateStringInIndexExpressionES6.ts new file mode 100644 index 00000000000..6a431b3bb13 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInIndexExpressionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +`abc${0}abc`[`0`]; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInInstanceOf.ts b/tests/cases/conformance/es6/templates/templateStringInInstanceOf.ts new file mode 100644 index 00000000000..12ec4e7baf7 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInInstanceOf.ts @@ -0,0 +1 @@ +var x = `abc${ 0 }def` instanceof String; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInInstanceOfES6.ts b/tests/cases/conformance/es6/templates/templateStringInInstanceOfES6.ts new file mode 100644 index 00000000000..6afe22b74b6 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInInstanceOfES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ 0 }def` instanceof String; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInModuleName.ts b/tests/cases/conformance/es6/templates/templateStringInModuleName.ts new file mode 100644 index 00000000000..8ed5038ffbf --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInModuleName.ts @@ -0,0 +1,5 @@ +declare module `M1` { +} + +declare module `M${2}` { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts b/tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts new file mode 100644 index 00000000000..44d3999febc --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts @@ -0,0 +1,6 @@ +// @target: ES6 +declare module `M1` { +} + +declare module `M${2}` { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInModulo.ts b/tests/cases/conformance/es6/templates/templateStringInModulo.ts new file mode 100644 index 00000000000..69d7faeda75 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInModulo.ts @@ -0,0 +1 @@ +var x = 1 % `abc${ 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInModuloES6.ts b/tests/cases/conformance/es6/templates/templateStringInModuloES6.ts new file mode 100644 index 00000000000..0d05c3570ba --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInModuloES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = 1 % `abc${ 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInMultiplication.ts b/tests/cases/conformance/es6/templates/templateStringInMultiplication.ts new file mode 100644 index 00000000000..a8ba70bf102 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInMultiplication.ts @@ -0,0 +1 @@ +var x = 1 * `abc${ 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInMultiplicationES6.ts b/tests/cases/conformance/es6/templates/templateStringInMultiplicationES6.ts new file mode 100644 index 00000000000..c0ffa96d98c --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInMultiplicationES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = 1 * `abc${ 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInNewOperator.ts b/tests/cases/conformance/es6/templates/templateStringInNewOperator.ts new file mode 100644 index 00000000000..f53dd3023d2 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInNewOperator.ts @@ -0,0 +1 @@ +var x = new `abc${ 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInNewOperatorES6.ts b/tests/cases/conformance/es6/templates/templateStringInNewOperatorES6.ts new file mode 100644 index 00000000000..aad17d31ae2 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInNewOperatorES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = new `abc${ 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts b/tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts new file mode 100644 index 00000000000..e1ce34a20db --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts @@ -0,0 +1,4 @@ +var x = { + a: `abc${ 123 }def`, + `b`: 321 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts b/tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts new file mode 100644 index 00000000000..9ef032e4c88 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts @@ -0,0 +1,5 @@ +// @target: ES6 +var x = { + a: `abc${ 123 }def`, + `b`: 321 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInParentheses.ts b/tests/cases/conformance/es6/templates/templateStringInParentheses.ts new file mode 100644 index 00000000000..de5948e2bc2 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInParentheses.ts @@ -0,0 +1 @@ +var x = (`abc${0}abc`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInParenthesesES6.ts b/tests/cases/conformance/es6/templates/templateStringInParenthesesES6.ts new file mode 100644 index 00000000000..856392e7c14 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInParenthesesES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = (`abc${0}abc`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInPropertyAssignment.ts b/tests/cases/conformance/es6/templates/templateStringInPropertyAssignment.ts new file mode 100644 index 00000000000..3b362d942d9 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInPropertyAssignment.ts @@ -0,0 +1,3 @@ +var x = { + a: `abc${ 123 }def${ 456 }ghi` +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInPropertyAssignmentES6.ts b/tests/cases/conformance/es6/templates/templateStringInPropertyAssignmentES6.ts new file mode 100644 index 00000000000..6a99df5b34f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInPropertyAssignmentES6.ts @@ -0,0 +1,4 @@ +// @target: ES6 +var x = { + a: `abc${ 123 }def${ 456 }ghi` +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts b/tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts new file mode 100644 index 00000000000..c3c4ca3ecb5 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts @@ -0,0 +1,3 @@ +var x = { + `a`: 321 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts b/tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts new file mode 100644 index 00000000000..d21ab30888f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts @@ -0,0 +1,3 @@ +var x = { + `abc${ 123 }def${ 456 }ghi`: 321 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts b/tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts new file mode 100644 index 00000000000..9bb814d32cf --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts @@ -0,0 +1,4 @@ +// @target: ES6 +var x = { + `a`: 321 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts b/tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts new file mode 100644 index 00000000000..7179f217caa --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts @@ -0,0 +1,4 @@ +// @target: ES6 +var x = { + `abc${ 123 }def${ 456 }ghi`: 321 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts b/tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts new file mode 100644 index 00000000000..3b88a23c298 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts @@ -0,0 +1,6 @@ +switch (`abc${0}abc`) { + case `abc`: + case `123`: + case `abc${0}abc`: + `def${1}def`; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts b/tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts new file mode 100644 index 00000000000..c1872816ccc --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts @@ -0,0 +1,7 @@ +// @target: ES6 +switch (`abc${0}abc`) { + case `abc`: + case `123`: + case `abc${0}abc`: + `def${1}def`; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInTypeAssertion.ts b/tests/cases/conformance/es6/templates/templateStringInTypeAssertion.ts new file mode 100644 index 00000000000..b5a29156f56 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInTypeAssertion.ts @@ -0,0 +1 @@ +var x = `abc${ 123 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInTypeAssertionES6.ts b/tests/cases/conformance/es6/templates/templateStringInTypeAssertionES6.ts new file mode 100644 index 00000000000..e1fc20728a0 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInTypeAssertionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ 123 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInTypeOf.ts b/tests/cases/conformance/es6/templates/templateStringInTypeOf.ts new file mode 100644 index 00000000000..da69e86c0b7 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInTypeOf.ts @@ -0,0 +1 @@ +var x = typeof `abc${ 123 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInTypeOfES6.ts b/tests/cases/conformance/es6/templates/templateStringInTypeOfES6.ts new file mode 100644 index 00000000000..a5f96923daa --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInTypeOfES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = typeof `abc${ 123 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInUnaryPlus.ts b/tests/cases/conformance/es6/templates/templateStringInUnaryPlus.ts new file mode 100644 index 00000000000..3f9b667d51d --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInUnaryPlus.ts @@ -0,0 +1 @@ +var x = +`abc${ 123 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInUnaryPlusES6.ts b/tests/cases/conformance/es6/templates/templateStringInUnaryPlusES6.ts new file mode 100644 index 00000000000..4baba61696d --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInUnaryPlusES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = +`abc${ 123 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInWhile.ts b/tests/cases/conformance/es6/templates/templateStringInWhile.ts new file mode 100644 index 00000000000..8baeaeadc97 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInWhile.ts @@ -0,0 +1,3 @@ +while (`abc${0}abc`) { + `def${1}def`; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInWhileES6.ts b/tests/cases/conformance/es6/templates/templateStringInWhileES6.ts new file mode 100644 index 00000000000..d30cdb4ec2a --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInWhileES6.ts @@ -0,0 +1,4 @@ +// @target: ES6 +while (`abc${0}abc`) { + `def${1}def`; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts b/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts new file mode 100644 index 00000000000..4a80e452251 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts @@ -0,0 +1,4 @@ +function* gen { + // Once this is supported, the inner expression does not need to be parenthesized. + var x = yield `abc${ x }def`; +} diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedAddition.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedAddition.ts new file mode 100644 index 00000000000..73f9c6b6b84 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedAddition.ts @@ -0,0 +1 @@ +var x = `abc${ 10 + 10 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedAdditionES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedAdditionES6.ts new file mode 100644 index 00000000000..12cda7856fa --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedAdditionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ 10 + 10 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArray.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArray.ts new file mode 100644 index 00000000000..77ea762070b --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArray.ts @@ -0,0 +1 @@ +var x = `abc${ [1,2,3] }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrayES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrayES6.ts new file mode 100644 index 00000000000..2be90b5abfa --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrayES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ [1,2,3] }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunction.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunction.ts new file mode 100644 index 00000000000..8d879732c79 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunction.ts @@ -0,0 +1 @@ +var x = `abc${ x => x }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunctionES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunctionES6.ts new file mode 100644 index 00000000000..946bd41470f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunctionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ x => x }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedComments.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedComments.ts new file mode 100644 index 00000000000..2cb295bbfeb --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedComments.ts @@ -0,0 +1,12 @@ +`head${ // single line comment +10 +} +middle${ +/* Multi- + * line + * comment + */ + 20 + // closing comment +} +tail`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedCommentsES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedCommentsES6.ts new file mode 100644 index 00000000000..2cb295bbfeb --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedCommentsES6.ts @@ -0,0 +1,12 @@ +`head${ // single line comment +10 +} +middle${ +/* Multi- + * line + * comment + */ + 20 + // closing comment +} +tail`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditional.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditional.ts new file mode 100644 index 00000000000..6c70bbc9b04 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditional.ts @@ -0,0 +1 @@ +var x = `abc${ true ? false : " " }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditionalES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditionalES6.ts new file mode 100644 index 00000000000..b1366210a28 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditionalES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ true ? false : " " }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivision.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivision.ts new file mode 100644 index 00000000000..82ea537dc13 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivision.ts @@ -0,0 +1 @@ +var x = `abc${ 1 / 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivisionES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivisionES6.ts new file mode 100644 index 00000000000..04f3740e3ae --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivisionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ 1 / 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpression.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpression.ts new file mode 100644 index 00000000000..05c69d962e5 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpression.ts @@ -0,0 +1 @@ +var x = `abc${ function y() { return y; } }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpressionES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpressionES6.ts new file mode 100644 index 00000000000..3aab00817ee --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpressionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ function y() { return y; } }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperator.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperator.ts new file mode 100644 index 00000000000..0e823e0ee11 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperator.ts @@ -0,0 +1 @@ +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperatorES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperatorES6.ts new file mode 100644 index 00000000000..c678d542467 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperatorES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOf.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOf.ts new file mode 100644 index 00000000000..b8cd9ba5740 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOf.ts @@ -0,0 +1 @@ +var x = `abc${ "hello" instanceof String }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts new file mode 100644 index 00000000000..a6598788b92 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ "hello" instanceof String }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedModulo.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedModulo.ts new file mode 100644 index 00000000000..675627cb25d --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedModulo.ts @@ -0,0 +1 @@ +var x = `abc${ 1 % 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedModuloES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedModuloES6.ts new file mode 100644 index 00000000000..8b6d3ed7ef2 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedModuloES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ 1 % 1 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplication.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplication.ts new file mode 100644 index 00000000000..09a99646fc8 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplication.ts @@ -0,0 +1 @@ +var x = `abc${ 7 * 6 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplicationES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplicationES6.ts new file mode 100644 index 00000000000..1378909e1c6 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplicationES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ 7 * 6 }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperator.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperator.ts new file mode 100644 index 00000000000..0f2652f892b --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperator.ts @@ -0,0 +1 @@ +var x = `abc${ new String("Hi") }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts new file mode 100644 index 00000000000..4313531575a --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ new String("Hi") }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteral.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteral.ts new file mode 100644 index 00000000000..bfdbb3d6a34 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteral.ts @@ -0,0 +1 @@ +var x = `abc${ { x: 10, y: 20 } }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteralES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteralES6.ts new file mode 100644 index 00000000000..9927f5fe95e --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteralES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ { x: 10, y: 20 } }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateString.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateString.ts new file mode 100644 index 00000000000..4fc2778aa4f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateString.ts @@ -0,0 +1 @@ +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateStringES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateStringES6.ts new file mode 100644 index 00000000000..4f8063ab03b --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateStringES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAddition.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAddition.ts new file mode 100644 index 00000000000..90a0e3561a3 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAddition.ts @@ -0,0 +1 @@ +var x = `abc${ (10 + 10) }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts new file mode 100644 index 00000000000..9c0537b6489 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ (10 + 10) }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperator.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperator.ts new file mode 100644 index 00000000000..1a93e586bda --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperator.ts @@ -0,0 +1 @@ +var x = `abc${ typeof "hi" }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperatorES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperatorES6.ts new file mode 100644 index 00000000000..534cd667f43 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperatorES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ typeof "hi" }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlus.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlus.ts new file mode 100644 index 00000000000..f97583812e4 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlus.ts @@ -0,0 +1 @@ +var x = `abc${ +Infinity }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlusES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlusES6.ts new file mode 100644 index 00000000000..7b724dba579 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlusES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +var x = `abc${ +Infinity }def`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts new file mode 100644 index 00000000000..cbf7f272581 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts @@ -0,0 +1,4 @@ +function* gen { + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; +} diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts new file mode 100644 index 00000000000..5a7409aef79 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts @@ -0,0 +1,5 @@ +// @target: ES6 +function* gen() { + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; +} diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortions.ts b/tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortions.ts new file mode 100644 index 00000000000..11dca4caf77 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortions.ts @@ -0,0 +1,23 @@ +var a = ``; + +var b = `${ 0 }`; + +var c = `1${ 0 }`; + +var d = `${ 0 }2`; + +var e = `1${ 0 }2`; + +var f = `${ 0 }${ 0 }`; + +var g = `1${ 0 }${ 0 }`; + +var h = `${ 0 }2${ 0 }`; + +var i = `1${ 0 }2${ 0 }`; + +var j = `${ 0 }${ 0 }3`; + +var k = `1${ 0 }${ 0 }3`; + +var l = `1${ 0 }2${ 0 }3`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortionsES6.ts b/tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortionsES6.ts new file mode 100644 index 00000000000..183da57dd45 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithEmptyLiteralPortionsES6.ts @@ -0,0 +1,24 @@ +// @target: ES6 +var a = ``; + +var b = `${ 0 }`; + +var c = `1${ 0 }`; + +var d = `${ 0 }2`; + +var e = `1${ 0 }2`; + +var f = `${ 0 }${ 0 }`; + +var g = `1${ 0 }${ 0 }`; + +var h = `${ 0 }2${ 0 }`; + +var i = `1${ 0 }2${ 0 }`; + +var j = `${ 0 }${ 0 }3`; + +var k = `1${ 0 }${ 0 }3`; + +var l = `1${ 0 }2${ 0 }3`; \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts b/tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts new file mode 100644 index 00000000000..9101c8e3e6b --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts @@ -0,0 +1 @@ +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts b/tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts new file mode 100644 index 00000000000..cb7f76540cc --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithPropertyAccess.ts b/tests/cases/conformance/es6/templates/templateStringWithPropertyAccess.ts new file mode 100644 index 00000000000..87682fff572 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithPropertyAccess.ts @@ -0,0 +1 @@ +`abc${0}abc`.indexOf(`abc`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringWithPropertyAccessES6.ts b/tests/cases/conformance/es6/templates/templateStringWithPropertyAccessES6.ts new file mode 100644 index 00000000000..261ea75bde6 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringWithPropertyAccessES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +`abc${0}abc`.indexOf(`abc`); \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1AndExpr2.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1AndExpr2.ts new file mode 100644 index 00000000000..1ed8e6ebb04 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1AndExpr2.ts @@ -0,0 +1,46 @@ +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrNumOrBool: string | number | boolean; +var numOrBool: number | boolean; +class C { private p; } +var c: C; +var cOrBool: C| boolean; +var strOrNumOrBoolOrC: string | number | boolean | C; + +// A type guard of the form expr1 && expr2 +// - when true, narrows the type of x by expr1 when true and then by expr2 when true, or +// - when false, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when +// false, and T2 is the type of x narrowed by expr1 when true and then by expr2 when false. + +// (typeguard1 && typeguard2) +if (typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number") { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// (typeguard1 && typeguard2 && typeguard3) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBoolOrC !== "boolean") { + c = strOrNumOrBoolOrC; // C +} +else { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +} +// (typeguard1 && typeguard2 && typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "number" && typeof strOrNumOrBool === "boolean") { + cOrBool = strOrNumOrBoolOrC; // C | boolean + bool = strOrNumOrBool; // boolean +} +else { + var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C + var r2: string | number | boolean = strOrNumOrBool; +} +// (typeguard1) && simpleExpr +if (typeof strOrNumOrBool !== "string" && numOrBool !== strOrNumOrBool) { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + var r3: string | number | boolean = strOrNumOrBool; // string | number | boolean +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1OrExpr2.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1OrExpr2.ts new file mode 100644 index 00000000000..1d72f358284 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormExpr1OrExpr2.ts @@ -0,0 +1,46 @@ +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrNumOrBool: string | number | boolean; +var numOrBool: number | boolean; +class C { private p; } +var c: C; +var cOrBool: C| boolean; +var strOrNumOrBoolOrC: string | number | boolean | C; + +// A type guard of the form expr1 || expr2 +// - when true, narrows the type of x to T1 | T2, where T1 is the type of x narrowed by expr1 when true, +// and T2 is the type of x narrowed by expr1 when false and then by expr2 when true, or +// - when false, narrows the type of x by expr1 when false and then by expr2 when false. + +// (typeguard1 || typeguard2) +if (typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number") { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// (typeguard1 || typeguard2 || typeguard3) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBoolOrC === "boolean") { + strOrNumOrBool = strOrNumOrBoolOrC; // string | number | boolean +} +else { + c = strOrNumOrBoolOrC; // C +} +// (typeguard1 || typeguard2 || typeguard11(onAnotherType)) +if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "number" || typeof strOrNumOrBool !== "boolean") { + var r1: string | number | boolean | C = strOrNumOrBoolOrC; // string | number | boolean | C + var r2: string | number | boolean = strOrNumOrBool; +} +else { + cOrBool = strOrNumOrBoolOrC; // C | boolean + bool = strOrNumOrBool; // boolean +} +// (typeguard1) || simpleExpr +if (typeof strOrNumOrBool === "string" || numOrBool !== strOrNumOrBool) { + var r3: string | number | boolean = strOrNumOrBool; // string | number | boolean +} +else { + numOrBool = strOrNumOrBool; // number | boolean +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts new file mode 100644 index 00000000000..233909f44aa --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOf.ts @@ -0,0 +1,30 @@ +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. + +class C1 { + p1: string; +} +class C2 { + p2: number; +} +class D1 extends C1 { + p3: number; +} +var str: string; +var num: number; +var strOrNum: string | number; + +var c1Orc2: C1 | C2; +str = c1Orc2 instanceof C1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof C2 && c1Orc2.p2; // C2 +str = c1Orc2 instanceof D1 && c1Orc2.p1; // D1 +num = c1Orc2 instanceof D1 && c1Orc2.p3; // D1 + +var c2Ord1: C2 | D1; +num = c2Ord1 instanceof C2 && c2Ord1.p2; // C2 +num = c2Ord1 instanceof D1 && c2Ord1.p3; // D1 +str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1 +var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1 \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOfOnInterface.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOfOnInterface.ts new file mode 100644 index 00000000000..47e17667bcb --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormInstanceOfOnInterface.ts @@ -0,0 +1,38 @@ +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function' +// and C has a property named 'prototype' +// - when true, narrows the type of x to the type of the 'prototype' property in C provided +// it is a subtype of the type of x, or +// - when false, has no effect on the type of x. + +interface C1 { + (): C1; + prototype: C1; + p1: string; +} +interface C2 { + (): C2; + prototype: C2; + p2: number; +} +interface D1 extends C1 { + prototype: D1; + p3: number; +} +var str: string; +var num: number; +var strOrNum: string | number; + +var c1: C1; +var c2: C2; +var d1: D1; +var c1Orc2: C1 | C2; +str = c1Orc2 instanceof c1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof c2 && c1Orc2.p2; // C2 +str = c1Orc2 instanceof d1 && c1Orc2.p1; // C1 +num = c1Orc2 instanceof d1 && c1Orc2.p3; // D1 + +var c2Ord1: C2 | D1; +num = c2Ord1 instanceof c2 && c2Ord1.p2; // C2 +num = c2Ord1 instanceof d1 && c2Ord1.p3; // D1 +str = c2Ord1 instanceof d1 && c2Ord1.p1; // D1 +var r2: D1 | C2 = c2Ord1 instanceof c1 && c2Ord1; // C2 | D1 \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormNotExpr.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormNotExpr.ts new file mode 100644 index 00000000000..c9a2cb5fc0b --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormNotExpr.ts @@ -0,0 +1,53 @@ +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrNumOrBool: string | number | boolean; +var numOrBool: number | boolean; + +// A type guard of the form !expr +// - when true, narrows the type of x by expr when false, or +// - when false, narrows the type of x by expr when true. + +// !typeguard1 +if (!(typeof strOrNum === "string")) { + num === strOrNum; // number +} +else { + str = strOrNum; // string +} +// !(typeguard1 || typeguard2) +if (!(typeof strOrNumOrBool === "string" || typeof strOrNumOrBool === "number")) { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// !(typeguard1) || !(typeguard2) +if (!(typeof strOrNumOrBool !== "string") || !(typeof strOrNumOrBool !== "number")) { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// !(typeguard1 && typeguard2) +if (!(typeof strOrNumOrBool !== "string" && typeof strOrNumOrBool !== "number")) { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +// !(typeguard1) && !(typeguard2) +if (!(typeof strOrNumOrBool === "string") && !(typeof strOrNumOrBool === "number")) { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +// !(typeguard1) && simpleExpr +if (!(typeof strOrNumOrBool === "string") && numOrBool !== strOrNumOrBool) { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + var r1: string | number | boolean = strOrNumOrBool; // string | number | boolean +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfBoolean.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfBoolean.ts new file mode 100644 index 00000000000..fb699ce8ce0 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfBoolean.ts @@ -0,0 +1,87 @@ +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrBool === "boolean") { + bool = strOrBool; // boolean +} +else { + str = strOrBool; // string +} +if (typeof numOrBool === "boolean") { + bool = numOrBool; // boolean +} +else { + num = numOrBool; // number +} +if (typeof strOrNumOrBool === "boolean") { + bool = strOrNumOrBool; // boolean +} +else { + strOrNum = strOrNumOrBool; // string | number +} +if (typeof boolOrC === "boolean") { + bool = boolOrC; // boolean +} +else { + c = boolOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum === "boolean") { + var z1: string | number = strOrNum; // string | number +} +else { + var z2: string | number = strOrNum; // string | number +} + + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrBool !== "boolean") { + str = strOrBool; // string +} +else { + bool = strOrBool; // boolean +} +if (typeof numOrBool !== "boolean") { + num = numOrBool; // number +} +else { + bool = numOrBool; // boolean +} +if (typeof strOrNumOrBool !== "boolean") { + strOrNum = strOrNumOrBool; // string | number +} +else { + bool = strOrNumOrBool; // boolean +} +if (typeof boolOrC !== "boolean") { + c = boolOrC; // C +} +else { + bool = boolOrC; // boolean +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNum !== "boolean") { + var z1: string | number = strOrNum; // string | number +} +else { + var z2: string | number = strOrNum; // string | number +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts new file mode 100644 index 00000000000..03d650ad626 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts @@ -0,0 +1,35 @@ +class C { private p: string }; + +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrC: string | C; + +// typeof x == s has not effect on typeguard +if (typeof strOrNum == "string") { + var r1 = strOrNum; // string | number +} +else { + var r1 = strOrNum; // string | number +} + +if (typeof strOrBool == "boolean") { + var r2 = strOrBool; // string | boolean +} +else { + var r2 = strOrBool; // string | boolean +} + +if (typeof numOrBool == "number") { + var r3 = numOrBool; // number | boolean +} +else { + var r3 = numOrBool; // number | boolean +} + +if (typeof strOrC == "Object") { + var r4 = strOrC; // string | C +} +else { + var r4 = strOrC; // string | C +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts new file mode 100644 index 00000000000..19d5495fcbb --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts @@ -0,0 +1,35 @@ +class C { private p: string }; + +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrC: string | C; + +// typeof x != s has not effect on typeguard +if (typeof strOrNum != "string") { + var r1 = strOrNum; // string | number +} +else { + var r1 = strOrNum; // string | number +} + +if (typeof strOrBool != "boolean") { + var r2 = strOrBool; // string | boolean +} +else { + var r2 = strOrBool; // string | boolean +} + +if (typeof numOrBool != "number") { + var r3 = numOrBool; // number | boolean +} +else { + var r3 = numOrBool; // number | boolean +} + +if (typeof strOrC != "Object") { + var r4 = strOrC; // string | C +} +else { + var r4 = strOrC; // string | C +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNumber.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNumber.ts new file mode 100644 index 00000000000..2868b114077 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNumber.ts @@ -0,0 +1,86 @@ +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "number") { + num = strOrNum; // number +} +else { + str === strOrNum; // string +} +if (typeof numOrBool === "number") { + num = numOrBool; // number +} +else { + var x: number | boolean = numOrBool; // number | boolean +} +if (typeof strOrNumOrBool === "number") { + num = strOrNumOrBool; // number +} +else { + strOrBool = strOrNumOrBool; // string | boolean +} +if (typeof numOrC === "number") { + num = numOrC; // number +} +else { + c = numOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool === "number") { + var y1: string | boolean = strOrBool; // string | boolean +} +else { + var y2: string | boolean = strOrBool; // string | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "number") { + str === strOrNum; // string +} +else { + num = strOrNum; // number +} +if (typeof numOrBool !== "number") { + var x: number | boolean = numOrBool; // number | boolean +} +else { + num = numOrBool; // number +} +if (typeof strOrNumOrBool !== "number") { + strOrBool = strOrNumOrBool; // string | boolean +} +else { + num = strOrNumOrBool; // number +} +if (typeof numOrC !== "number") { + c = numOrC; // C +} +else { + num = numOrC; // number +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrBool !== "number") { + var y1: string | boolean = strOrBool; // string | boolean +} +else { + var y2: string | boolean = strOrBool; // string | boolean +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts new file mode 100644 index 00000000000..9d7d555fc18 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfOther.ts @@ -0,0 +1,76 @@ +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var emptyObj: {}; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with any value but 'string', 'number' or 'boolean', +// - when true, removes the primitive types string, number, and boolean from the type of x, or +// - when false, has no effect on the type of x. + +if (typeof strOrC === "Object") { + c = strOrC; // C +} +else { + var r2: string | C = strOrC; // string | C +} +if (typeof numOrC === "Object") { + c = numOrC; // C +} +else { + var r3: number | C = numOrC; // number | C +} +if (typeof boolOrC === "Object") { + c = boolOrC; // C +} +else { + var r4: boolean | C = boolOrC; // boolean | C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool === "Object") { + var q1: string | number | boolean = strOrNumOrBool; // string | number | boolean +} +else { + var q2: string | number | boolean = strOrNumOrBool; // string | number | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrC !== "Object") { + var r2: string | C = strOrC; // string | C +} +else { + c = strOrC; // C +} +if (typeof numOrC !== "Object") { + var r3: number | C = numOrC; // number | C +} +else { + c = numOrC; // C +} +if (typeof boolOrC !== "Object") { + var r4: boolean | C = boolOrC; // boolean | C +} +else { + c = boolOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof strOrNumOrBool !== "Object") { + var q1: string | number | boolean = strOrNumOrBool; // string | number | boolean +} +else { + var q2: string | number | boolean = strOrNumOrBool; // string | number | boolean +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfString.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfString.ts new file mode 100644 index 00000000000..a356858e6c8 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfString.ts @@ -0,0 +1,86 @@ +class C { private p: string }; + +var str: string; +var bool: boolean; +var num: number; +var strOrNum: string | number; +var strOrBool: string | boolean; +var numOrBool: number | boolean +var strOrNumOrBool: string | number | boolean; +var strOrC: string | C; +var numOrC: number | C; +var boolOrC: boolean | C; +var c: C; + +// A type guard of the form typeof x === s, +// where s is a string literal with the value 'string', 'number', or 'boolean', +// - when true, narrows the type of x to the given primitive type, or +// - when false, removes the primitive type from the type of x. +if (typeof strOrNum === "string") { + str = strOrNum; // string +} +else { + num === strOrNum; // number +} +if (typeof strOrBool === "string") { + str = strOrBool; // string +} +else { + bool = strOrBool; // boolean +} +if (typeof strOrNumOrBool === "string") { + str = strOrNumOrBool; // string +} +else { + numOrBool = strOrNumOrBool; // number | boolean +} +if (typeof strOrC === "string") { + str = strOrC; // string +} +else { + c = strOrC; // C +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool === "string") { + var x1: number | boolean = numOrBool; // number | boolean +} +else { + var x2: number | boolean = numOrBool; // number | boolean +} + +// A type guard of the form typeof x !== s, where s is a string literal, +// - when true, narrows the type of x by typeof x === s when false, or +// - when false, narrows the type of x by typeof x === s when true. +if (typeof strOrNum !== "string") { + num === strOrNum; // number +} +else { + str = strOrNum; // string +} +if (typeof strOrBool !== "string") { + bool = strOrBool; // boolean +} +else { + str = strOrBool; // string +} +if (typeof strOrNumOrBool !== "string") { + numOrBool = strOrNumOrBool; // number | boolean +} +else { + str = strOrNumOrBool; // string +} +if (typeof strOrC !== "string") { + c = strOrC; // C +} +else { + str = strOrC; // string +} + +// Narrowing occurs only if target type is a subtype of variable type +if (typeof numOrBool !== "string") { + var x1: number | boolean = numOrBool; // number | boolean +} +else { + var x2: number | boolean = numOrBool; // number | boolean +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsDefeat.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsDefeat.ts new file mode 100644 index 00000000000..0d4fbbc96f1 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsDefeat.ts @@ -0,0 +1,36 @@ +// Also note that it is possible to defeat a type guard by calling a function that changes the +// type of the guarded variable. +function foo(x: number | string) { + function f() { + x = 10; + } + if (typeof x === "string") { + f(); + return x.length; // string + } + else { + return x++; // number + } +} +function foo2(x: number | string) { + if (typeof x === "string") { + return x.length; // string + } + else { + var f = function () { + return x * x; + }; + } + x = "hello"; + f(); +} +function foo3(x: number | string) { + if (typeof x === "string") { + return x.length; // string + } + else { + var f = () => x * x; + } + x = "hello"; + f(); +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassAccessors.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassAccessors.ts new file mode 100644 index 00000000000..04b9a6a394e --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassAccessors.ts @@ -0,0 +1,103 @@ +//@target: es5 + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var strOrNum: string | number; +var var1: string | number; +class ClassWithAccessors { + // Inside public accessor getter + get p1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside public accessor setter + set p1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } + // Inside private accessor getter + private get pp1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside private accessor setter + private set pp1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } + // Inside static accessor getter + static get s1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside static accessor setter + static set s1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } + // Inside private static accessor getter + private static get ss1() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + } + // Inside private static accessor setter + private static set ss1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // parameter of function declaration + num = typeof param === "string" && param.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + } +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassMethods.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassMethods.ts new file mode 100644 index 00000000000..cb1327027c5 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInClassMethods.ts @@ -0,0 +1,67 @@ +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var var1: string | number; +class C1 { + constructor(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + private p1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + p2(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + private static s1(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } + // Inside function declaration + static s2(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInConditionalExpression.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInConditionalExpression.ts new file mode 100644 index 00000000000..1633c80ab67 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInConditionalExpression.ts @@ -0,0 +1,97 @@ +// In the true expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when true, +// provided the true expression contains no assignments to the variable or parameter. +// In the false expression of a conditional expression, +// the type of a variable or parameter is narrowed by any type guard in the condition when false, +// provided the false expression contains no assignments to the variable or parameter. + +function foo(x: number | string) { + return typeof x === "string" + ? x.length // string + : x++; // number +} +function foo2(x: number | string) { + // x is assigned in the if true branch, the type is not narrowed + return typeof x === "string" + ? (x = 10 && x)// string | number + : x; // string | number +} +function foo3(x: number | string) { + // x is assigned in the if false branch, the type is not narrowed + // even though assigned using same type as narrowed expression + return typeof x === "string" + ? (x = "Hello" && x) // string | number + : x; // string | number +} +function foo4(x: number | string) { + // false branch updates the variable - so here it is not number + // even though assigned using same type as narrowed expression + return typeof x === "string" + ? x // string | number + : (x = 10 && x); // string | number +} +function foo5(x: number | string) { + // false branch updates the variable - so here it is not number + return typeof x === "string" + ? x // string | number + : (x = "hello" && x); // string | number +} +function foo6(x: number | string) { + // Modify in both branches + return typeof x === "string" + ? (x = 10 && x) // string | number + : (x = "hello" && x); // string | number +} +function foo7(x: number | string | boolean) { + return typeof x === "string" + ? x === "hello" // string + : typeof x === "boolean" + ? x // boolean + : x == 10; // number +} +function foo8(x: number | string | boolean) { + var b: number | boolean; + return typeof x === "string" + ? x === "hello" + : ((b = x) && // number | boolean + (typeof x === "boolean" + ? x // boolean + : x == 10)); // number +} +function foo9(x: number | string) { + var y = 10; + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + return typeof x === "string" + ? ((y = x.length) && x === "hello") // string + : x === 10; // number +} +function foo10(x: number | string | boolean) { + // Mixing typeguards + var b: boolean | number; + return typeof x === "string" + ? x // string + : ((b = x) // x is number | boolean + && typeof x === "number" + && x.toString()); // x is number +} +function foo11(x: number | string | boolean) { + // Mixing typeguards + // Assigning value to x deep inside another guard stops narrowing of type too + var b: number | boolean | string; + return typeof x === "string" + ? x // number | boolean | string - changed in the false branch + : ((b = x) // x is number | boolean | string - because the assignment changed it + && typeof x === "number" + && (x = 10) // assignment to x + && x); // x is number | boolean | string +} +function foo12(x: number | string | boolean) { + // Mixing typeguards + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + var b: number | boolean | string; + return typeof x === "string" + ? (x = 10 && x.toString().length) // number | boolean | string - changed here + : ((b = x) // x is number | boolean | string - changed in true branch + && typeof x === "number" + && x); // x is number +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInExternalModule.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInExternalModule.ts new file mode 100644 index 00000000000..aa41a93f4ed --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInExternalModule.ts @@ -0,0 +1,24 @@ +//@module: commonjs +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// local variable in external module +var num: number; +var var1: string | number; +if (typeof var1 === "string") { + num = var1.length; // string +} +else { + num = var1; // number +} + +// exported variable in external module +var strOrNum: string | number; +export var var2: string | number; +if (typeof var2 === "string") { + // export makes the var property and not variable + strOrNum = var2; // string | number +} +else { + strOrNum = var2; // number | string +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunction.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunction.ts new file mode 100644 index 00000000000..a374a248071 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunction.ts @@ -0,0 +1,87 @@ +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var var1: string | number; +// Inside function declaration +function f(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string +} +// local function declaration +function f1(param: string | number) { + var var2: string | number; + function f2(param1: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + + // local + var var3: string | number; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + } +} +// Function expression +function f2(param: string | number) { + // variables in function declaration + var var2: string | number; + // variables in function expressions + var r = function (param1: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + + // local + var var3: string | number; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + } (param); +} +// Arrow expression +function f3(param: string | number) { + // variables in function declaration + var var2: string | number; + // variables in function expressions + var r = ((param1: string | number) => { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables from outer function declaration + num = typeof var2 === "string" && var2.length; // string + + // parameters in outer declaration + num = typeof param === "string" && param.length; // string + + // local + var var3: string | number; + num = typeof var3 === "string" && var3.length; // string + num = typeof param1 === "string" && param1.length; // string + })(param); +} +// Return type of function +// Inside function declaration +var strOrNum: string | number; +function f4() { + var var2: string | number = strOrNum; + return var2; +} +strOrNum = typeof f4() === "string" && f4(); // string | number \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts new file mode 100644 index 00000000000..ec23b75b590 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInFunctionAndModuleBlock.ts @@ -0,0 +1,79 @@ +// typeguards are scoped in function/module block + +function foo(x: number | string | boolean) { + return typeof x === "string" + ? x + : function f() { + var b = x; // number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } (); +} +function foo2(x: number | string | boolean) { + return typeof x === "string" + ? x + : function f(a: number | boolean) { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } (x); // x here is narrowed to number | boolean +} +function foo3(x: number | string | boolean) { + return typeof x === "string" + ? x + : (() => { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(); +} +function foo4(x: number | string | boolean) { + return typeof x === "string" + ? x + : ((a: number | boolean) => { + var b = x; // new scope - number | boolean + return typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + })(x); // x here is narrowed to number | boolean +} +// Type guards affect nested function expressions, but not nested function declarations +function foo5(x: number | string | boolean) { + if (typeof x === "string") { + var y = x; // string; + function foo() { + var z = x; // number | string | boolean, type guard has no effect + } + } +} +module m { + var x: number | string | boolean; + module m2 { + var b = x; // new scope - number | boolean | string + var y: string; + if (typeof x === "string") { + y = x // string; + } else { + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } + } +} +module m1 { + var x: number | string | boolean; + module m2.m3 { + var b = x; // new scope - number | boolean | string + var y: string; + if (typeof x === "string") { + y = x // string; + } else { + y = typeof x === "boolean" + ? x.toString() // boolean + : x.toString(); // number + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInGlobal.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInGlobal.ts new file mode 100644 index 00000000000..329442751df --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInGlobal.ts @@ -0,0 +1,12 @@ +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var var1: string | number; +if (typeof var1 === "string") { + num = var1.length; // string +} +else { + num = var1; // number +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts new file mode 100644 index 00000000000..1b1e3cfab6c --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts @@ -0,0 +1,148 @@ +// In the true branch statement of an ‘if’ statement, +// the type of a variable or parameter is narrowed by any type guard in the ‘if’ condition when true, +// provided the true branch statement contains no assignments to the variable or parameter. +// In the false branch statement of an ‘if’ statement, +// the type of a variable or parameter is narrowed by any type guard in the ‘if’ condition when false, +// provided the false branch statement contains no assignments to the variable or parameter +function foo(x: number | string) { + if (typeof x === "string") { + return x.length; // string + } + else { + return x++; // number + } +} +function foo2(x: number | string) { + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { + x = 10; + return x; // string | number + } + else { + return x; // string | number + } +} +function foo3(x: number | string) { + // x is assigned in the if true branch, the type is not narrowed + if (typeof x === "string") { + x = "Hello"; // even though assigned using same type as narrowed expression + return x; // string | number + } + else { + return x; // string | number + } +} +function foo4(x: number | string) { + // false branch updates the variable - so here it is not number + if (typeof x === "string") { + return x; // string | number + } + else { + x = 10; // even though assigned number - this should result in x to be string | number + return x; // string | number + } +} +function foo5(x: number | string) { + // false branch updates the variable - so here it is not number + if (typeof x === "string") { + return x; // string | number + } + else { + x = "hello"; + return x; // string | number + } +} +function foo6(x: number | string) { + // Modify in both branches + if (typeof x === "string") { + x = 10; + return x; // string | number + } + else { + x = "hello"; + return x; // string | number + } +} +function foo7(x: number | string | boolean) { + if (typeof x === "string") { + return x === "hello"; // string + } + else if (typeof x === "boolean") { + return x; // boolean + } + else { + return x == 10; // number + } +} +function foo8(x: number | string | boolean) { + if (typeof x === "string") { + return x === "hello"; // string + } + else { + var b: number | boolean = x; // number | boolean + if (typeof x === "boolean") { + return x; // boolean + } + else { + return x == 10; // number + } + } +} +function foo9(x: number | string) { + var y = 10; + if (typeof x === "string") { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + y = x.length; + return x === "hello"; // string + } + else { + return x == 10; // number + } +} +function foo10(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + if (typeof x === "string") { + return x === "hello"; // string + } + else { + var y: boolean | string; + var b = x; // number | boolean + return typeof x === "number" + ? x === 10 // number + : x; // x should be boolean + } +} +function foo11(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x deep inside another guard stops narrowing of type too + if (typeof x === "string") { + return x; // string | number | boolean - x changed in else branch + } + else { + var y: number| boolean | string; + var b = x; // number | boolean | string - because below we are changing value of x in if statement + return typeof x === "number" + ? ( + // change value of x + x = 10 && x.toString() // number | boolean | string + ) + : ( + // do not change value + y = x && x.toString() // number | boolean | string + ); + } +} +function foo12(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + if (typeof x === "string") { + return x.toString(); // string | number | boolean - x changed in else branch + } + else { + x = 10; + var b = x; // number | boolean | string + return typeof x === "number" + ? x.toString() // number + : x.toString(); // boolean | string + } +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInModule.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInModule.ts new file mode 100644 index 00000000000..fd5f432ebdb --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInModule.ts @@ -0,0 +1,86 @@ +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var strOrNum: string | number; +var var1: string | number; +// Inside module +module m1 { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in module declaration + var var2: string | number; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + + // exported variable in the module + export var var3: string | number; + if (typeof var3 === "string") { + strOrNum = var3; // string | number + } + else { + strOrNum = var3; // string | number + } +} +// local module +module m2 { + var var2: string | number; + export var var3: string | number; + module m3 { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // local variables from outer module declaration + num = typeof var2 === "string" && var2.length; // string + + // exported variable from outer the module + strOrNum = typeof var3 === "string" && var3; // string | number + + // variables in module declaration + var var4: string | number; + if (typeof var4 === "string") { + num = var4.length; // string + } + else { + num = var4; // number + } + + // exported variable in the module + export var var5: string | number; + if (typeof var5 === "string") { + strOrNum = var5; // string | number + } + else { + strOrNum = var5; // string | number + } + } +} +// Dotted module +module m3.m4 { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in module declaration + var var2: string | number; + if (typeof var2 === "string") { + num = var2.length; // string + } + else { + num = var2; // number + } + + // exported variable in the module + export var var3: string | number; + if (typeof var3 === "string") { + strOrNum = var3; // string | number + } + else { + strOrNum = var3; // string | number + } +} diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInProperties.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInProperties.ts new file mode 100644 index 00000000000..bffe8d3d1b8 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInProperties.ts @@ -0,0 +1,27 @@ +//@target: es5 + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +var num: number; +var strOrNum: string | number; +class C1 { + private pp1: string | number; + pp2: string | number; + // Inside public accessor getter + get pp3() { + return strOrNum; + } + method() { + strOrNum = typeof this.pp1 === "string" && this.pp1; // string | number + strOrNum = typeof this.pp2 === "string" && this.pp2; // string | number + strOrNum = typeof this.pp3 === "string" && this.pp3; // string | number + } +} +var c1: C1; +strOrNum = typeof c1.pp2 === "string" && c1.pp2; // string | number +strOrNum = typeof c1.pp3 === "string" && c1.pp3; // string | number +var obj1: { + x: string | number; +}; +strOrNum = typeof obj1.x === "string" && obj1.x; // string | number \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfAndAndOperator.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfAndAndOperator.ts new file mode 100644 index 00000000000..da0d8ce24b5 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfAndAndOperator.ts @@ -0,0 +1,55 @@ +// In the right operand of a && operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when true, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x: number | string) { + return typeof x === "string" && x.length === 10; // string +} +function foo2(x: number | string) { + // modify x in right hand operand + return typeof x === "string" && ((x = 10) && x); // string | number +} +function foo3(x: number | string) { + // modify x in right hand operand with string type itself + return typeof x === "string" && ((x = "hello") && x); // string | number +} +function foo4(x: number | string | boolean) { + return typeof x !== "string" // string | number | boolean + && typeof x !== "number" // number | boolean + && x; // boolean +} +function foo5(x: number | string | boolean) { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b: number | boolean; + return typeof x !== "string" // string | number | boolean + && ((b = x) && (typeof x !== "number" // number | boolean + && x)); // boolean +} +function foo6(x: number | string | boolean) { + // Mixing typeguard narrowing in if statement with conditional expression typeguard + return typeof x !== "string" // string | number | boolean + && (typeof x !== "number" // number | boolean + ? x // boolean + : x === 10) // number +} +function foo7(x: number | string | boolean) { + var y: number| boolean | string; + var z: number| boolean | string; + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x !== "string" + && ((z = x) // string | number | boolean - x changed deeper in conditional expression + && (typeof x === "number" + // change value of x + ? (x = 10 && x.toString()) // number | boolean | string + // do not change value + : (y = x && x.toString()))); // number | boolean | string +} +function foo8(x: number | string) { + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x !== "string" + && (x = 10) // change x - number| string + && (typeof x === "number" + ? x // number + : x.length); // string +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfOrOrOperator.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfOrOrOperator.ts new file mode 100644 index 00000000000..867dc143a85 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsInRightOperandOfOrOrOperator.ts @@ -0,0 +1,55 @@ +// In the right operand of a || operation, +// the type of a variable or parameter is narrowed by any type guard in the left operand when false, +// provided the right operand contains no assignments to the variable or parameter. +function foo(x: number | string) { + return typeof x !== "string" || x.length === 10; // string +} +function foo2(x: number | string) { + // modify x in right hand operand + return typeof x !== "string" || ((x = 10) || x); // string | number +} +function foo3(x: number | string) { + // modify x in right hand operand with string type itself + return typeof x !== "string" || ((x = "hello") || x); // string | number +} +function foo4(x: number | string | boolean) { + return typeof x === "string" // string | number | boolean + || typeof x === "number" // number | boolean + || x; // boolean +} +function foo5(x: number | string | boolean) { + // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop + var b: number | boolean; + return typeof x === "string" // string | number | boolean + || ((b = x) || (typeof x === "number" // number | boolean + || x)); // boolean +} +function foo6(x: number | string | boolean) { + // Mixing typeguard + return typeof x === "string" // string | number | boolean + || (typeof x !== "number" // number | boolean + ? x // boolean + : x === 10) // number +} +function foo7(x: number | string | boolean) { + var y: number| boolean | string; + var z: number| boolean | string; + // Mixing typeguard narrowing + // Assigning value to x deep inside another guard stops narrowing of type too + return typeof x === "string" + || ((z = x) // string | number | boolean - x changed deeper in conditional expression + || (typeof x === "number" + // change value of x + ? (x = 10 && x.toString()) // number | boolean | string + // do not change value + : (y = x && x.toString()))); // number | boolean | string +} +function foo8(x: number | string) { + // Mixing typeguard + // Assigning value to x in outer guard shouldn't stop narrowing in the inner expression + return typeof x === "string" + || (x = 10) // change x - number| string + || (typeof x === "number" + ? x // number + : x.length); // string +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/typeGuards/typeGuardsObjectMethods.ts b/tests/cases/conformance/expressions/typeGuards/typeGuardsObjectMethods.ts new file mode 100644 index 00000000000..bbf68189058 --- /dev/null +++ b/tests/cases/conformance/expressions/typeGuards/typeGuardsObjectMethods.ts @@ -0,0 +1,51 @@ +//@target: es5 + +// Note that type guards affect types of variables and parameters only and +// have no effect on members of objects such as properties. + +// variables in global +var num: number; +var strOrNum: string | number; +var var1: string | number; +var obj1 = { + // Inside method + method(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + + return strOrNum; + }, + get prop() { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + return strOrNum; + }, + set prop(param: string | number) { + // global vars in function declaration + num = typeof var1 === "string" && var1.length; // string + + // variables in function declaration + var var2: string | number; + num = typeof var2 === "string" && var2.length; // string + + // parameters in function declaration + num = typeof param === "string" && param.length; // string + } +}; +// return expression of the method +strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum); + +// accessing getter property +strOrNum = typeof obj1.prop === "string" && obj1.prop; \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts b/tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts new file mode 100644 index 00000000000..049a0101f5d --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts @@ -0,0 +1,41 @@ +// It is an error for the type specified in a type alias to depend on that type alias + +// A type alias directly depends on the type it aliases. +type T0 = T0 +type T0_1 = T0_2 +type T0_2 = T0_3 +type T0_3 = T0_1 + +// A type reference directly depends on the referenced type and each of the type arguments, if any. +interface I {} +type T1 = I + +// A union type directly depends on each of the constituent types. +type T2 = T2 | string +class C {} +type T2_1 = T2_1[] | number + +// An array type directly depends on its element type. +type T3 = T3[] + +// A tuple type directly depends on each of its element types. +type T4 = [number, T4] + +// A type query directly depends on the type of the referenced entity. +var x: T5[] = [] +type T5 = typeof x + +class C1 {} +type T6 = T7 | number +type T7 = typeof yy +var yy: [string, T8[]]; +type T8 = C + +// legal cases +type T9 = () => T9 +type T10 = { x: T10 } | { new(v: T10): string } +type T11 = T12[] +type T12 = [T13, string] +type T13 = typeof zz +var zz: { x: T11 } + diff --git a/tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts b/tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts new file mode 100644 index 00000000000..3b115573830 --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts @@ -0,0 +1,6 @@ +interface I {} +type any = I; +type number = I; +type boolean = I; +type string = I; +type void = I; \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/typeAliases.ts b/tests/cases/conformance/types/typeAliases/typeAliases.ts new file mode 100644 index 00000000000..b9d28f4cc35 --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/typeAliases.ts @@ -0,0 +1,80 @@ +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. + +type T1 = number; +var x1: number; +var x1: T1; + +type T2 = string; +var x2: string; +var x2: T2; + +type T3 = boolean; +var x3: boolean; +var x3: T3; + +type T4 = void; +var x4: void; +var x4: T4; + +type T5 = any; +var x5: any; +var x5: T5; + +interface I6 { x : string } +type T6 = I6; +var x6: I6; +var x6: T6; + +class C7 { x: boolean } +type T7 = C7; +var x7: C7; +var x7: T7; + +type T8 = string | boolean; +var x8: string | boolean; +var x8: T8; + +type T9 = () => string; +var x9: () => string; +var x9: T9; + +type T10 = { x: number }; +var x10: { x: number }; +var x10: T10; + +type T11 = { new(): boolean }; +var x11: { new(): boolean }; +var x11: T11; + +interface I13 { x: string }; +type T13 = I13; +var x13_1: I13; +var x13_2: T13 + +declare function foo13(t1: T1, t2: T13): void; +foo13(x13_1, x13_2); +foo13(x13_2, x13_1); + +type T14 = string; +var x14: T14; + +declare function foo14_1(x: T14): void; + +declare function foo14_2(x: "click"): void; +declare function foo14_2(x: T14): void; + +type Meters = number + +enum E { x = 10 } + +declare function f15(a: string): boolean; +declare function f15(a: Meters): string; +f15(E.x).toLowerCase(); + +type StringAndBoolean = [string, boolean] +declare function f16(s: StringAndBoolean): string; +var x: [string, boolean]; +f16(x); + +var y: StringAndBoolean = ["1", false]; +y[0].toLowerCase(); \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts b/tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts new file mode 100644 index 00000000000..f1fd2a58bac --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts @@ -0,0 +1,14 @@ +type T1 = { x: string } + +// An interface can be named in an extends or implements clause, but a type alias for an object type literal cannot. +interface I1 extends T1 { y: string } +class C1 implements T1 { + x: string; +} + +// An interface can have multiple merged declarations, but a type alias for an object type literal cannot. +type T2 = { x: string } +type T2 = { y: number } + +// An interface can have type parameters, but a type alias for an object type literal cannot. +type T3 = { x: T } diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts b/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts index 2fffc6cba44..a7e7e337ead 100644 --- a/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts +++ b/tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts @@ -15,7 +15,7 @@ function f(a: { x: T; y: T }) { return r; } -var r1 = f({ x: new Derived(), y: new Derived2() }); // ok, both extend Base +var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other function f2(a: U) { var r: T; @@ -30,7 +30,7 @@ function f3(y: (a: T) => T, x: T) { return y(null); } -// all ok - T gets fixed too early, but then defaults to Base and everything works out +// all ok - second argument is processed before x is fixed var r4 = f3(x => x, new Base()); var r5 = f3(x => x, new Derived()); var r6 = f3(x => x, null); diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts b/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts new file mode 100644 index 00000000000..39def706622 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts @@ -0,0 +1,31 @@ +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter + +function f(x: T, y: string|T): T { + return x; +} + +var a1: number; +var a1 = f(1, 2); +var a2: number; +var a2 = f(1, "hello"); +var a3: number; +var a3 = f(1, a1 || "hello"); +var a4: any; +var a4 = f(undefined, "abc"); + +function g(value: [string, T]): T { + return value[1]; +} + +var b1: boolean; +var b1 = g(["string", true]); + +function h(x: string|boolean|T): T { + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +} + +var c1: number; +var c1 = h(5); +var c2: string; +var c2 = h("abc"); diff --git a/tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts new file mode 100644 index 00000000000..fccf5381017 --- /dev/null +++ b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts @@ -0,0 +1,36 @@ +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { + foo: string; +} +interface IWithCallSignatures { + (a: number): string; +} +interface IWithCallSignatures2 { + (a: number): number; +} +interface IWithCallSignatures3 { + (b: string): number; +} +interface IWithCallSignatures4 { + (a: number): string; + (a: string, b: number): number; +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); \ No newline at end of file diff --git a/tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts new file mode 100644 index 00000000000..9132c61f4fe --- /dev/null +++ b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts @@ -0,0 +1,54 @@ +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface SomeType { + (a: number): number; +} +interface SomeType2 { + (a: number): string; +} + +interface IWithNoStringIndexSignature { + foo: string; +} +interface IWithNoNumberIndexSignature { + 0: string; +} +interface IWithStringIndexSignature1 { + [a: string]: SomeType; +} +interface IWithStringIndexSignature2 { + [a: string]: SomeType2; +} +interface IWithNumberIndexSignature1 { + [a: number]: SomeType; +} +interface IWithNumberIndexSignature2 { + [a: number]: SomeType2; +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number + + +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number \ No newline at end of file diff --git a/tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts new file mode 100644 index 00000000000..4799fb5e04b --- /dev/null +++ b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts @@ -0,0 +1,119 @@ +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface I1 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI1(a: string): string; + propertyOnlyInI1: string; +} +interface I2 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI2(a: string): string; + propertyOnlyInI2: string; +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +var i2: I2; +var i1Ori2: I1 | I2 = i1; +var i1Ori2: I1 | I2 = i2; +var i1Ori2: I1 | I2 = { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", +}; +var i1Ori2: I1 | I2 = { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + }, + { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }, { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }]; + +interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; + commonPropertyDifferentType: string; +} +interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; + commonPropertyDifferentType: number; +} +var i11: I11; +var i21: I21; +var i11Ori21: I11 | I21 = i11; +var i11Ori21: I11 | I21 = i21; +var i11Ori21: I11 | I21 = { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", +}; +var i11Ori21: I11 | I21 = { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", + }, { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, + }]; \ No newline at end of file diff --git a/tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts new file mode 100644 index 00000000000..b6b328a5d09 --- /dev/null +++ b/tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts @@ -0,0 +1,59 @@ +var str: string; +var num: number; +var strOrNumber: string | number = str || num; +var objStr: { prop: string }; +var objNum: { prop: number }; +var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum; +var objStrOrNum2: { prop: string | number } = objStr || objNum; +// Below is error because : +// Spec says: +// S is a union type and each constituent type of S is assignable to T. +// T is a union type and S is assignable to at least one constituent type of T. +// In case of objStrOrNum3, the S is not union Type but object Literal so we go to next step. +// Since T is union Type we only allow the assignment of either object with property of type string or object with property of type number but do not allow object with property of type string | number +var objStrOrNum3: { prop: string } | { prop: number } = { + prop: strOrNumber +}; +var objStrOrNum4: { prop: string | number } = { + prop: strOrNumber +}; +var objStrOrNum5: { prop: string; anotherP: string; } | { prop: number } = { prop: strOrNumber }; +var objStrOrNum6: { prop: string; anotherP: string; } | { prop: number } = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum7: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + prop: strOrNumber, + anotherP: str +}; +var objStrOrNum8: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { + prop: strOrNumber, + anotherP: str, + anotherP1: num +}; +interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; +} +interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; +} +var i11: I11; +var i21: I21; +var i11Ori21: I11 | I21 = i11; +var i11Ori21: I11 | I21 = i21; +var i11Ori21: I11 | I21 = { // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, +}; +var i11Ori21: I11 | I21 = { // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, +}; +var strOrNumber: string | number; +var i11Ori21: I11 | I21 = { // Like i1 and i2 both + commonMethodDifferentReturnType: (a, b) => strOrNumber, +}; \ No newline at end of file diff --git a/tests/cases/fourslash/augmentedTypesModule6.ts b/tests/cases/fourslash/augmentedTypesModule6.ts index b5811e92468..a2433746265 100644 --- a/tests/cases/fourslash/augmentedTypesModule6.ts +++ b/tests/cases/fourslash/augmentedTypesModule6.ts @@ -10,9 +10,7 @@ goTo.marker('1'); verify.completionListContains('I'); - -// bug #837 -verify.completionListContains('foo'); +verify.not.completionListContains('foo'); edit.insert('I;'); goTo.marker('2'); diff --git a/tests/cases/fourslash/autoFormattingOnPasting.ts b/tests/cases/fourslash/autoFormattingOnPasting.ts index 03f70ac58c1..98efcc02ab3 100644 --- a/tests/cases/fourslash/autoFormattingOnPasting.ts +++ b/tests/cases/fourslash/autoFormattingOnPasting.ts @@ -3,7 +3,7 @@ ////module TestModule { /////**/ ////} - +debugger; goTo.marker(""); edit.paste(" class TestClass{\r\n\ private foo;\r\n\ diff --git a/tests/cases/fourslash/breakpointValidationConst.ts b/tests/cases/fourslash/breakpointValidationConst.ts new file mode 100644 index 00000000000..bc3b530a8c2 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationConst.ts @@ -0,0 +1,25 @@ +/// + +// @BaselineFile: bpSpan_const.baseline +// @Filename: bpSpan_const.ts +////const c1 = false; +////const c2: number = 23; +////const c3 = 0, c4 :string = "", c5 = null; +////for(const c4 = 0; c4 < 9; ) { break; } +////for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } +////module M { +//// export const cc1 = false; +//// export const cc2: number = 23; +//// export const cc3 = 0, cc4 :string = "", cc5 = null; +////} +////const enum E { +//// A = 1, +//// B = 2, +//// C = A | B +////} +////const enum E2 { +//// A = 1, +//// B, +//// C +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationLet.ts b/tests/cases/fourslash/breakpointValidationLet.ts new file mode 100644 index 00000000000..cec696850cd --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationLet.ts @@ -0,0 +1,17 @@ +/// + +// @BaselineFile: bpSpan_let.baseline +// @Filename: bpSpan_let.ts +////let l1; +////let l2: number; +////let l3, l4, l5 :string, l6; +////let l7 = false; +////let l8: number = 23; +////let l9 = 0, l10 :string = "", l11 = null; +////for(let l11 in {}) { } +////for(let l12 = 0; l12 < 9; l12++) { } +////module M { +//// let ll1 = "s"; +//// export let ll2 = 0; +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationTypeAlias.ts b/tests/cases/fourslash/breakpointValidationTypeAlias.ts new file mode 100644 index 00000000000..f2319c1f8d6 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationTypeAlias.ts @@ -0,0 +1,15 @@ +/// + +// @BaselineFile: bpSpan_typealias.baseline +// @Filename: bpSpan_typealias.ts +////module m2 { +//// module m { +//// export class c { +//// } +//// } +//// type a = m.c; +//// export type b = m.c; +//// var x: a = new m.c(); +//// var y: b = new m.c(); +////} +verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/commentsExternalModules.ts b/tests/cases/fourslash/commentsExternalModules.ts index c0e27149202..ad0440a3218 100644 --- a/tests/cases/fourslash/commentsExternalModules.ts +++ b/tests/cases/fourslash/commentsExternalModules.ts @@ -64,7 +64,7 @@ goTo.marker('7'); verify.quickInfoIs("(var) myvar: m1.m2.c", ""); goTo.marker('8'); -verify.memberListContains("c", "class m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) m1.m2.c(): m1.m2.c", ""); verify.memberListContains("i", "(var) m1.m2.i: m1.m2.c", "i"); goTo.file("commentsExternalModules_file1.ts"); @@ -91,5 +91,5 @@ goTo.marker('14'); verify.quickInfoIs("(var) newVar: extMod.m1.m2.c", ""); goTo.marker('15'); -verify.memberListContains("c", "class extMod.m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) extMod.m1.m2.c(): extMod.m1.m2.c", ""); verify.memberListContains("i", "(var) extMod.m1.m2.i: extMod.m1.m2.c", "i"); diff --git a/tests/cases/fourslash/commentsFunction.ts b/tests/cases/fourslash/commentsFunction.ts index 3a4e4e4dcc2..3af718fc967 100644 --- a/tests/cases/fourslash/commentsFunction.ts +++ b/tests/cases/fourslash/commentsFunction.ts @@ -74,7 +74,7 @@ goTo.marker('12'); verify.quickInfoIs("(var) lambddaNoVarComment: (a: number, b: number) => number", ""); goTo.marker('13'); -verify.completionListContains('lambdaFoo', '(var) lambdaFoo: (a: number, b: number) => number', 'lamdaFoo var comment'); +verify.completionListContains('lambdaFoo', '(var) lambdaFoo: (a: number, b: number) => number', ''); verify.completionListContains('lambddaNoVarComment', '(var) lambddaNoVarComment: (a: number, b: number) => number', ''); goTo.marker('14'); diff --git a/tests/cases/fourslash/commentsImportDeclaration.ts b/tests/cases/fourslash/commentsImportDeclaration.ts index f115f3607b7..88abbed8618 100644 --- a/tests/cases/fourslash/commentsImportDeclaration.ts +++ b/tests/cases/fourslash/commentsImportDeclaration.ts @@ -47,5 +47,5 @@ goTo.marker('9'); verify.quickInfoIs("(var) newVar: extMod.m1.m2.c", ""); goTo.marker('10'); -verify.memberListContains("c", "class extMod.m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) extMod.m1.m2.c(): extMod.m1.m2.c", ""); verify.memberListContains("i", "(var) extMod.m1.m2.i: extMod.m1.m2.c", "i"); diff --git a/tests/cases/fourslash/commentsInheritance.ts b/tests/cases/fourslash/commentsInheritance.ts index eaca1d79ccb..e8c2084d38d 100644 --- a/tests/cases/fourslash/commentsInheritance.ts +++ b/tests/cases/fourslash/commentsInheritance.ts @@ -223,7 +223,7 @@ goTo.marker('1'); verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); -verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", "i1_l1"); +verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); @@ -278,10 +278,10 @@ verify.memberListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", ""); verify.memberListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) c1.p1: number", "c1_p1"); verify.memberListContains("f1", "(method) c1.f1(): void", "c1_f1"); -verify.memberListContains("l1", "(property) c1.l1: () => void", "c1_l1"); +verify.memberListContains("l1", "(property) c1.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1"); verify.memberListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1"); -verify.memberListContains("nc_l1", "(property) c1.nc_l1: () => void", "c1_nc_l1"); +verify.memberListContains("nc_l1", "(property) c1.nc_l1: () => void", ""); goTo.marker('7'); verify.currentSignatureHelpDocCommentIs(""); goTo.marker('8'); @@ -321,7 +321,7 @@ verify.quickInfoIs("(property) c1.nc_l1: () => void", ""); goTo.marker('11'); verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1"); verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1"); -verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", "i1_l1"); +verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", ""); verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", ""); verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", ""); verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", ""); @@ -508,13 +508,13 @@ verify.completionListContains("c4_i", "(var) c4_i: c4", ""); goTo.marker('36'); verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "i2_l1"); +verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1"); verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1"); -verify.memberListContains("l1", "(property) i2.l1: () => void", "i2 l1"); +verify.memberListContains("l1", "(property) i2.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", ""); verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", ""); verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); @@ -559,13 +559,13 @@ verify.quickInfoIs("(property) i2.nc_l1: () => void", ""); goTo.marker('41'); verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "i2_l1"); +verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) i3.p1: number", "i3 p1"); verify.memberListContains("f1", "(method) i3.f1(): void", "i3 f1"); -verify.memberListContains("l1", "(property) i3.l1: () => void", "i3 l1"); +verify.memberListContains("l1", "(property) i3.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) i3.nc_p1: number", ""); verify.memberListContains("nc_f1", "(method) i3.nc_f1(): void", ""); verify.memberListContains("nc_l1", "(property) i3.nc_l1: () => void", ""); @@ -606,13 +606,13 @@ verify.quickInfoIs("(property) i3.nc_l1: () => void", ""); goTo.marker('46'); verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1"); verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1"); -verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "i2_l1"); +verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", ""); verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", ""); verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", ""); verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", ""); verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1"); verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1"); -verify.memberListContains("l1", "(property) i2.l1: () => void", "i2 l1"); +verify.memberListContains("l1", "(property) i2.l1: () => void", ""); verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", ""); verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", ""); verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", ""); diff --git a/tests/cases/fourslash/commentsInterface.ts b/tests/cases/fourslash/commentsInterface.ts index 02856242cee..d4a3d2dd924 100644 --- a/tests/cases/fourslash/commentsInterface.ts +++ b/tests/cases/fourslash/commentsInterface.ts @@ -235,7 +235,7 @@ verify.completionListContains("i3_i", "(var) i3_i: i3", ""); goTo.marker('41'); verify.quickInfoIs("(method) i3.f(a: number): string", "Function i3 f"); verify.memberListContains("f", "(method) i3.f(a: number): string", "Function i3 f"); -verify.memberListContains("l", "(property) i3.l: (b: number) => string", "i3 l"); +verify.memberListContains("l", "(property) i3.l: (b: number) => string", ""); verify.memberListContains("x", "(property) i3.x: number", "Comment i3 x"); verify.memberListContains("nc_f", "(method) i3.nc_f(a: number): string", ""); verify.memberListContains("nc_l", "(property) i3.nc_l: (b: number) => string", ""); diff --git a/tests/cases/fourslash/commentsLinePreservation.ts b/tests/cases/fourslash/commentsLinePreservation.ts new file mode 100644 index 00000000000..012272d7544 --- /dev/null +++ b/tests/cases/fourslash/commentsLinePreservation.ts @@ -0,0 +1,161 @@ +/// + +/////** This is firstLine +//// * This is second Line +//// * +//// * This is fourth Line +//// */ +////var /*a*/a: string; +/////** +//// * This is firstLine +//// * This is second Line +//// * +//// * This is fourth Line +//// */ +////var /*b*/b: string; +/////** +//// * This is firstLine +//// * This is second Line +//// * +//// * This is fourth Line +//// * +//// */ +////var /*c*/c: string; +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param +//// * @random tag This should be third line +//// */ +////function /*d*/d(param: string) { /*1*/param = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param +//// */ +////function /*e*/e(param: string) { /*2*/param = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 first line of param +//// * +//// * param information third line +//// * @random tag This should be third line +//// */ +////function /*f*/f(param1: string) { /*3*/param1 = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 +//// * +//// * param information first line +//// * @random tag This should be third line +//// */ +////function /*g*/g(param1: string) { /*4*/param1 = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 +//// * +//// * param information first line +//// * +//// * param information third line +//// * @random tag This should be third line +//// */ +////function /*h*/h(param1: string) { /*5*/param1 = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 +//// * +//// * param information first line +//// * +//// * param information third line +//// * +//// */ +////function /*i*/i(param1: string) { /*6*/param1 = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 +//// * +//// * param information first line +//// * +//// * param information third line +//// */ +////function /*j*/j(param1: string) { /*7*/param1 = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 hello @randomtag +//// * +//// * random information first line +//// * +//// * random information third line +//// */ +////function /*k*/k(param1: string) { /*8*/param1 = "hello"; } +/////** +//// * This is firstLine +//// * This is second Line +//// * @param param1 first Line text +//// * +//// * @param param1 +//// * +//// * blank line that shouldnt be shown when starting this +//// * second time information about the param again +//// */ +////function /*l*/l(param1: string) { /*9*/param1 = "hello"; } + +goTo.marker('a'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n\nThis is fourth Line"); + +goTo.marker('b'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n\nThis is fourth Line"); + +goTo.marker('c'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n\nThis is fourth Line"); + +goTo.marker('d'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n@random tag This should be third line"); +goTo.marker('1'); +verify.quickInfoIs(undefined, ""); + +goTo.marker('e'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line"); +goTo.marker('2'); +verify.quickInfoIs(undefined, ""); + +goTo.marker('f'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n@random tag This should be third line"); +goTo.marker('3'); +verify.quickInfoIs(undefined, "first line of param\n\nparam information third line"); + +goTo.marker('g'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n@random tag This should be third line"); +goTo.marker('4'); +verify.quickInfoIs(undefined, "param information first line"); + +goTo.marker('h'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n@random tag This should be third line"); +goTo.marker('5'); +verify.quickInfoIs(undefined, "param information first line\n\nparam information third line"); + +goTo.marker('i'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line"); +goTo.marker('6'); +verify.quickInfoIs(undefined, "param information first line\n\nparam information third line"); + +goTo.marker('j'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line"); +goTo.marker('7'); +verify.quickInfoIs(undefined, "param information first line\n\nparam information third line"); + +goTo.marker('k'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line\n@randomtag \n\n random information first line\n\n random information third line"); +goTo.marker('8'); +verify.quickInfoIs(undefined, "hello "); + +goTo.marker('l'); +verify.quickInfoIs(undefined, "This is firstLine\nThis is second Line"); +goTo.marker('9'); +verify.quickInfoIs(undefined, "first Line text\nblank line that shouldnt be shown when starting this \nsecond time information about the param again"); diff --git a/tests/cases/fourslash/commentsModules.ts b/tests/cases/fourslash/commentsModules.ts index 06b45afe89e..90257079569 100644 --- a/tests/cases/fourslash/commentsModules.ts +++ b/tests/cases/fourslash/commentsModules.ts @@ -125,7 +125,7 @@ verify.quickInfoIs("(var) myvar: m1.m2.c", ""); goTo.marker('8'); verify.quickInfoIs("(constructor) m1.m2.c(): m1.m2.c", ""); -verify.memberListContains("c", "class m1.m2.c", "class comment;"); +verify.memberListContains("c", "(constructor) m1.m2.c(): m1.m2.c", ""); verify.memberListContains("i", "(var) m1.m2.i: m1.m2.c", "i"); goTo.marker('9'); @@ -138,7 +138,7 @@ verify.quickInfoIs("module m2.m3", "module comment of m2.m3"); goTo.marker('11'); verify.quickInfoIs("(constructor) m2.m3.c(): m2.m3.c", ""); -verify.memberListContains("c", "class m2.m3.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m2.m3.c(): m2.m3.c", ""); goTo.marker('12'); verify.completionListContains("m3", "module m3", ""); @@ -153,8 +153,8 @@ verify.memberListContains("m5", "module m3.m4.m5"); verify.quickInfoIs("module m3.m4.m5", "module comment of m3.m4.m5"); goTo.marker('15'); -verify.memberListContains("c", "class m3.m4.m5.c", "Exported class comment"); verify.quickInfoIs("(constructor) m3.m4.m5.c(): m3.m4.m5.c", ""); +verify.memberListContains("c", "(constructor) m3.m4.m5.c(): m3.m4.m5.c", ""); goTo.marker('16'); verify.completionListContains("m4", "module m4", ""); @@ -173,7 +173,7 @@ verify.memberListContains("m7", "module m4.m5.m6.m7"); verify.quickInfoIs("module m4.m5.m6.m7", ""); goTo.marker('20'); -verify.memberListContains("c", "class m4.m5.m6.m7.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); verify.quickInfoIs("(constructor) m4.m5.m6.m7.c(): m4.m5.m6.m7.c", ""); goTo.marker('21'); @@ -193,7 +193,7 @@ verify.memberListContains("m8", "module m5.m6.m7.m8"); verify.quickInfoIs("module m5.m6.m7.m8", "module m8 comment"); goTo.marker('25'); -verify.memberListContains("c", "class m5.m6.m7.m8.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); verify.quickInfoIs("(constructor) m5.m6.m7.m8.c(): m5.m6.m7.m8.c", ""); goTo.marker('26'); @@ -209,7 +209,7 @@ verify.memberListContains("m8", "module m6.m7.m8"); verify.quickInfoIs("module m6.m7.m8", ""); goTo.marker('29'); -verify.memberListContains("c", "class m6.m7.m8.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m6.m7.m8.c(): m6.m7.m8.c", ""); verify.quickInfoIs("(constructor) m6.m7.m8.c(): m6.m7.m8.c", ""); goTo.marker('30'); @@ -225,7 +225,7 @@ verify.memberListContains("m9", "module m7.m8.m9"); verify.quickInfoIs("module m7.m8.m9", "module m9 comment"); goTo.marker('33'); -verify.memberListContains("c", "class m7.m8.m9.c", "Exported class comment"); +verify.memberListContains("c", "(constructor) m7.m8.m9.c(): m7.m8.m9.c", ""); verify.quickInfoIs("(constructor) m7.m8.m9.c(): m7.m8.m9.c", ""); goTo.marker('34'); diff --git a/tests/cases/fourslash/commentsOverloads.ts b/tests/cases/fourslash/commentsOverloads.ts index 3976fdeae4a..1e85346a17a 100644 --- a/tests/cases/fourslash/commentsOverloads.ts +++ b/tests/cases/fourslash/commentsOverloads.ts @@ -594,11 +594,7 @@ goTo.marker('64q'); verify.quickInfoIs("(constructor) c5(b: string): c5 (+1 overload)", "c5 2"); goTo.marker('65'); -//verify.completionListContains("c", "class c", ""); -// the below check is wrong and it should show it as class but currently we have a bug for adding the parameters of ambient function in the symbol list -// eg declare function foo2(x: number); -// completion list here -verify.completionListContains("c", "(parameter) c: boolean", ""); +verify.completionListContains("c", "class c", ""); verify.completionListContains("c1", "class c1", ""); verify.completionListContains("c2", "class c2", ""); verify.completionListContains("c3", "class c3", ""); diff --git a/tests/cases/fourslash/completionAfterAtChar.ts b/tests/cases/fourslash/completionAfterAtChar.ts new file mode 100644 index 00000000000..4f3581cd483 --- /dev/null +++ b/tests/cases/fourslash/completionAfterAtChar.ts @@ -0,0 +1,6 @@ +/// + +////@a/**/ + +goTo.marker(); +verify.not.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionAfterBackslashFollowingString.ts b/tests/cases/fourslash/completionAfterBackslashFollowingString.ts new file mode 100644 index 00000000000..e8eeeb571b6 --- /dev/null +++ b/tests/cases/fourslash/completionAfterBackslashFollowingString.ts @@ -0,0 +1,6 @@ +/// + +////Harness.newLine = "\r"\n/**/ + +goTo.marker(); +verify.not.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForImportName.ts b/tests/cases/fourslash/completionEntryForImportName.ts new file mode 100644 index 00000000000..5773eb5376e --- /dev/null +++ b/tests/cases/fourslash/completionEntryForImportName.ts @@ -0,0 +1,24 @@ +/// + +////import /*1*/ /*2*/ + +goTo.marker('1'); +verify.completionListIsEmpty(); +edit.insert('q'); +verify.completionListIsEmpty(); +verifyIncompleteImportName(); + +goTo.marker('2'); +edit.insert(" = "); +verifyIncompleteImportName(); + +goTo.marker("2"); +edit.moveRight(" = ".length); +edit.insert("a."); +verifyIncompleteImportName(); + +function verifyIncompleteImportName() { + goTo.marker('1'); + verify.completionListIsEmpty(); + verify.quickInfoIs("import q"); +} \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForPropertyFromUnionOfModuleType.ts b/tests/cases/fourslash/completionEntryForPropertyFromUnionOfModuleType.ts new file mode 100644 index 00000000000..1e072acd1fa --- /dev/null +++ b/tests/cases/fourslash/completionEntryForPropertyFromUnionOfModuleType.ts @@ -0,0 +1,13 @@ +/// + +////module E { +//// export var n = 1; +////} +////module F { +//// export var n = 1; +////} +////var q: typeof E | typeof F; +////var j = q./*1*/ + +goTo.marker('1'); +verify.completionListContains('n', "(property) n: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForUnionMethod.ts b/tests/cases/fourslash/completionEntryForUnionMethod.ts new file mode 100644 index 00000000000..6eb68342d1f --- /dev/null +++ b/tests/cases/fourslash/completionEntryForUnionMethod.ts @@ -0,0 +1,8 @@ +/// + +////var y: Array|Array; +////y.map/**/( + +goTo.marker(); +verify.quickInfoIs("(property) map: ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[])"); +verify.completionListContains('map', "(property) map: ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[])"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryOnNarrowedType.ts b/tests/cases/fourslash/completionEntryOnNarrowedType.ts new file mode 100644 index 00000000000..714d3390e76 --- /dev/null +++ b/tests/cases/fourslash/completionEntryOnNarrowedType.ts @@ -0,0 +1,20 @@ +/// + +////function foo(strOrNum: string | number) { +//// /*1*/ +//// if (typeof strOrNum === "number") { +//// /*2*/ +//// } +//// else { +//// /*3*/ +//// } +////} + +goTo.marker('1'); +verify.completionListContains("strOrNum", "(parameter) strOrNum: string | number"); + +goTo.marker('2'); +verify.completionListContains("strOrNum", "(parameter) strOrNum: number"); + +goTo.marker('3'); +verify.completionListContains("strOrNum", "(parameter) strOrNum: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionInAugmentedClassModule.ts b/tests/cases/fourslash/completionInAugmentedClassModule.ts new file mode 100644 index 00000000000..18ea0dbbcb6 --- /dev/null +++ b/tests/cases/fourslash/completionInAugmentedClassModule.ts @@ -0,0 +1,8 @@ +/// + +////declare class m3f { foo(x: number): void } +////module m3f { export interface I { foo(): void } } +////var x: m3f./**/ + +goTo.marker(); +verify.not.completionListContains("foo"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAfterFunction.ts b/tests/cases/fourslash/completionListAfterFunction.ts new file mode 100644 index 00000000000..140c5e2e363 --- /dev/null +++ b/tests/cases/fourslash/completionListAfterFunction.ts @@ -0,0 +1,25 @@ +/// + +////// Outside the function +////declare function f1(a: number);/*1*/ +//// +////// inside the function +////declare function f2(b: number, b2 = /*2*/ +//// +////// Outside the function +////function f3(c: number) { }/*3*/ +//// +////// inside the function +////function f4(d: number) { /*4*/} + +goTo.marker("1"); +verify.not.completionListContains("a"); + +goTo.marker("2"); +verify.completionListContains("b"); + +goTo.marker("3"); +verify.not.completionListContains("c"); + +goTo.marker("4"); +verify.completionListContains("d"); diff --git a/tests/cases/fourslash/completionListAfterFunction2.ts b/tests/cases/fourslash/completionListAfterFunction2.ts new file mode 100644 index 00000000000..c123e084972 --- /dev/null +++ b/tests/cases/fourslash/completionListAfterFunction2.ts @@ -0,0 +1,13 @@ +/// + +////// Outside the function expression +////declare var f1: (a: number) => void; /*1*/ +//// +////declare var f1: (b: number, b2: /*2*/) => void; + +goTo.marker("1"); +verify.not.completionListContains("a"); + +goTo.marker("2"); +verify.completionListContains("b"); + diff --git a/tests/cases/fourslash/completionListAfterFunction3.ts b/tests/cases/fourslash/completionListAfterFunction3.ts new file mode 100644 index 00000000000..575351ea648 --- /dev/null +++ b/tests/cases/fourslash/completionListAfterFunction3.ts @@ -0,0 +1,12 @@ +/// + +////// Outside the function expression +////var x1 = (a: number) => { }/*1*/; +//// +////var x2 = (b: number) => {/*2*/ }; + +goTo.marker("1"); +verify.not.completionListContains("a"); + +goTo.marker("2"); +verify.completionListContains("b"); diff --git a/tests/cases/fourslash/completionListAfterNumericLiteral.ts b/tests/cases/fourslash/completionListAfterNumericLiteral.ts index a8ea0335f70..549c048a635 100644 --- a/tests/cases/fourslash/completionListAfterNumericLiteral.ts +++ b/tests/cases/fourslash/completionListAfterNumericLiteral.ts @@ -25,10 +25,10 @@ goTo.marker("dotOnNumberExrpressions1"); verify.completionListIsEmpty(); goTo.marker("dotOnNumberExrpressions2"); -verify.completionListIsEmpty(); +verify.completionListContains("toExponential"); goTo.marker("dotOnNumberExrpressions3"); -verify.completionListIsEmpty(); +verify.completionListContains("toExponential"); goTo.marker("dotOnNumberExrpressions4"); verify.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListAfterNumericLiteral1.ts b/tests/cases/fourslash/completionListAfterNumericLiteral1.ts index b2604531316..cf8b5d41e98 100644 --- a/tests/cases/fourslash/completionListAfterNumericLiteral1.ts +++ b/tests/cases/fourslash/completionListAfterNumericLiteral1.ts @@ -3,4 +3,4 @@ ////5../**/ goTo.marker(); -verify.completionListIsEmpty(); \ No newline at end of file +verify.completionListContains("toFixed"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAfterSlash.ts b/tests/cases/fourslash/completionListAfterSlash.ts new file mode 100644 index 00000000000..f9a0b69afdf --- /dev/null +++ b/tests/cases/fourslash/completionListAfterSlash.ts @@ -0,0 +1,8 @@ +/// + +////var a = 0; +////a/./**/ + +goTo.marker(); +// should not crash +verify.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts new file mode 100644 index 00000000000..bdf13c1d97f --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_catch.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +//// try {} catch(/*catchVariable1*/ + +//// try {} catch(a/*catchVariable2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts new file mode 100644 index 00000000000..60a108cf1e6 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_classes.ts @@ -0,0 +1,12 @@ +/// + +////var aa = 1; + +////class /*className1*/ + +////class a/*className2*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts new file mode 100644 index 00000000000..6c0472be546 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers.ts @@ -0,0 +1,11 @@ +/// + +////var aa = 1; + +////enum a { /*enumValueName1*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts new file mode 100644 index 00000000000..ee2f3e71032 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enumMembers2.ts @@ -0,0 +1,9 @@ +/// + +////var aa = 1; +////enum a { foo, /*enumValueName3*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts new file mode 100644 index 00000000000..183f8a22c63 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_enums.ts @@ -0,0 +1,14 @@ +/// + +////var aa = 1; + +////enum /*enumName1*/ + +////enum a/*enumName2*/ + +////var x = 0; enum /*enumName4*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts new file mode 100644 index 00000000000..24231174727 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_functions.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +////function /*functionName1*/ + +////function a/*functionName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts new file mode 100644 index 00000000000..266b0b78c9c --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers.ts @@ -0,0 +1,10 @@ +/// + +////var aa = 1; + +////interface a { /*interfaceValue1*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts new file mode 100644 index 00000000000..82a30325948 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers2.ts @@ -0,0 +1,10 @@ +/// + +////var aa = 1; + +////interface a { f/*interfaceValue2*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts new file mode 100644 index 00000000000..ed640dd3f1a --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaceMembers3.ts @@ -0,0 +1,10 @@ +/// + +////var aa = 1; + +////interface a { f; /*interfaceValue3*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts new file mode 100644 index 00000000000..ec2732fe2fe --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_interfaces.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +////interface /*interfaceName1*/ + +////interface a/*interfaceName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts new file mode 100644 index 00000000000..4ebdf029a89 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_modules.ts @@ -0,0 +1,13 @@ +/// + +////var aa = 1; + +////module /*moduleName1*/ + +////module a/*moduleName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_parameters.ts similarity index 54% rename from tests/cases/fourslash/completionListAtIdentifierDefinitionLocations.ts rename to tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_parameters.ts index e36d69c82f2..0fd66e9d091 100644 --- a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations.ts +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_parameters.ts @@ -1,40 +1,33 @@ /// ////var aa = 1; -////class /*className1*/ -////class a/*className2*/ -////interface /*interfaceName1*/ -////interface a/*interfaceName2*/ -////module /*moduleName1*/ -////module a/*moduleName2*/ -////enum /*enumName1*/ -////enum a/*enumName2*/ -////// fourslash is saying completion list is not empty on this line but editor disagrees -//////enum a { /*enumValueName1*/ -////enum a { f/*enumValueName2*/ -////enum a { foo, /*enumValueName3*/ -////var x = 0; enum /*enumName4*/ -////function /*functionName1*/ -////function a/*functionName2*/ -////var /*varName1*/ -////var a/*varName2*/ -////var a2,/*varName3*/ -////var a2, a/*varName4*/ + ////function testFunction(/*parameterName1*/ + ////function testFunction(a/*parameterName2*/ + ////function testFunction(a, /*parameterName3*/ + ////function testFunction(a, b/*parameterName4*/ + ////class bar1{ constructor(/*constructorParamter1*/ + ////class bar2{ constructor(a/*constructorParamter2*/ + ////class bar3{ constructor(a, /*constructorParamter3*/ + ////class bar4{ constructor(a, b/*constructorParamter4*/ + ////class bar5{ constructor(public /*constructorParamter5*/ + ////class bar6{ constructor(public a/*constructorParamter6*/ + ////class bar7{ constructor(private a/*constructorParamter7*/ + ////class bar8{ constructor(.../*constructorParamter8*/ + ////class bar9{ constructor(...a/*constructorParamter9*/ -//// try {} catch(/*catchVariable1*/ -//// try {} catch(a/*catchVariable2*/ + test.markers().forEach((m) => { goTo.position(m.position, m.fileName); diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts new file mode 100644 index 00000000000..50a112f4625 --- /dev/null +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_varDeclarations.ts @@ -0,0 +1,18 @@ +/// + +////var aa = 1; + + +////var /*varName1*/ + +////var a/*varName2*/ + +////var a2,/*varName3*/ + +////var a2, a/*varName4*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListInComments2.ts b/tests/cases/fourslash/completionListInComments2.ts new file mode 100644 index 00000000000..d9855306fcf --- /dev/null +++ b/tests/cases/fourslash/completionListInComments2.ts @@ -0,0 +1,7 @@ +/// + +//// // */{| "name" : "1" |} + +goTo.marker("1"); +// Completion list should not be available within comments +verify.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListInComments3.ts b/tests/cases/fourslash/completionListInComments3.ts new file mode 100644 index 00000000000..2f20a969ba1 --- /dev/null +++ b/tests/cases/fourslash/completionListInComments3.ts @@ -0,0 +1,31 @@ +/// + +//// /*{| "name": "1" |} + +//// /* {| "name": "2" |} + +//// /* *{| "name": "3" |} + +//// /* */{| "name": "4" |} + +//// {| "name": "5" |}/* */ + +/////* {| "name": "6" |} + +goTo.marker("1"); +verify.completionListIsEmpty(); + +goTo.marker("2"); +verify.completionListIsEmpty(); + +goTo.marker("3"); +verify.completionListIsEmpty(); + +goTo.marker("4"); +verify.not.completionListIsEmpty(); + +goTo.marker("5"); +verify.not.completionListIsEmpty(); + +goTo.marker("6"); +verify.completionListIsEmpty(); diff --git a/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts b/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts new file mode 100644 index 00000000000..a71584bdbdd --- /dev/null +++ b/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts @@ -0,0 +1,11 @@ +/// + +/////*0*/` $ { ${/*1*/ 10/*2*/ + 1.1/*3*/ /*4*/} 12312`/*5*/ +//// +/////*6*/`asdasd${/*7*/ 2 + 1.1 /*8*/} 12312 { + +test.markers().forEach(marker => { + goTo.position(marker.position); + + verify.completionListItemsCountIsGreaterThan(0) +}} \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts b/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts new file mode 100644 index 00000000000..1624192057b --- /dev/null +++ b/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts @@ -0,0 +1,11 @@ +/// + +////`/*0*/ /*1*/$ /*2*/{ /*3*/$/*4*/{ 10 + 1.1 }/*5*/ 12312/*6*/` +//// +////`asdasd$/*7*/{ 2 + 1.1 }/*8*/ 12312 /*9*/{/*10*/ + +test.markers().forEach(marker => { + goTo.position(marker.position); + + verify.completionListIsEmpty() +} \ No newline at end of file diff --git a/tests/cases/fourslash/completionListPrivateMembers3.ts b/tests/cases/fourslash/completionListPrivateMembers3.ts new file mode 100644 index 00000000000..69f7456d7b5 --- /dev/null +++ b/tests/cases/fourslash/completionListPrivateMembers3.ts @@ -0,0 +1,31 @@ +/// + +////class Other { +//// public p; +//// protected p2 +//// private p3; +////} +//// +////class Self { +//// private other: Other; +//// +//// method() { +//// this.other./*1*/; +//// +//// this.other.p/*2*/; +//// +//// this.other.p/*3*/.toString(); +//// } +////} + +goTo.marker("1"); +verify.memberListContains("p"); +verify.memberListCount(1); + +goTo.marker("2"); +verify.memberListContains("p"); +verify.memberListCount(1); + +goTo.marker("2"); +verify.memberListContains("p"); +verify.memberListCount(1); diff --git a/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts b/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts index e49dd0dea5d..d01856a54fb 100644 --- a/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts +++ b/tests/cases/fourslash/completion_enum-members-with-invalid-identifiers-should-not-show-in-completion.ts @@ -10,6 +10,7 @@ //// //// e./**/ +goTo.marker(); verify.not.completionListContains('1'); verify.not.completionListContains('"1"'); verify.not.completionListContains('2'); diff --git a/tests/cases/fourslash/externalModuleWithExportAssignment.ts b/tests/cases/fourslash/externalModuleWithExportAssignment.ts index 1de1e55579b..4d5f600317d 100644 --- a/tests/cases/fourslash/externalModuleWithExportAssignment.ts +++ b/tests/cases/fourslash/externalModuleWithExportAssignment.ts @@ -37,7 +37,7 @@ verify.quickInfoIs("(var) a: {\n (): a1.connectExport;\n test1: a1.connect goTo.marker('3'); verify.quickInfoIs("(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); -verify.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.completionListContains("test1", "(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); verify.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); verify.not.completionListContains("connectModule"); verify.not.completionListContains("connectExport"); @@ -59,7 +59,7 @@ verify.quickInfoIs("(var) r2: a1.connectExport", undefined); goTo.marker('9'); verify.quickInfoIs("(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); -verify.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.completionListContains("test1", "(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); verify.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); verify.completionListContains("connectModule"); verify.completionListContains("connectExport"); diff --git a/tests/cases/fourslash/findAllRefsInsideTemplates1.ts b/tests/cases/fourslash/findAllRefsInsideTemplates1.ts new file mode 100644 index 00000000000..e4501219265 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInsideTemplates1.ts @@ -0,0 +1,12 @@ +/// + +////var [|x|] = 10; +////var y = `${ [|x|] } ${ [|x|] }` + +test.ranges().forEach(targetRange => { + goTo.position(targetRange.start); + + test.ranges().forEach(range => { + verify.referencesAtPositionContains(range); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInsideTemplates2.ts b/tests/cases/fourslash/findAllRefsInsideTemplates2.ts new file mode 100644 index 00000000000..cafddd4f45b --- /dev/null +++ b/tests/cases/fourslash/findAllRefsInsideTemplates2.ts @@ -0,0 +1,12 @@ +/// + +////function [|f|](...rest: any[]) { } +////[|f|] `${ [|f|] } ${ [|f|] }` + +test.ranges().forEach(targetRange => { + goTo.position(targetRange.start); + + test.ranges().forEach(range => { + verify.referencesAtPositionContains(range); + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts b/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts new file mode 100644 index 00000000000..6686a771b34 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsOnPrivateParameterProperty1.ts @@ -0,0 +1,18 @@ +/// + +////class ABCD { +//// constructor(private x: number, public y: number, private [|z|]: number) { +//// } +//// +//// func() { +//// return this.[|z|]; +//// } +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.referencesAtPositionContains(range); + }); +}); diff --git a/tests/cases/fourslash/forceIndentAfterNewLineInsert.ts b/tests/cases/fourslash/forceIndentAfterNewLineInsert.ts index bece44bc24d..af6a21e97ea 100644 --- a/tests/cases/fourslash/forceIndentAfterNewLineInsert.ts +++ b/tests/cases/fourslash/forceIndentAfterNewLineInsert.ts @@ -6,7 +6,7 @@ ////{ function h() { ////return 0; ////}} - +debugger; format.document(); verify.currentFileContentIs( "function f()\n" + diff --git a/tests/cases/fourslash/formatInTryCatchFinally.ts b/tests/cases/fourslash/formatInTryCatchFinally.ts new file mode 100644 index 00000000000..dbbf28fb878 --- /dev/null +++ b/tests/cases/fourslash/formatInTryCatchFinally.ts @@ -0,0 +1,13 @@ +/// + +////try +////{ +//// var x = 1/*1*/ +////} +////catch (e) +////{ +////} + +goTo.marker("1"); +edit.insert(";") +verify.currentLineContentIs(" var x = 1;"); diff --git a/tests/cases/fourslash/formattingBlockInCaseClauses.ts b/tests/cases/fourslash/formattingBlockInCaseClauses.ts new file mode 100644 index 00000000000..64cd74ca858 --- /dev/null +++ b/tests/cases/fourslash/formattingBlockInCaseClauses.ts @@ -0,0 +1,12 @@ +/// + +////switch (1) { +//// case 1: +//// { +//// /*1*/ +//// break; +////} + +goTo.marker("1"); +edit.insert("}"); +verify.currentLineContentIs(" }"); diff --git a/tests/cases/fourslash/formattingFatArrowFunctions.ts b/tests/cases/fourslash/formattingFatArrowFunctions.ts index 699e0b53157..73463852a67 100644 --- a/tests/cases/fourslash/formattingFatArrowFunctions.ts +++ b/tests/cases/fourslash/formattingFatArrowFunctions.ts @@ -120,13 +120,13 @@ verify.currentLineContentIs("(arg) => 2;"); goTo.marker("3"); verify.currentLineContentIs("arg => 2;"); goTo.marker("4"); -verify.currentLineContentIs("(arg = 1) => 3;"); +verify.currentLineContentIs("(arg = 1) => 3;"); goTo.marker("5"); verify.currentLineContentIs("(arg?) => 4;"); goTo.marker("6"); verify.currentLineContentIs("(arg: number) => 5;"); goTo.marker("7"); -verify.currentLineContentIs("(arg: number = 0) => 6;"); +verify.currentLineContentIs("(arg: number = 0) => 6;"); goTo.marker("8"); verify.currentLineContentIs("(arg?: number) => 7;"); goTo.marker("9"); @@ -134,13 +134,13 @@ verify.currentLineContentIs("(...arg: number[]) => 8;"); goTo.marker("10"); verify.currentLineContentIs("(arg1, arg2) => 12;"); goTo.marker("11"); -verify.currentLineContentIs("(arg1 = 1, arg2 = 3) => 13;"); +verify.currentLineContentIs("(arg1 = 1, arg2 = 3) => 13;"); goTo.marker("12"); verify.currentLineContentIs("(arg1?, arg2?) => 14;"); goTo.marker("13"); verify.currentLineContentIs("(arg1: number, arg2: number) => 15;"); goTo.marker("14"); -verify.currentLineContentIs("(arg1: number = 0, arg2: number = 1) => 16;"); +verify.currentLineContentIs("(arg1: number = 0, arg2: number = 1) => 16;"); goTo.marker("15"); verify.currentLineContentIs("(arg1?: number, arg2?: number) => 17;"); goTo.marker("16"); @@ -152,13 +152,13 @@ verify.currentLineContentIs("(() => 21);"); goTo.marker("19"); verify.currentLineContentIs("((arg) => 22);"); goTo.marker("20"); -verify.currentLineContentIs("((arg = 1) => 23);"); +verify.currentLineContentIs("((arg = 1) => 23);"); goTo.marker("21"); verify.currentLineContentIs("((arg?) => 24);"); goTo.marker("22"); verify.currentLineContentIs("((arg: number) => 25);"); goTo.marker("23"); -verify.currentLineContentIs("((arg: number = 0) => 26);"); +verify.currentLineContentIs("((arg: number = 0) => 26);"); goTo.marker("24"); verify.currentLineContentIs("((arg?: number) => 27);"); goTo.marker("25"); @@ -170,7 +170,7 @@ verify.currentLineContentIs("false ? () => 41 : null;"); goTo.marker("28"); verify.currentLineContentIs("false ? (arg) => 42 : null;"); goTo.marker("29"); -verify.currentLineContentIs("false ? (arg = 1) => 43 : null;"); +verify.currentLineContentIs("false ? (arg = 1) => 43 : null;"); goTo.marker("30"); verify.currentLineContentIs("false ? (arg?) => 44 : null;"); goTo.marker("31"); @@ -178,7 +178,7 @@ verify.currentLineContentIs("false ? (arg: number) => 45 : null;"); goTo.marker("32"); verify.currentLineContentIs("false ? (arg?: number) => 46 : null;"); goTo.marker("33"); -verify.currentLineContentIs("false ? (arg?: number = 0) => 47 : null;"); +verify.currentLineContentIs("false ? (arg?: number = 0) => 47 : null;"); goTo.marker("34"); verify.currentLineContentIs("false ? (...arg: number[]) => 48 : null;"); goTo.marker("35"); @@ -186,7 +186,7 @@ verify.currentLineContentIs("false ? (() => 51) : null;"); goTo.marker("36"); verify.currentLineContentIs("false ? ((arg) => 52) : null;"); goTo.marker("37"); -verify.currentLineContentIs("false ? ((arg = 1) => 53) : null;"); +verify.currentLineContentIs("false ? ((arg = 1) => 53) : null;"); goTo.marker("38"); verify.currentLineContentIs("false ? ((arg?) => 54) : null;"); goTo.marker("39"); @@ -194,7 +194,7 @@ verify.currentLineContentIs("false ? ((arg: number) => 55) : null;"); goTo.marker("40"); verify.currentLineContentIs("false ? ((arg?: number) => 56) : null;"); goTo.marker("41"); -verify.currentLineContentIs("false ? ((arg?: number = 0) => 57) : null;"); +verify.currentLineContentIs("false ? ((arg?: number = 0) => 57) : null;"); goTo.marker("42"); verify.currentLineContentIs("false ? ((...arg: number[]) => 58) : null;"); goTo.marker("43"); @@ -202,7 +202,7 @@ verify.currentLineContentIs("false ? null : () => 61;"); goTo.marker("44"); verify.currentLineContentIs("false ? null : (arg) => 62;"); goTo.marker("45"); -verify.currentLineContentIs("false ? null : (arg = 1) => 63;"); +verify.currentLineContentIs("false ? null : (arg = 1) => 63;"); goTo.marker("46"); verify.currentLineContentIs("false ? null : (arg?) => 64;"); goTo.marker("47"); @@ -210,7 +210,7 @@ verify.currentLineContentIs("false ? null : (arg: number) => 65;"); goTo.marker("48"); verify.currentLineContentIs("false ? null : (arg?: number) => 66;"); goTo.marker("49"); -verify.currentLineContentIs("false ? null : (arg?: number = 0) => 67;"); +verify.currentLineContentIs("false ? null : (arg?: number = 0) => 67;"); goTo.marker("50"); verify.currentLineContentIs("false ? null : (...arg: number[]) => 68;"); goTo.marker("51"); @@ -220,13 +220,13 @@ verify.currentLineContentIs("((a?) => { return a; }) ? (b) => (c) => 81 : (c) => goTo.marker("53"); verify.currentLineContentIs("((arg) => 90) instanceof Function;"); goTo.marker("54"); -verify.currentLineContentIs("((arg = 1) => 91) instanceof Function;"); +verify.currentLineContentIs("((arg = 1) => 91) instanceof Function;"); goTo.marker("55"); verify.currentLineContentIs("((arg?) => 92) instanceof Function;"); goTo.marker("56"); verify.currentLineContentIs("((arg: number) => 93) instanceof Function;"); goTo.marker("57"); -verify.currentLineContentIs("((arg: number = 1) => 94) instanceof Function;"); +verify.currentLineContentIs("((arg: number = 1) => 94) instanceof Function;"); goTo.marker("58"); verify.currentLineContentIs("((arg?: number) => 95) instanceof Function;"); goTo.marker("59"); @@ -237,13 +237,13 @@ verify.currentLineContentIs("'' + ((arg) => 100);"); goTo.marker("61"); verify.currentLineContentIs("((arg) => 0) + '' + ((arg) => 101);"); goTo.marker("62"); -verify.currentLineContentIs("((arg = 1) => 0) + '' + ((arg = 2) => 102);"); +verify.currentLineContentIs("((arg = 1) => 0) + '' + ((arg = 2) => 102);"); goTo.marker("63"); verify.currentLineContentIs("((arg?) => 0) + '' + ((arg?) => 103);"); goTo.marker("64"); verify.currentLineContentIs("((arg: number) => 0) + '' + ((arg: number) => 104);"); goTo.marker("65"); -verify.currentLineContentIs("((arg: number = 1) => 0) + '' + ((arg: number = 2) => 105);"); +verify.currentLineContentIs("((arg: number = 1) => 0) + '' + ((arg: number = 2) => 105);"); goTo.marker("66"); verify.currentLineContentIs("((arg?: number) => 0) + '' + ((arg?: number) => 106);"); goTo.marker("67"); @@ -273,17 +273,17 @@ verify.currentLineContentIs(" (a, b?) => 114,"); goTo.marker("79"); verify.currentLineContentIs(" (a: number) => 115,"); goTo.marker("80"); -verify.currentLineContentIs(" (a: number = 0) => 116,"); +verify.currentLineContentIs(" (a: number = 0) => 116,"); goTo.marker("81"); -verify.currentLineContentIs(" (a = 0) => 117,"); +verify.currentLineContentIs(" (a = 0) => 117,"); goTo.marker("82"); -verify.currentLineContentIs(" (a: number = 0) => 118,"); +verify.currentLineContentIs(" (a: number = 0) => 118,"); goTo.marker("83"); verify.currentLineContentIs(" (a?, b?: number) => 118,"); goTo.marker("84"); verify.currentLineContentIs(" (...a: number[]) => 119,"); goTo.marker("85"); -verify.currentLineContentIs(" (a, b = 0, ...c: number[]) => 120,"); +verify.currentLineContentIs(" (a, b = 0, ...c: number[]) => 120,"); goTo.marker("86"); verify.currentLineContentIs(" (a) => (b) => (c) => 121,"); goTo.marker("87"); diff --git a/tests/cases/fourslash/formattingIfInElseBlock.ts b/tests/cases/fourslash/formattingIfInElseBlock.ts new file mode 100644 index 00000000000..b4f5246fb35 --- /dev/null +++ b/tests/cases/fourslash/formattingIfInElseBlock.ts @@ -0,0 +1,12 @@ +/// + +////if (true) { +////} +////else { +//// if (true) { +//// /*1*/ +////} + +goTo.marker("1"); +edit.insert("}") +verify.currentLineContentIs(" }"); diff --git a/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts b/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts index 8456182036d..c49152f5011 100644 --- a/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts +++ b/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts @@ -135,9 +135,9 @@ verify.currentLineContentIs(" return 0"); goTo.marker("51"); verify.currentLineContentIs("}).then(function(doc) {"); goTo.marker("52"); -verify.currentLineContentIs(" return 1"); +verify.currentLineContentIs(" return 1"); goTo.marker("53"); -verify.currentLineContentIs(" });"); +verify.currentLineContentIs("});"); goTo.marker("54"); verify.currentLineContentIs("if (1)"); goTo.marker("55"); diff --git a/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts b/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts index 3b6d60ef45b..2e7c344d225 100644 --- a/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts +++ b/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts @@ -4,7 +4,7 @@ //// export enum NodeType {/*2*/ //// Error,/*3*/ //// Comment,/*4*/ -//// } /*5*/ +//// } /*5*/ //// export enum foob/*6*/ //// { //// Blah=1, Bleah=2/*7*/ @@ -25,7 +25,7 @@ verify.currentLineContentIs(" }"); goTo.marker("6"); verify.currentLineContentIs(" export enum foob {"); goTo.marker("7"); -verify.currentLineContentIs(" Blah= 1, Bleah= 2"); +verify.currentLineContentIs(" Blah = 1, Bleah = 2"); goTo.marker("8"); verify.currentLineContentIs(" }"); goTo.marker("9"); diff --git a/tests/cases/fourslash/formattingSkippedTokens.ts b/tests/cases/fourslash/formattingSkippedTokens.ts index 62cd0b67c37..094612c8939 100644 --- a/tests/cases/fourslash/formattingSkippedTokens.ts +++ b/tests/cases/fourslash/formattingSkippedTokens.ts @@ -13,10 +13,10 @@ format.document(); goTo.marker('1'); verify.currentLineContentIs('foo(): Bar { }'); goTo.marker('2'); -verify.currentLineContentIs('function Foo () # { }'); +verify.currentLineContentIs('function Foo() # { }'); goTo.marker('3'); -verify.currentLineContentIs('4+:5'); +verify.currentLineContentIs('4 +:5'); goTo.marker('4'); verify.currentLineContentIs(' : T) { }'); goTo.marker('5'); -verify.currentLineContentIs('var x ='); \ No newline at end of file +verify.currentLineContentIs('var x ='); diff --git a/tests/cases/fourslash/formattingTemplates.ts b/tests/cases/fourslash/formattingTemplates.ts new file mode 100644 index 00000000000..c7decd10316 --- /dev/null +++ b/tests/cases/fourslash/formattingTemplates.ts @@ -0,0 +1,12 @@ +/// + +////String.call `${123}`/*1*/ +////String.call `${123} ${456}`/*2*/ + +goTo.marker("1"); +edit.insert(";"); +verify.currentLineContentIs("String.call `${123}`;"); + +goTo.marker("2"); +edit.insert(";"); +verify.currentLineContentIs("String.call `${123} ${456}`;"); \ No newline at end of file diff --git a/tests/cases/fourslash/getPreProcessedFile.ts b/tests/cases/fourslash/getPreProcessedFile.ts new file mode 100644 index 00000000000..abd26bb6e4b --- /dev/null +++ b/tests/cases/fourslash/getPreProcessedFile.ts @@ -0,0 +1,32 @@ +/// + +// @Filename: refFile1.ts +//// class D { } + +// @Filename: refFile2.ts +//// export class E {} + +// @Filename: main.ts +// @ResolveReference: true +//// /// +//// /*1*/////*2*/ +//// /*3*/////*4*/ +//// import ref2 = require("refFile2"); +//// import noExistref2 = require(/*5*/"NotExistRefFile2"/*6*/); +//// import invalidRef1 /*7*/require/*8*/("refFile2"); +//// /*9*/import invalidRef2 = requi/*10*/("refFile2"); +//// var obj: /*11*/C/*12*/; +//// var obj1: D; +//// var obj2: ref2.E; + +goTo.file("main.ts"); +verify.numberOfErrorsInCurrentFile(7); +verify.errorExistsBetweenMarkers("1", "2"); +verify.errorExistsBetweenMarkers("3", "4"); +verify.errorExistsBetweenMarkers("5", "6"); +verify.errorExistsBetweenMarkers("7", "8"); +verify.errorExistsBetweenMarkers("9", "10"); // At this position, there are two diagnostic messages: ';' expected, Cannot find name 'requi' +verify.errorExistsBetweenMarkers("11", "12"); + + + diff --git a/tests/cases/fourslash/multilineCommentBeforeOpenBrace.ts b/tests/cases/fourslash/multilineCommentBeforeOpenBrace.ts index 7b784445486..63813c12288 100644 --- a/tests/cases/fourslash/multilineCommentBeforeOpenBrace.ts +++ b/tests/cases/fourslash/multilineCommentBeforeOpenBrace.ts @@ -8,7 +8,7 @@ ////} ////function a() { //// /* %^ */ }/*3*/ - +debugger; format.document(); goTo.marker('1'); verify.currentLineContentIs('function test() /* %^ */ {'); diff --git a/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts b/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts new file mode 100644 index 00000000000..30314b1c665 --- /dev/null +++ b/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts @@ -0,0 +1,14 @@ +/// + +////class Foo { } +////new/*1*/ Foo +////new /*2*/Foo(/*3*/) + +goTo.marker('1'); +verify.not.signatureHelpPresent(); + +goTo.marker('2'); +verify.not.signatureHelpPresent(); + +goTo.marker('3'); +verify.signatureHelpPresent(); \ No newline at end of file diff --git a/tests/cases/fourslash/proto.ts b/tests/cases/fourslash/proto.ts index 73f23dea64f..cdb279b5009 100644 --- a/tests/cases/fourslash/proto.ts +++ b/tests/cases/fourslash/proto.ts @@ -12,9 +12,9 @@ verify.quickInfoIs("interface M.__proto__", ""); goTo.marker('2'); verify.quickInfoIs("(var) __proto__: M.__proto__", ""); goTo.marker('3'); -//verify.completionListContains("__proto__", "(var) __proto__: M.__proto__", ""); +verify.completionListContains("__proto__", "(var) __proto__: M.__proto__", ""); edit.insert("__proto__"); -//goTo.definition(); -//verify.caretAtMarker('2'); +goTo.definition(); +verify.caretAtMarker('2'); goTo.marker('4'); verify.quickInfoIs("(var) fun: (__proto__: any) => boolean", ""); \ No newline at end of file diff --git a/tests/cases/fourslash/protoPropertyInObjectLiteral.ts b/tests/cases/fourslash/protoPropertyInObjectLiteral.ts new file mode 100644 index 00000000000..8812f0adf62 --- /dev/null +++ b/tests/cases/fourslash/protoPropertyInObjectLiteral.ts @@ -0,0 +1,21 @@ +/// + +////var o1 = { +//// "__proto__": 10 +////}; +////var o2 = { +//// __proto__: 10 +////}; +////o1./*1*/ +////o2./*2*/ + +goTo.marker('1'); +verify.completionListContains("__proto__", '(property) "__proto__": number'); +edit.insert("__proto__ = 10;"); +goTo.marker('1'); +verify.quickInfoIs('(property) "__proto__": number'); +goTo.marker('2'); +verify.completionListContains("__proto__", '(property) __proto__: number'); +edit.insert("__proto__ = 10;"); +goTo.marker('2'); +verify.quickInfoIs('(property) __proto__: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/protoVarInContexutalObjectLiteral.ts b/tests/cases/fourslash/protoVarInContexutalObjectLiteral.ts new file mode 100644 index 00000000000..cf76ba7c3cd --- /dev/null +++ b/tests/cases/fourslash/protoVarInContexutalObjectLiteral.ts @@ -0,0 +1,94 @@ +/// + +////var o1 : { +//// __proto__: number; +//// p: number; +////} = { +//// /*1*/ +//// }; +////var o2: { +//// __proto__: number; +//// p: number; +////} = { +//// /*2*/ +//// }; +////var o3: { +//// "__proto__": number; +//// p: number; +////} = { +//// /*3*/ +//// }; +////var o4: { +//// "__proto__": number; +//// p: number; +////} = { +//// /*4*/ +//// }; +////var o5: { +//// __proto__: number; +//// ___proto__: string; +//// p: number; +////} = { +//// /*5*/ +//// }; +////var o6: { +//// __proto__: number; +//// ___proto__: string; +//// p: number; +////} = { +//// /*6*/ +//// }; + +goTo.marker('1'); +verify.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('__proto__: 10,'); +verify.not.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("p", '(property) p: number'); + +goTo.marker('2'); +verify.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('"__proto__": 10,'); +verify.not.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("p", '(property) p: number'); + +goTo.marker('3'); +verify.completionListContains("__proto__", '(property) "__proto__": number'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('__proto__: 10,'); +verify.not.completionListContains("__proto__", '(property) "__proto__": number'); +verify.completionListContains("p", '(property) p: number'); + +goTo.marker('4'); +verify.completionListContains("__proto__", '(property) "__proto__": number'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('"__proto__": 10,'); +verify.not.completionListContains("__proto__", '(property) "__proto__": number'); +verify.completionListContains("p", '(property) p: number'); + +goTo.marker('5'); +verify.completionListContains("___proto__", '(property) ___proto__: string'); +verify.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('__proto__: 10,'); +verify.not.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("___proto__", '(property) ___proto__: string'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('"___proto__": "10",'); +verify.not.completionListContains("__proto__", '(property) __proto__: number'); +verify.not.completionListContains("___proto__", '(property) ___proto__: string'); +verify.completionListContains("p", '(property) p: number'); + +goTo.marker('6'); +verify.completionListContains("___proto__", '(property) ___proto__: string'); +verify.completionListContains("__proto__", '(property) __proto__: number'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('___proto__: "10",'); +verify.completionListContains("__proto__", '(property) __proto__: number'); +verify.not.completionListContains("___proto__", '(property) ___proto__: string'); +verify.completionListContains("p", '(property) p: number'); +edit.insert('"__proto__": 10,'); +verify.not.completionListContains("__proto__", '(property) __proto__: number'); +verify.not.completionListContains("___proto__", '(property) ___proto__: string'); +verify.completionListContains("p", '(property) p: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/protoVarVisibleWithOuterScopeUnderscoreProto.ts b/tests/cases/fourslash/protoVarVisibleWithOuterScopeUnderscoreProto.ts new file mode 100644 index 00000000000..a36f5ddbfe2 --- /dev/null +++ b/tests/cases/fourslash/protoVarVisibleWithOuterScopeUnderscoreProto.ts @@ -0,0 +1,12 @@ +/// + +////// outer +////var ___proto__ = 10; +////function foo() { +//// var __proto__ = "hello"; +//// /**/ +////} + +goTo.marker(''); +verify.completionListContains("__proto__", '(local var) __proto__: string'); +verify.completionListContains("___proto__", '(var) ___proto__: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoOnNarrowedType.ts b/tests/cases/fourslash/quickInfoOnNarrowedType.ts new file mode 100644 index 00000000000..bc1d8126d76 --- /dev/null +++ b/tests/cases/fourslash/quickInfoOnNarrowedType.ts @@ -0,0 +1,22 @@ +/// + +////function foo(strOrNum: string | number) { +//// if (typeof /*1*/strOrNum === "number") { +//// return /*2*/strOrNum; +//// } +//// else { +//// return /*3*/strOrNum.length; +//// } +////} + +goTo.marker('1'); +verify.quickInfoIs('(parameter) strOrNum: string | number'); +verify.completionListContains("strOrNum", "(parameter) strOrNum: string | number"); + +goTo.marker('2'); +verify.quickInfoIs('(parameter) strOrNum: number'); +verify.completionListContains("strOrNum", "(parameter) strOrNum: number"); + +goTo.marker('3'); +verify.quickInfoIs('(parameter) strOrNum: string'); +verify.completionListContains("strOrNum", "(parameter) strOrNum: string"); diff --git a/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts b/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts new file mode 100644 index 00000000000..79d794a9c0d --- /dev/null +++ b/tests/cases/fourslash/quickInfoOnNarrowedTypeInModule.ts @@ -0,0 +1,51 @@ +/// + +////var strOrNum: string | number; +////module m { +//// var nonExportedStrOrNum: string | number; +//// export var exportedStrOrNum: string | number; +//// var num: number; +//// var str: string; +//// if (typeof /*1*/nonExportedStrOrNum === "number") { +//// num = /*2*/nonExportedStrOrNum; +//// } +//// else { +//// str = /*3*/nonExportedStrOrNum.length; +//// } +//// if (typeof /*4*/exportedStrOrNum === "number") { +//// strOrNum = /*5*/exportedStrOrNum; +//// } +//// else { +//// strOrNum = /*6*/exportedStrOrNum; +//// } +////} +////if (typeof m./*7*/exportedStrOrNum === "number") { +//// strOrNum = m./*8*/exportedStrOrNum; +////} +////else { +//// strOrNum = m./*9*/exportedStrOrNum; +////} + +goTo.marker('1'); +verify.quickInfoIs('(var) nonExportedStrOrNum: string | number'); +verify.completionListContains("nonExportedStrOrNum", "(var) nonExportedStrOrNum: string | number"); + +goTo.marker('2'); +verify.quickInfoIs('(var) nonExportedStrOrNum: number'); +verify.completionListContains("nonExportedStrOrNum", "(var) nonExportedStrOrNum: number"); + +goTo.marker('3'); +verify.quickInfoIs('(var) nonExportedStrOrNum: string'); +verify.completionListContains("nonExportedStrOrNum", "(var) nonExportedStrOrNum: string"); + +['4', '5', '6', '7', '8', '9'].forEach((marker, index, arr) => { + goTo.marker(marker); + verify.quickInfoIs('(var) m.exportedStrOrNum: string | number'); + verify.completionListContains("exportedStrOrNum", "(var) m.exportedStrOrNum: string | number"); +}); + +['7', '8', '9'].forEach((marker, index, arr) => { + goTo.marker(marker); + verify.quickInfoIs('(var) m.exportedStrOrNum: string | number'); + verify.memberListContains("exportedStrOrNum", "(var) m.exportedStrOrNum: string | number"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts b/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts new file mode 100644 index 00000000000..19f6d1062cb --- /dev/null +++ b/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts @@ -0,0 +1,21 @@ +/// + +////module /*0*/M { +//// export class /*1*/C { +//// static x; +//// } +//// export enum /*2*/E { +//// E1 = 0 +//// } +////} +////`abcd${ /*3*/M./*4*/C.x + /*5*/M./*6*/E.E1}efg` + +var c = classification; +verify.semanticClassificationsAre( + c.moduleName("M", test.marker("0").position), + c.className("C", test.marker("1").position), + c.enumName("E", test.marker("2").position), + c.moduleName("M", test.marker("3").position), + c.className("C", test.marker("4").position), + c.moduleName("M", test.marker("5").position), + c.enumName("E", test.marker("6").position)); diff --git a/tests/cases/fourslash/semicolonFormatting.ts b/tests/cases/fourslash/semicolonFormatting.ts index da828e8e389..1522e7b32fa 100644 --- a/tests/cases/fourslash/semicolonFormatting.ts +++ b/tests/cases/fourslash/semicolonFormatting.ts @@ -4,4 +4,4 @@ goTo.eof(); edit.insert(';'); -verify.currentLineContentIs('function of1 (b:{ r:{ c: number;'); \ No newline at end of file +verify.currentLineContentIs('function of1(b: { r: { c: number;'); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentStartLineInLists.ts b/tests/cases/fourslash/smartIndentStartLineInLists.ts new file mode 100644 index 00000000000..0150881ff34 --- /dev/null +++ b/tests/cases/fourslash/smartIndentStartLineInLists.ts @@ -0,0 +1,8 @@ +/// +////foo(function () { +////}).then(function () {/*1*/ +////}) + +goTo.marker("1"); +edit.insert("\r\n"); +verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/spaceAfterReturn.ts b/tests/cases/fourslash/spaceAfterReturn.ts index 16b44d81024..e59b604f976 100644 --- a/tests/cases/fourslash/spaceAfterReturn.ts +++ b/tests/cases/fourslash/spaceAfterReturn.ts @@ -5,7 +5,7 @@ ////return[1];/*2*/ ////return ;/*3*/ ////} - +debugger; format.document(); goTo.marker("1"); verify.currentLineContentIs(" return 1;"); diff --git a/tests/cases/fourslash/syntacticClassificationsTemplates1.ts b/tests/cases/fourslash/syntacticClassificationsTemplates1.ts new file mode 100644 index 00000000000..4c79c047c81 --- /dev/null +++ b/tests/cases/fourslash/syntacticClassificationsTemplates1.ts @@ -0,0 +1,15 @@ +/// + +////var v = 10e0; +////var x = { +//// p1: `hello world`, +//// p2: `goodbye ${0} cruel ${0} world`, +////}; + +var c = classification; +verify.syntacticClassificationsAre( + c.keyword("var"), c.text("v"), c.operator("="), c.numericLiteral("10e0"), c.punctuation(";"), + c.keyword("var"), c.text("x"), c.operator("="), c.punctuation("{"), + c.text("p1"), c.punctuation(":"), c.stringLiteral("`hello world`"), c.punctuation(","), + c.text("p2"), c.punctuation(":"), c.stringLiteral("`goodbye ${"), c.numericLiteral("0"), c.stringLiteral("} cruel ${"), c.numericLiteral("0"), c.stringLiteral("} world`"), c.punctuation(","), + c.punctuation("}"), c.punctuation(";")); \ No newline at end of file diff --git a/tests/cases/fourslash/syntacticClassificationsTemplates2.ts b/tests/cases/fourslash/syntacticClassificationsTemplates2.ts new file mode 100644 index 00000000000..19bad4b54a8 --- /dev/null +++ b/tests/cases/fourslash/syntacticClassificationsTemplates2.ts @@ -0,0 +1,11 @@ +/// + +////var tiredOfCanonicalExamples = +////`goodbye "${ `hello world` }" +////and ${ `good${ " " }riddance` }`; + +var c = classification; +verify.syntacticClassificationsAre( + c.keyword("var"), c.text("tiredOfCanonicalExamples"), c.operator("="), + c.stringLiteral("`goodbye \"${"), c.stringLiteral("`hello world`"), + c.stringLiteral("}\" \nand ${"), c.stringLiteral("`good${"), c.stringLiteral("\" \""), c.stringLiteral("}riddance`"), c.stringLiteral("}`"), c.punctuation(";")); \ No newline at end of file diff --git a/tests/cases/unittests/services/preProcessFile.ts b/tests/cases/unittests/services/preProcessFile.ts new file mode 100644 index 00000000000..88aa0f5e9ed --- /dev/null +++ b/tests/cases/unittests/services/preProcessFile.ts @@ -0,0 +1,113 @@ +/// +/// + +describe('PreProcessFile:', function () { + function test(sourceText: string, readImportFile: boolean, expectedPreProcess: ts.PreProcessedFileInfo): void { + var resultPreProcess = ts.preProcessFile(sourceText, readImportFile); + + var resultIsLibFile = resultPreProcess.isLibFile; + var resultImportedFiles = resultPreProcess.importedFiles; + var resultReferencedFiles = resultPreProcess.referencedFiles; + + var expectedIsLibFile = expectedPreProcess.isLibFile; + var expectedImportedFiles = expectedPreProcess.importedFiles; + var expectedReferencedFiles = expectedPreProcess.referencedFiles; + + assert.equal(resultIsLibFile, expectedIsLibFile, "Pre-processed file has different value for isLibFile. Expected: " + expectedPreProcess + ". Actual: " + resultIsLibFile); + + assert.equal(resultImportedFiles.length, expectedImportedFiles.length, + "Array's length of imported files does not match expected. Expected: " + expectedImportedFiles.length + ". Actual: " + resultImportedFiles.length); + + assert.equal(resultReferencedFiles.length, expectedReferencedFiles.length, + "Array's length of referenced files does not match expected. Expected: " + expectedReferencedFiles.length + ". Actual: " + resultReferencedFiles.length); + + for (var i = 0; i < expectedImportedFiles.length; ++i) { + var resultImportedFile = resultImportedFiles[i]; + var expectedImportedFile = expectedImportedFiles[i]; + + assert.equal(resultImportedFile.filename, expectedImportedFile.filename, "Imported file path does not match expected. Expected: " + expectedImportedFile.filename + ". Actual: " + resultImportedFile.filename + "."); + + assert.equal(resultImportedFile.pos, expectedImportedFile.pos, "Imported file position does not match expected. Expected: " + expectedImportedFile.pos + ". Actual: " + resultImportedFile.pos + "."); + + assert.equal(resultImportedFile.end, expectedImportedFile.end, "Imported file length does not match expected. Expected: " + expectedImportedFile.end + ". Actual: " + resultImportedFile.end + "."); + } + + for (var i = 0; i < expectedReferencedFiles.length; ++i) { + var resultReferencedFile = resultReferencedFiles[i]; + var expectedReferencedFile = expectedReferencedFiles[i]; + + assert.equal(resultReferencedFile.filename, expectedReferencedFile.filename, "Referenced file path does not match expected. Expected: " + expectedReferencedFile.filename + ". Actual: " + resultReferencedFile.filename + "."); + + assert.equal(resultReferencedFile.pos, expectedReferencedFile.pos, "Referenced file position does not match expected. Expected: " + expectedReferencedFile.pos + ". Actual: " + resultReferencedFile.pos + "."); + + assert.equal(resultReferencedFile.end, expectedReferencedFile.end, "Referenced file length does not match expected. Expected: " + expectedReferencedFile.end + ". Actual: " + resultReferencedFile.end + "."); + } + } + describe("Test preProcessFiles,", function () { + it("Correctly return referenced files from triple slash", function () { + test("///" + "\n" + "///" + "\n" + "///" + "\n" + "///", true, + { + referencedFiles: [{ filename: "refFile1.ts", pos: 0, end: 37 }, { filename: "refFile2.ts", pos: 38, end: 73 }, + { filename: "refFile3.ts", pos: 74, end: 109 }, { filename: "..\\refFile4d.ts", pos: 110, end: 150 }], + importedFiles: [], + isLibFile: false + }); + }), + + it("Do not return reference path because of invalid triple-slash syntax", function () { + test("///" + "\n" + "///" + "\n" + "///" + "\n" + "///", true, + { + referencedFiles: [], + importedFiles: [], + isLibFile: false + }); + }), + + it("Correctly return imported files", function () { + test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");", true, + { + referencedFiles: [], + importedFiles: [{ filename: "r1.ts", pos: 20, end: 25 }, { filename: "r2.ts", pos: 49, end: 54 }, { filename: "r3.ts", pos: 78, end: 83 }, + { filename: "r4.ts", pos: 106, end: 111 }, { filename: "r5.ts", pos: 138, end: 143 }], + isLibFile: false + }); + }), + + it("Do not return imported files if readImportFiles argument is false", function () { + test("import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\"); import i3= require(\"r3.ts\"); import i4=require(\"r4.ts\"); import i5 = require (\"r5.ts\");", false, + { + referencedFiles: [], + importedFiles: [], + isLibFile: false + }); + }), + + it("Do not return import path because of invalid import syntax", function () { + test("import i1 require(\"r1.ts\"); import = require(\"r2.ts\") import i3= require(\"r3.ts\"); import i5", true, + { + referencedFiles: [], + importedFiles: [{ filename: "r3.ts", pos: 73, end: 78 }], + isLibFile: false + }); + }), + + it("Correctly return referenced files and import files", function () { + test("///" + "\n" + "///" + "\n" + "import i1 = require(\"r1.ts\"); import i2 =require(\"r2.ts\");", true, + { + referencedFiles: [{ filename: "refFile1.ts", pos: 0, end: 35 }, { filename: "refFile2.ts", pos: 36, end: 71 }], + importedFiles: [{ filename: "r1.ts", pos: 92, end: 97 }, { filename: "r2.ts", pos: 121, end: 126 }], + isLibFile: false + }); + }), + + it("Correctly return referenced files and import files even with some invalid syntax", function () { + test("///" + "\n" + "///" + "\n" + "import i1 = require(\"r1.ts\"); import = require(\"r2.ts\"); import i2 = require(\"r3.ts\");", true, + { + referencedFiles: [{ filename: "refFile1.ts", pos: 0, end: 35 }], + importedFiles: [{ filename: "r1.ts", pos: 91, end: 96 }, { filename: "r3.ts", pos: 148, end: 153 }], + isLibFile: false + }) + }); + }); +}); +